GitHub user wangzhewwzz added a comment to the discussion: 关于电网拓扑数据导入

您好 我现在贴出我的完整脚本和数据块 
最下面是导入报错说属性键'source_label'不存在。这是因为在HugeGraph的schema中还没有定义这个属性键。我们需要在schema定义文件中添加这个属性键的定义 
 那么我改怎么定义呢




{
  "vertices": [
    {
      "label": "Substation",
      "input": {
        "type": "file",
        "path": 
"/loader/power_data/vertex_substation-1.csv",
        "format": "CSV",
        "header": ["id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", "belongFeeder"],
        "charset": "UTF-8"
      },
      "null_values": ["NULL", "null", ""]
    },
    {
      "label": "LineSegment",
      "input": {
        "type": "file",
        "path": 
"/loader/power_data/vertex_linesegment-1.csv",
        "format": "CSV",
        "header": ["id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", "belongFeeder"],
        "charset": "UTF-8"
      },
      "null_values": ["NULL", "null", ""]
    },
     {
      "label": "LineSwitch",
      "input": {
        "type": "file",
        "path": 
"/loader/power_data/vertex_lineswitch-1.csv",
        "format": "CSV",
        "header": ["id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", "belongFeeder"],
        "charset": "UTF-8"
      },
      "null_values": ["NULL", "null", ""]
    },
    {
      "label": "StationHouse",
      "input": {
        "type": "file",
        "path": 
"/loader/power_data/vertex_stationhouse-1.csv",
        "format": "CSV",
        "header": ["id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", "belongFeeder"],
        "charset": "UTF-8"
      },
      "null_values": ["NULL", "null", ""]
    }
  ],
  "edges": [
    {
      "label": "Substation2LineSegment",
      "source": ["from"],
      "target": ["to"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
         "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "Substation2LineSegment",
          "source_label": { "Substation": "Substation" 
},
          "target_label": { "LineSegment": 
"LineSegment" }
        }
      }
    },
    {
      "label": "LineSegment2Substation",
      "source": ["to"],
      "target": ["from"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
        "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSegment2Substation",
          "source_label": { "LineSegment": 
"LineSegment" },
          "target_label": { "Substation": "Substation" 
}
        }
      }
    },
    {
      "label": "LineSegment2StationHouse",
      "source": ["from"],
      "target": ["to"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
          "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSegment2StationHouse",
          "source_label": { "LineSegment": 
"LineSegment" },
          "target_label": { "StationHouse": 
"StationHouse" }
        }
      }
    },
    {
      "label": "StationHouse2LineSegment",
      "source": ["to"],
      "target": ["from"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
          "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "StationHouse2LineSegment",
          "source_label": { "StationHouse": 
"StationHouse" },
          "target_label": { "LineSegment": 
"LineSegment" }
        }
      }
    },
    {
      "label": "StationHouse2LineSwitch",
      "source": ["from"],
      "target": ["to"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
          "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "StationHouse2LineSwitch",
          "source_label": { "StationHouse": 
"StationHouse" },
          "target_label": { "LineSwitch": "LineSwitch" 
}
        }
      }
    },
    {
      "label": "LineSwitch2StationHouse",
      "source": ["to"],
      "target": ["from"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
          "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSwitch2StationHouse",
          "source_label": { "LineSwitch": "LineSwitch" 
},
          "target_label": { "StationHouse": 
"StationHouse" }
        }
      }
    },
    {
      "label": "LineSegment2LineSegment",
      "source": ["from"],
      "target": ["to"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
         "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSegment2LineSegment",
          "source_label": { "LineSegment": 
"LineSegment" },
          "target_label": { "LineSegment": 
"LineSegment" }
        }
      }
    },
    {
      "label": "LineSegment2LineSwitch",
      "source": ["to"],
      "target": ["from"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
         "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSegment2LineSwitch",
          "source_label": { "LineSegment": 
"LineSegment" },
          "target_label": { "LineSwitch": "LineSwitch" 
}
        }
      }
    },
    {
      "label": "LineSwitch2LineSegment",
      "source": ["from"],
      "target": ["to"],
      "input": {
        "type": "file",
        "path": "/loader/power_data/edge_connected_to.csv",
        "format": "CSV",
         "header": ["id", "from", "to", "label", 
"source_label", "target_label"]
      },
      "field_mapping": { "from": "id", "to": "id" },
      "value_mapping": {
        "label": {
          "CONNECTED_TO": "LineSwitch2LineSegment",
          "source_label": { "LineSwitch": "LineSwitch" 
},
          "target_label": { "LineSegment": 
"LineSegment" }
        }
      }
    }
  ]
}










