Skip to content
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

database import of graphson clobbers vertex IDs #1714

Open
justin2004 opened this issue Sep 6, 2024 · 0 comments
Open

database import of graphson clobbers vertex IDs #1714

justin2004 opened this issue Sep 6, 2024 · 0 comments

Comments

@justin2004
Copy link

justin2004 commented Sep 6, 2024

given this graphson file:

output.graphson

{"id": "http://www.w3.org/2000/01/rdf-schema#Datatype", "label": "http://www.w3.org/2000/01/rdf-schema#Class", "outE": {"subClassOf": [{"id": "0", "inV": "http://www.w3.org/2000/01/rdf-schema#Class"}], "isDefinedBy": [{"id": "3", "inV": "http://www.w3.org/2000/01/rdf-schema#"}], "type": [{"id": "4", "inV": "http://www.w3.org/2000/01/rdf-schema#Class"}]}, "properties": {"comment": [{"value": "\"The class of RDF datatypes.\""}], "label": [{"value": "\"Datatype\""}]}}
{"id": "http://www.w3.org/2000/01/rdf-schema#", "label": "owl:Thing"}
{"id": "http://www.w3.org/2000/01/rdf-schema#Class", "label": "owl:Thing"}
> create database test

Database 'test' created
{test}> import database file:///mnt/output.graphson

then if i run the gremlin query g.V() i get:

"@rid","@type","comment","label","@in","@out"
"#1:0","http://www.w3.org/2000/01/rdf-...","""The class of RDF datatypes.""","""Datatype""","0","0"
"#25:0","owl:Thing","<null>","<null>","0","0"
"#28:0","owl:Thing","<null>","<null>","0","0"

notice how the @rid column does not have the id that was used in the graphson file.
i expect the id in the graphson file to be preserved.

the gremlin console preserves that id:

gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> reader = GraphSONReader.build().create()
==>org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader@105dc04d
gremlin> is = new FileInputStream('/home/gremlin/data/output.graphson')
==>java.io.FileInputStream@618f627b
gremlin> reader.readGraph(is, graph)
==>null
gremlin> g = traversal().withEmbedded(graph)
==>graphtraversalsource[tinkergraph[vertices:3 edges:0], standard]
gremlin> g.V()
==>v[http://www.w3.org/2000/01/rdf-schema#Datatype]
==>v[http://www.w3.org/2000/01/rdf-schema#Class]
==>v[http://www.w3.org/2000/01/rdf-schema#]
gremlin> g.V('http://www.w3.org/2000/01/rdf-schema#Datatype')
==>v[http://www.w3.org/2000/01/rdf-schema#Datatype]

noticed how the gremlin console preserves the id in the graphson file.

it seems arcade does not like ids that the gremlin console accepts:

Set language to gremlin
{test}> g.V('http://www.w3.org/2000/01/rdf-schema#Datatype')

ERROR:
java.lang.IllegalArgumentException: The RID 'http://www.w3.org/2000/01/rdf-schema#Datatype' is not valid
        at com.arcadedb.database.RID.<init>(RID.java:71)
        at com.arcadedb.gremlin.ArcadeGraph.vertices(ArcadeGraph.java:311)
        at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.lambda$new$0(GraphStep.java:70)
        at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:158)
        at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:155)
        at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
        at com.arcadedb.gremlin.ArcadeGremlin$2.hasNext(ArcadeGremlin.java:112)
        at com.arcadedb.query.sql.executor.IteratorResultSet.hasNext(IteratorResultSet.java:37)
        at com.arcadedb.console.Console.executeSQL(Console.java:625)
        at com.arcadedb.console.Console.execute(Console.java:273)
        at com.arcadedb.console.Console.parse(Console.java:742)
        at com.arcadedb.console.Console.interactiveMode(Console.java:131)
        at com.arcadedb.console.Console.execute(Console.java:185)
        at com.arcadedb.console.Console.main(Console.java:148)

running:
ArcadeDB Server v24.8.1-SNAPSHOT
in the docker image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant