diff --git a/.github/workflows/client-ci.yml b/.github/workflows/client-ci.yml
index be0dcba37..7275a039e 100644
--- a/.github/workflows/client-ci.yml
+++ b/.github/workflows/client-ci.yml
@@ -25,29 +25,44 @@ jobs:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-client/assembly/travis
# TODO: replace it with the (latest - n) commit id (n >= 15)
- COMMIT_ID: 6a4041e
+ # hugegraph commit date: 2024-10-10
+ COMMIT_ID: 29ecc0
strategy:
fail-fast: false
matrix:
JAVA_VERSION: [ '8' ]
+
steps:
- - name: Install JDK 8
- uses: actions/setup-java@v3
+ - name: Fetch code
+ uses: actions/checkout@v4
with:
- java-version: ${{ matrix.JAVA_VERSION }}
- distribution: 'zulu'
+ fetch-depth: 2
+ # TODO: do we need it? (need test)
- name: Cache Maven packages
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-maven-
- - name: Checkout
- uses: actions/checkout@v3
+ - name: Install JDK 11 for graph server
+ uses: actions/setup-java@v4
with:
- fetch-depth: 2
+ java-version: '11'
+ distribution: 'zulu'
+ cache: 'maven'
+
+ - name: Prepare env and service
+ run: |
+ $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
+
+ - name: Install Java ${{ matrix.JAVA_VERSION }} for client
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.JAVA_VERSION }}
+ distribution: 'zulu'
+ cache: 'maven'
- name: Use staged maven repo
if: ${{ env.USE_STAGE == 'true' }}
@@ -59,10 +74,6 @@ jobs:
run: |
mvn -e compile -pl hugegraph-client -Dmaven.javadoc.skip=true -ntp
- - name: Prepare env and service
- run: |
- $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
-
- name: Run test
run: |
cd hugegraph-client && ls *
diff --git a/.github/workflows/loader-ci.yml b/.github/workflows/loader-ci.yml
index 420b473c3..d537583fb 100644
--- a/.github/workflows/loader-ci.yml
+++ b/.github/workflows/loader-ci.yml
@@ -27,7 +27,7 @@ jobs:
TRAVIS_DIR: hugegraph-loader/assembly/travis
STATIC_DIR: hugegraph-loader/assembly/static
# TODO: replace it with the (latest - n) commit id (n >= 15)
- COMMIT_ID: 6a4041e
+ COMMIT_ID: f6f3708
DB_USER: root
DB_PASS: root
DB_DATABASE: load_test
diff --git a/.github/workflows/spark-connector-ci.yml b/.github/workflows/spark-connector-ci.yml
index 29ea58ca0..b34169ef4 100644
--- a/.github/workflows/spark-connector-ci.yml
+++ b/.github/workflows/spark-connector-ci.yml
@@ -25,7 +25,7 @@ jobs:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-spark-connector/assembly/travis
- COMMIT_ID: 6a4041e
+ COMMIT_ID: f6f3708
steps:
- name: Install JDK 11
uses: actions/setup-java@v4
diff --git a/hugegraph-client/pom.xml b/hugegraph-client/pom.xml
index 08b8d3ebe..d9b95e939 100644
--- a/hugegraph-client/pom.xml
+++ b/hugegraph-client/pom.xml
@@ -27,6 +27,7 @@
hugegraph-client
+ ${revision}
jar
${project.artifactId}
@@ -48,6 +49,9 @@
org.mockito
mockito-core
+
+ ${mockito.version}
test
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
index 915cb1701..1b6982a3d 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
@@ -77,6 +77,7 @@ public GraphElement property(String name, Object value) {
E.checkArgument(ReflectionUtil.isSimpleType(clazz) ||
clazz.equals(UUID.class) ||
clazz.equals(Date.class) ||
+ clazz.equals(byte[].class) ||
value instanceof List ||
value instanceof Set,
"Invalid property value type: '%s'", clazz);
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/EdgeLabelType.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/EdgeLabelType.java
new file mode 100644
index 000000000..34db91d4b
--- /dev/null
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/EdgeLabelType.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hugegraph.structure.constant;
+
+public enum EdgeLabelType {
+
+ NORMAL(0, "NORMAL"),
+
+ PARENT(1, "PARENT"),
+
+ SUB(2, "SUB");
+
+ private byte code = 0;
+ private String name = null;
+
+ EdgeLabelType(int code, String name) {
+ assert code < 256;
+ this.code = (byte) code;
+ this.name = name;
+ }
+
+ public boolean parent() {
+ return this == PARENT;
+ }
+
+ public boolean sub() {
+ return this == SUB;
+ }
+
+ public boolean normal() {
+ return this == NORMAL;
+ }
+
+ public byte code() {
+ return this.code;
+ }
+
+ public String string() {
+ return this.name;
+ }
+}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
index d5275b409..fe7352581 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
@@ -142,10 +142,10 @@ public void targetLabel(String targetLabel) {
public String name() {
if (this.name == null) {
String[] idParts = SplicingIdGenerator.split(this.id);
- E.checkState(idParts.length == 4,
- "The edge id must be formatted by 4 parts, " +
+ E.checkState(idParts.length == 5 || idParts.length == 6,
+ "The edge id must be formatted by 5~6 parts, " +
"actual is %s", idParts.length);
- this.name = idParts[2];
+ this.name = idParts[idParts.length - 2];
}
return this.name;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java
index 807ddec9a..b2746ada0 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/EdgeLabel.java
@@ -18,13 +18,17 @@
package org.apache.hugegraph.structure.schema;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
+import org.apache.hugegraph.driver.SchemaManager;
+import org.apache.hugegraph.structure.constant.EdgeLabelType;
import org.apache.hugegraph.structure.constant.Frequency;
import org.apache.hugegraph.structure.constant.HugeType;
-import org.apache.hugegraph.driver.SchemaManager;
-
import org.apache.hugegraph.util.CollectionUtil;
import org.apache.hugegraph.util.E;
@@ -33,12 +37,14 @@
public class EdgeLabel extends SchemaLabel {
+ @JsonProperty("edgelabel_type")
+ private EdgeLabelType edgeLabelType = EdgeLabelType.NORMAL;
+ @JsonProperty("parent_label")
+ private String parentLabel;
@JsonProperty("frequency")
private Frequency frequency;
- @JsonProperty("source_label")
- private String sourceLabel;
- @JsonProperty("target_label")
- private String targetLabel;
+ @JsonProperty("links")
+ private Set