// 属性定义
schema.propertyKey("id").asText().ifNotExist().create();
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("objectType").asText().ifNotExist().create();
schema.propertyKey("objectHandle").asText().ifNotExist().create();
schema.propertyKey("deviceType").asText().ifNotExist().create();
schema.propertyKey("internalEndpointNo").asInt().ifNotExist().create();
schema.propertyKey("terminalNo").asInt().ifNotExist().create();
schema.propertyKey("usage").asText().ifNotExist().create();
schema.propertyKey("powerFlowDirection").asInt().ifNotExist().create();
schema.propertyKey("belongSubstation").asText().ifNotExist().create();
schema.propertyKey("belongFeeder").asText().ifNotExist().create();


// 顶点标签
schema.vertexLabel("Substation").properties("id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", 
"belongFeeder").primaryKeys("id").ifNotExist().create();
schema.vertexLabel("LineSegment").properties("id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", 
"belongFeeder").primaryKeys("id").ifNotExist().create();
schema.vertexLabel("LineSwitch").properties("id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", 
"belongFeeder").primaryKeys("id").ifNotExist().create();
schema.vertexLabel("StationHouse").properties("id", "name", "objectType", 
"objectHandle", "deviceType", "internalEndpointNo", "terminalNo", "usage", 
"powerFlowDirection", "belongSubstation", 
"belongFeeder").primaryKeys("id").ifNotExist().create();


// 边标签(每种类型对每种类型都定义一条边,便于扩展和双向连接)
schema.edgeLabel("Substation2LineSegment").sourceLabel("Substation").targetLabel("LineSegment").properties().ifNotExist().create();
schema.edgeLabel("LineSegment2StationHouse").sourceLabel("LineSegment").targetLabel("StationHouse").properties().ifNotExist().create();
schema.edgeLabel("LineSegment2LineSegment").sourceLabel("LineSegment").targetLabel("LineSegment").properties().ifNotExist().create();
schema.edgeLabel("StationHouse2LineSwitch").sourceLabel("StationHouse").targetLabel("LineSwitch").properties().ifNotExist().create();
schema.edgeLabel("LineSegment2LineSwitch").sourceLabel("LineSegment").targetLabel("LineSwitch").properties().ifNotExist().create();
// ...根据实际需要继续补充


// 反向边(如需双向,定义反向边标签)
schema.edgeLabel("LineSegment2Substation").sourceLabel("LineSegment").targetLabel("Substation").properties().ifNotExist().create();
schema.edgeLabel("StationHouse2LineSegment").sourceLabel("StationHouse").targetLabel("LineSegment").properties().ifNotExist().create();
//schema.edgeLabel("LineSegment2LineSegment").sourceLabel("LineSegment").targetLabel("LineSegment").properties().ifNotExist().create();
schema.edgeLabel("LineSwitch2StationHouse").sourceLabel("LineSwitch").targetLabel("StationHouse").properties().ifNotExist().create();
schema.edgeLabel("LineSwitch2LineSegment").sourceLabel("LineSwitch").targetLabel("LineSegment").properties().ifNotExist().create();
// ...以此类推


id
from
to
label
source_label
target_label

edge_1
BDZ-3002
XLD-3445
CONNECTED_TO
Substation
LineSegment

edge_2
XLD-3445
HWX-3087
CONNECTED_TO
LineSegment
StationHouse

edge_3
HWX-3087
XLD-3258
CONNECTED_TO
StationHouse
LineSegment

edge_4
HWX-3087
XLD-3455
CONNECTED_TO
StationHouse
LineSegment

edge_5
XLD-3258
HWX-3109
CONNECTED_TO
LineSegment
StationHouse

edge_6
XLD-3455
XLKG-3019
CONNECTED_TO
LineSegment
LineSwitch

edge_7
HWX-3109
XLD-3673
CONNECTED_TO
StationHouse
LineSegment

edge_8
HWX-3109
XLD-3699
CONNECTED_TO
StationHouse
LineSegment

edge_9
HWX-3109
XLD-3505
CONNECTED_TO
StationHouse
LineSegment

edge_10
XLKG-3019
XLD-3724
CONNECTED_TO
LineSwitch
LineSegment

edge_11
XLD-3673
XB-3047
CONNECTED_TO
LineSegment
StationHouse

edge_12
XLD-3699
HWX-3112
CONNECTED_TO
LineSegment
StationHouse

edge_13
XLD-3505
XB-3091
CONNECTED_TO
LineSegment
StationHouse

edge_14
XLD-3724
XLD-3721
CONNECTED_TO
LineSegment
LineSegment

