-
Notifications
You must be signed in to change notification settings - Fork 77
feat(java,info): support multi-property in yaml #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |||||||||||||||||||||||||||||||||||||||||
| import java.util.stream.Collectors; | ||||||||||||||||||||||||||||||||||||||||||
| import java.util.stream.Stream; | ||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.type.AdjListType; | ||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.type.Cardinality; | ||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.type.DataType; | ||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.yaml.EdgeYaml; | ||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.yaml.GraphYaml; | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -496,12 +497,14 @@ public URI getEdgesNumFileUri(AdjListType adjListType, long vertexChunkIndex) { | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| public void dump(Writer output) { | ||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | ||||||||||||||||||||||||||||||||||||||||||
| EdgeYaml edgeYaml = new EdgeYaml(this); | ||||||||||||||||||||||||||||||||||||||||||
| yaml.dump(edgeYaml, output); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| public String dump() { | ||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+500
to
+507
|
||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| EdgeYaml edgeYaml = new EdgeYaml(this); | |
| yaml.dump(edgeYaml, output); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("EdgeInfo object is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| EdgeYaml edgeYaml = new EdgeYaml(this); | |
| yaml.dump(edgeYaml, output); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("EdgeInfo object is not valid and cannot be dumped."); | |
| } |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] EdgeInfo doesn't expose a getCardinality(String propertyName) method like VertexInfo does (line 89 in VertexInfo.java). For API consistency, consider adding this method to EdgeInfo as well, which would always return Cardinality.SINGLE for valid edge properties. This would provide a uniform API across both VertexInfo and EdgeInfo.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -128,18 +128,21 @@ private GraphInfo( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public void dump(URI storeUri, Writer output) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaml.dump(graphYaml, output); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public String dump(URI storeUri) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return yaml.dump(graphYaml); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public String dump() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+131
to
+145
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to isValidated() doesn't use its return value. If the intent is to validate before dumping, this should either throw an exception when validation fails, or check the return value and throw an appropriate exception. As written, invalid GraphInfo objects can still be dumped to YAML.
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to isValidated() doesn't use its return value. If the intent is to validate before dumping, this should either throw an exception when validation fails, or check the return value and throw an appropriate exception. As written, invalid GraphInfo objects can still be dumped to YAML.
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| yaml.dump(graphYaml, output); | |
| } | |
| public String dump(URI storeUri) { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| GraphYaml graphYaml = new GraphYaml(storeUri, this); | |
| return yaml.dump(graphYaml); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("GraphInfo is not valid and cannot be dumped."); | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.List; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.Optional; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.Set; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.type.Cardinality; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.type.DataType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.yaml.GraphYaml; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.graphar.info.yaml.VertexYaml; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -85,6 +86,10 @@ public int getPropertyGroupNum() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return propertyGroups.getPropertyGroupNum(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public Cardinality getCardinality(String propertyName) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return propertyGroups.getCardinality(propertyName); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public DataType getPropertyType(String propertyName) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return propertyGroups.getPropertyType(propertyName); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -124,12 +129,14 @@ public URI getVerticesNumFileUri() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public void dump(Writer output) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VertexYaml vertexYaml = new VertexYaml(this); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| yaml.dump(vertexYaml, output); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public String dump() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+132
to
+139
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| VertexYaml vertexYaml = new VertexYaml(this); | |
| yaml.dump(vertexYaml, output); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("VertexInfo object is not valid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| VertexYaml vertexYaml = new VertexYaml(this); | |
| yaml.dump(vertexYaml, output); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("VertexInfo object is not valid and cannot be dumped."); | |
| } |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to isValidated() doesn't use its return value. If the intent is to validate before dumping, this should either throw an exception when validation fails, or check the return value and throw an appropriate exception. As written, invalid VertexInfo objects can still be dumped to YAML.
| isValidated(); | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| VertexYaml vertexYaml = new VertexYaml(this); | |
| yaml.dump(vertexYaml, output); | |
| } | |
| public String dump() { | |
| isValidated(); | |
| if (!isValidated()) { | |
| throw new IllegalStateException("VertexInfo object is invalid and cannot be dumped."); | |
| } | |
| Yaml yaml = new Yaml(GraphYaml.getRepresenter(), GraphYaml.getDumperOptions()); | |
| VertexYaml vertexYaml = new VertexYaml(this); | |
| yaml.dump(vertexYaml, output); | |
| } | |
| public String dump() { | |
| if (!isValidated()) { | |
| throw new IllegalStateException("VertexInfo object is invalid and cannot be dumped."); | |
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,11 @@ public abstract class BaseGraphInfoSaver implements GraphInfoSaver { | |||||
|
|
||||||
| @Override | ||||||
| public void save(URI graphInfoUri, GraphInfo graphInfo) throws IOException { | ||||||
| // if graphInfoUri is a directory then save to ${graphInfo.name}.graph.yml | ||||||
|
||||||
| // if graphInfoUri is a directory then save to ${graphInfo.name}.graph.yml | |
| // if graphInfoUri is a directory then save to ${graphInfo.name}.graph.yaml |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions .vertex.yml but the code uses .vertex.yaml on line 59. Update the comment to match the actual file extension used in the code.
| // if vertexInfoUri is a directory then save to ${vertexInfo.type}.vertex.yml | |
| // if vertexInfoUri is a directory then save to ${vertexInfo.type}.vertex.yaml |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions .edge.yml but the code uses .edge.yaml on line 70. Update the comment to match the actual file extension used in the code.
| // if edgeInfoUri is a directory then save to ${edgeInfo.getConcat()}.edge.yml | |
| // if edgeInfoUri is a directory then save to ${edgeInfo.getConcat()}.edge.yaml |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||
| /* | ||||||||
| * 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.graphar.info.type; | ||||||||
|
|
||||||||
| /** Defines how multiple values are handled for a given property key. */ | ||||||||
| public enum Cardinality { | ||||||||
| /** Single value property */ | ||||||||
| SINGLE, | ||||||||
| /** List of values property */ | ||||||||
| LIST, | ||||||||
| /** Set of values property (no duplicates) */ | ||||||||
| SET; | ||||||||
|
|
||||||||
|
||||||||
| @Override |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,34 +21,33 @@ | |||||
|
|
||||||
| import java.util.Optional; | ||||||
| import org.apache.graphar.info.Property; | ||||||
| import org.apache.graphar.info.type.DataType; | ||||||
| import org.apache.graphar.info.type.Cardinality; | ||||||
|
|
||||||
| public class PropertyYaml { | ||||||
| private String name; | ||||||
| private String data_type; | ||||||
| private boolean is_primary; | ||||||
| private Optional<Boolean> is_nullable; | ||||||
| private String cardinality; | ||||||
|
|
||||||
| public PropertyYaml() { | ||||||
| this.name = ""; | ||||||
| this.data_type = ""; | ||||||
| this.is_primary = false; | ||||||
| this.is_nullable = Optional.empty(); | ||||||
| this.cardinality = "single"; // Default to single | ||||||
|
||||||
| this.cardinality = "single"; // Default to single | |
| this.cardinality = null; // No default; handle in Property constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to
isValidated()doesn't use its return value. If the intent is to validate before dumping, this should either throw an exception when validation fails, or check the return value and throw an appropriate exception. As written, invalid EdgeInfo objects can still be dumped to YAML.