Skip to content

Commit

Permalink
Merge pull request #8228 from FlorentinD/schema-reltypes-mismatch-25
Browse files Browse the repository at this point in the history
 Fix inconsistency between rel-types and schema
  • Loading branch information
FlorentinD authored Oct 10, 2023
2 parents 1b693b9 + 3ab8de6 commit ddd841c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ void testNodeLabels(String labels) {
"RETURN gds.graph.project('g', s, null, { sourceNodeLabels: " + labels + ", targetNodeLabels: NULL })");

var graphStore = GraphStoreCatalog.get("", db.databaseName(), "g").graphStore();

assertThat(graphStore.relationshipTypes()).containsExactlyInAnyOrderElementsOf(graphStore.schema().relationshipSchema().availableTypes());

assertThat(graphStore.nodeLabels()).extracting(NodeLabel::name).containsExactly("A", "B");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.neo4j.gds.RelationshipType;
import org.neo4j.gds.annotation.ValueClass;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.api.schema.Direction;
import org.neo4j.gds.api.schema.GraphSchema;
import org.neo4j.gds.api.schema.MutableGraphSchema;
import org.neo4j.gds.api.schema.MutableNodeSchema;
Expand Down Expand Up @@ -186,9 +185,6 @@ public static MutableGraphSchema filterSchema(GraphSchema inputGraphSchema, Node
.relationshipSchema()
.filter(filteredRelationshipTypes)
);
if (relationshipSchema.availableTypes().isEmpty()) {
relationshipSchema.addRelationshipType(RelationshipType.ALL_RELATIONSHIPS, Direction.DIRECTED);
}

return MutableGraphSchema.of(nodeSchema, relationshipSchema, Map.of());
}
Expand Down

0 comments on commit ddd841c

Please sign in to comment.