edge_15
XLD-3724
XLD-3722
CONNECTED_TO
LineSegment
LineSegment

edge_16
XLD-3724
XLD-3726
CONNECTED_TO
LineSegment
LineSegment

edge_17
HWX-3112
XLD-3437
CONNECTED_TO
StationHouse
LineSegment

edge_18
HWX-3112
XLD-3666
CONNECTED_TO
StationHouse
LineSegment

edge_19
XLD-3721
ZSB-3017
CONNECTED_TO
LineSegment
StationHouse

edge_20
XLD-3726
ZSB-3016
CONNECTED_TO
LineSegment
StationHouse

edge_21
XLD-3437
DLFZX-3136
CONNECTED_TO
LineSegment
StationHouse

edge_22
XLD-3666
HWX-3062
CONNECTED_TO
LineSegment
StationHouse

edge_23
DLFZX-3136
XLD-3484
CONNECTED_TO
StationHouse
LineSegment

edge_24
HWX-3062
XLD-3267
CONNECTED_TO
StationHouse
LineSegment

edge_25
HWX-3062
XLD-3264
CONNECTED_TO
StationHouse
LineSegment

edge_26
HWX-3062
XLD-3263
CONNECTED_TO
StationHouse
LineSegment

edge_27
XLD-3484
HWX-3085
CONNECTED_TO
LineSegment
StationHouse

edge_28
XLD-3267
DLFZX-3194
CONNECTED_TO
LineSegment
StationHouse

edge_29
XLD-3264
HWX-3063
CONNECTED_TO
LineSegment
StationHouse

edge_30
XLD-3263
HWX-3058
CONNECTED_TO
LineSegment
StationHouse

edge_31
HWX-3085
XLD-3257
CONNECTED_TO
StationHouse
LineSegment

edge_32
HWX-3085
XLD-3629
CONNECTED_TO
StationHouse
LineSegment

edge_33
HWX-3085
XLD-3788
CONNECTED_TO
StationHouse
LineSegment

edge_34
DLFZX-3194
XLD-3274
CONNECTED_TO
StationHouse
LineSegment

edge_35
HWX-3063
XLD-3265
CONNECTED_TO
StationHouse
LineSegment

edge_36
HWX-3058
XLD-3262
CONNECTED_TO
StationHouse
LineSegment

edge_37
XLD-3257
PDS-3068
CONNECTED_TO
LineSegment
StationHouse

edge_38
XLD-3629
HWX-3095
CONNECTED_TO
LineSegment
StationHouse

edge_39
XLD-3788
XB-3079
CONNECTED_TO
LineSegment
StationHouse

edge_40
XLD-3274
PDS-3008
CONNECTED_TO
LineSegment
StationHouse

edge_41
XLD-3265
DLFZX-3183
CONNECTED_TO
LineSegment
StationHouse

edge_42
XLD-3262
HWX-3059
CONNECTED_TO
LineSegment
StationHouse

edge_43
HWX-3095
XLD-3510
CONNECTED_TO
StationHouse
LineSegment

edge_44
HWX-3095
XLD-3383
CONNECTED_TO
StationHouse
LineSegment

edge_45
HWX-3095
XLD-3488
CONNECTED_TO
StationHouse
LineSegment

edge_46
DLFZX-3183
XLD-3266
CONNECTED_TO
StationHouse
LineSegment

edge_47
HWX-3059
XLD-3261
CONNECTED_TO
StationHouse
LineSegment

edge_48
XLD-3510
HWX-3143
CONNECTED_TO
LineSegment
StationHouse

edge_49
XLD-3383
HWX-3084
CONNECTED_TO
LineSegment
StationHouse

edge_50
XLD-3488
HWX-3105
CONNECTED_TO
LineSegment
StationHouse

edge_51
XLD-3266
DLFZX-3112
CONNECTED_TO
LineSegment
StationHouse

edge_52
XLD-3261
HWX-3061
CONNECTED_TO
LineSegment
StationHouse

edge_53
HWX-3143
XLD-3789
CONNECTED_TO
StationHouse
LineSegment

edge_54
HWX-3143
XLD-3790
CONNECTED_TO
StationHouse
LineSegment

edge_55
HWX-3143
XLD-3791
CONNECTED_TO
StationHouse
LineSegment

edge_56
HWX-3084
XLD-3659
CONNECTED_TO
StationHouse
LineSegment

edge_57
HWX-3105
XLD-3502
CONNECTED_TO
StationHouse
LineSegment

edge_58
HWX-3105
XLD-3622
CONNECTED_TO
StationHouse
LineSegment

