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

Cannot create an edge with a class of which name contains colons (:) #9517

Closed
rhdxmr opened this issue Jan 19, 2021 · 4 comments
Closed

Cannot create an edge with a class of which name contains colons (:) #9517

rhdxmr opened this issue Jan 19, 2021 · 4 comments

Comments

@rhdxmr
Copy link

rhdxmr commented Jan 19, 2021

OrientDB Version: docker image of orientdb:3.1-tp3

Java Version:

OS:

Expected behavior

edge is added to vertices successfully

Actual behavior

2021-01-19 13:51:19:614 INFO {db=demodb} created class 'myedge:knows3' as subclass of 'E' [OrientGraph]Exception processing a Traversal on iteration for reque
st [41e3fbb0-ca3b-4bc6-a5df-e9f3e4b5517d].
java.lang.IllegalArgumentException: Invalid field name 'out_myedge:knows3'. Character ':' is invalid
at com.orientechnologies.orient.core.record.impl.ODocument.checkFieldName(ODocument.java:3295)
at com.orientechnologies.orient.core.record.impl.ODocument.field(ODocument.java:1598)
at com.orientechnologies.orient.core.record.impl.OVertexDelegate.createLink(OVertexDelegate.java:574)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.addEdgeInternal(ODatabaseDocumentAbstract.java:1557)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.newEdge(ODatabaseDocumentAbstract.java:1448)
at com.orientechnologies.orient.core.record.impl.OVertexDocument.addEdge(OVertexDocument.java:227)
at org.apache.tinkerpop.gremlin.orientdb.OrientVertex.addEdge(OrientVertex.java:139)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeStep.map(AddEdgeStep.java:109)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeStep.map(AddEdgeStep.java:48)
at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:37)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:197)
at org.apache.tinkerpop.gremlin.server.util.TraverserIterator.fillBulker(TraverserIterator.java:69)
at org.apache.tinkerpop.gremlin.server.util.TraverserIterator.hasNext(TraverserIterator.java:56)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:512)
at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$4(TraversalOpProcessor.java:411)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Steps to reproduce

create class e:knows extends e
=> this suceeds
create edge e:knows from #10:0 to #11:0
=> but this fails

@rhdxmr
Copy link
Author

rhdxmr commented Jan 19, 2021

The class with colons can be created successfully. But vertices can not use the class.
I hope that colons are available for a label of an edge.
It is very common to use colons as labels when we deals with RDF.

Is there a workaround for using colon as a label of an edge??

@luigidellaquila
Copy link
Member

Hi @rhdxmr

You can use back-tick quotes in this case:

create edge `e:knows` from #10:0 to #11:0

Thanks

Luigi

@rhdxmr
Copy link
Author

rhdxmr commented Jan 19, 2021

@luigidellaquila
I used backticks but the sql failed.

@luigidellaquila
Copy link
Member

HI @rhdxmr

I think I got the problem: it's not the class name by itself, but the convention on the field names to connect the edges to the vertices.
I think I can fix it, I'll let you know ASAP

Thanks

Luigi

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

No branches or pull requests

2 participants