edge_59
DLFZX-3112
XLD-3365
CONNECTED_TO
StationHouse
LineSegment

edge_60
HWX-3061
XLD-3576
CONNECTED_TO
StationHouse
LineSegment

edge_61
XLD-3789
XB-3048
CONNECTED_TO
LineSegment
StationHouse

edge_62
XLD-3790
XB-3090
CONNECTED_TO
LineSegment
StationHouse

edge_63
XLD-3791
XB-3086
CONNECTED_TO
LineSegment
StationHouse

edge_64
XLD-3659
HWX-3018
CONNECTED_TO
LineSegment
StationHouse

edge_65
XLD-3502
XB-3077
CONNECTED_TO
LineSegment
StationHouse

edge_66
XLD-3622
XB-3080
CONNECTED_TO
LineSegment
StationHouse

edge_67
XLD-3365
HWX-3055
CONNECTED_TO
LineSegment
StationHouse

edge_68
XLD-3576
HWX-3104
CONNECTED_TO
LineSegment
StationHouse

edge_69
HWX-3018
XLD-3450
CONNECTED_TO
StationHouse
LineSegment

edge_70
HWX-3055
XLD-3405
CONNECTED_TO
StationHouse
LineSegment

edge_71
HWX-3055
XLD-3719
CONNECTED_TO
StationHouse
LineSegment

edge_72
HWX-3055
XLD-3638
CONNECTED_TO
StationHouse
LineSegment

edge_73
HWX-3055
XLD-3269
CONNECTED_TO
StationHouse
LineSegment

edge_74
XLD-3450
HWX-3082
CONNECTED_TO
LineSegment
StationHouse

edge_75
XLD-3405
HWX-3004
CONNECTED_TO
LineSegment
StationHouse

edge_76
XLD-3719
XLD-3792
CONNECTED_TO
LineSegment
LineSegment

edge_77
XLD-3719
XLD-3716
CONNECTED_TO
LineSegment
LineSegment

edge_78
XLD-3719
XLD-3720
CONNECTED_TO
LineSegment
LineSegment

edge_79
XLD-3638
DLFZX-3124
CONNECTED_TO
LineSegment
StationHouse

edge_80
XLD-3269
XB-3076
CONNECTED_TO
LineSegment
StationHouse

edge_81
HWX-3082
XLD-3668
CONNECTED_TO
StationHouse
LineSegment

edge_82
HWX-3082
XLD-4124
CONNECTED_TO
StationHouse
LineSegment

edge_83
HWX-3082
XLD-3377
CONNECTED_TO
StationHouse
LineSegment

edge_84
HWX-3082
XLD-3380
CONNECTED_TO
StationHouse
LineSegment

edge_85
HWX-3004
XLD-3625
CONNECTED_TO
StationHouse
LineSegment

edge_86
HWX-3004
XLD-3474
CONNECTED_TO
StationHouse
LineSegment

edge_87
HWX-3004
XLD-3640
CONNECTED_TO
StationHouse
LineSegment

edge_88
XLD-3792
ZSB-3019
CONNECTED_TO
LineSegment
StationHouse

edge_89
XLD-3716
XB-3061
CONNECTED_TO
LineSegment
StationHouse

edge_90
XLD-3720
ZSB-3018
CONNECTED_TO
LineSegment
StationHouse

edge_91
DLFZX-3124
XLD-3540
CONNECTED_TO
StationHouse
LineSegment

edge_92
XLD-3668
HWX-3006
CONNECTED_TO
LineSegment
StationHouse

edge_93
XLD-4124
HWX-3013
CONNECTED_TO
LineSegment
StationHouse

edge_94
XLD-3377
PDS-3091
CONNECTED_TO
LineSegment
StationHouse

edge_95
XLD-3380
PDS-3047
CONNECTED_TO
LineSegment
StationHouse

edge_96
XLD-3625
DLFZX-3258
CONNECTED_TO
LineSegment
StationHouse

edge_97
XLD-3474
DLFZX-3248
CONNECTED_TO
LineSegment
StationHouse

edge_98
XLD-3640
DLFZX-3149
CONNECTED_TO
LineSegment
StationHouse

edge_99
XLD-3540
DLFZX-3256
CONNECTED_TO
LineSegment
StationHouse

edge_100
DLFZX-3258
XLD-3793
CONNECTED_TO
StationHouse
LineSegment

edge_101
DLFZX-3248
XLD-3422
CONNECTED_TO
StationHouse
LineSegment

edge_102
DLFZX-3149
XLD-3268
CONNECTED_TO
StationHouse
LineSegment

edge_103
DLFZX-3256
XLD-3283
CONNECTED_TO
StationHouse
LineSegment

edge_104
XLD-3793
PDS-3006
CONNECTED_TO
LineSegment
StationHouse

edge_105
XLD-3422
PDS-3004
CONNECTED_TO
LineSegment
StationHouse

edge_106
XLD-3268
PDS-3010
CONNECTED_TO
LineSegment
StationHouse

edge_107
XLD-3283
HWX-3009
CONNECTED_TO
LineSegment
StationHouse


导入报错(base) PS C:\Users\GH-76\hugegraph-1.7.0> docker exec -it 
hugegraph-loader bin/hugegraph-loader.sh -g hugegraph -f 
/loader/power_data/struct_1.json -s /loader/power_data/schema_1.groovy -h 
server -p 8080 --clear-all-data true
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in 
[jar:file:/loader/lib/log4j-slf4j-impl-2.18.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in 
[jar:file:/loader/lib/apache-hugegraph-loader-incubating-1.7.0-shaded.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in 
[jar:file:/loader/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will 
impact performance.
ERROR StatusLogger Reconfiguration failed: No configuration found for 'Default' 
at 'null' in 'null'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
org.codehaus.groovy.reflection.CachedClass 
(file:/loader/lib/apache-hugegraph-loader-incubating-1.7.0-shaded.jar) to 
method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of 
org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
>> HugeGraphLoader worked in NORMAL MODE
vertices/edges loaded this time : Exception in thread "main" 
org.apache.hugegraph.loader.exception.LoadException: The property key 
'source_label' doesn't exist
        at 
org.apache.hugegraph.loader.builder.SchemaCache.getPropertyKey(SchemaCache.java:93)
        at 
org.apache.hugegraph.loader.builder.ElementBuilder.getPropertyKey(ElementBuilder.java:257)
        at 
org.apache.hugegraph.loader.builder.ElementBuilder.convertPropertyValue(ElementBuilder.java:320)
        at 
org.apache.hugegraph.loader.builder.ElementBuilder.addProperties(ElementBuilder.java:236)
        at 
org.apache.hugegraph.loader.builder.EdgeBuilder.build(EdgeBuilder.java:114)
        at 
org.apache.hugegraph.loader.task.ParseTaskBuilder.lambda$buildTask$0(ParseTaskBuilder.java:103)
        at 
org.apache.hugegraph.loader.task.ParseTaskBuilder$ParseTask.get(ParseTaskBuilder.java:163)
        at 
org.apache.hugegraph.loader.HugeGraphLoader.executeParseTask(HugeGraphLoader.java:816)
        at 
org.apache.hugegraph.loader.HugeGraphLoader.loadStruct(HugeGraphLoader.java:789)
        at 
org.apache.hugegraph.loader.HugeGraphLoader.lambda$asyncLoadStruct$14(HugeGraphLoader.java:734)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)




         原始邮件
         
       
发件人:dosubot[bot] ***@***.***>
发件时间:2025年12月9日 12:30
收件人:apache/incubator-hugegraph ***@***.***>
抄送:wangzhewwzz ***@***.***>, Mention ***@***.***>
主题:Re: [apache/incubator-hugegraph] 关于电网拓扑数据导入 (Discussion #2917)




edge_connected_to.csv 里的 source_label 和 target_label 两列,应该分别填写 from 和 to 对应顶点的 
label(类型),而且必须和 schema.groovy 里定义的顶点 label 完全一致(区分大小写)。

举例:假设有一行
id,from,to,label,source_label,target_label 
edge_2,XLD-3445,HWX-3087,CONNECTED_TO,LineSegment,StationHouse 

这里 XLD-3445 在 vertex_linesegment-1.csv 里,label 是 LineSegment;HWX-3087 在 
vertex_stationhouse-1.csv 里,label 是 StationHouse,所以 source_label 填 
LineSegment,target_label 填 StationHouse。

你可以用 Excel 或脚本批量查找 from/to 在各自顶点 CSV 里的 label,然后填到 source_label/target_label 
列。只要这两列和 schema.groovy 里的顶点 label 完全一致,struct.json 的 value_mapping 
就能正确筛选和导入所有关系,否则会被跳过但不会报错(官方文档说明)。

导入后建议用 REST API 查询边类型和数量,确认关系是否齐全。如需自动化脚本或 Excel 公式思路可以随时补充需求。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | 
Hallucination | Report 🐛 | Other

   

—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.

GitHub link: 
https://github.com/apache/incubator-hugegraph/discussions/2917#discussioncomment-15204667

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to