orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

OMVRBTreeRIDSet cannot be cast to OIdentifiable - Traversal and various getVertex call fails #2682

Closed machinelearner closed 10 years ago

machinelearner commented 10 years ago

Example query via Gremlin

new GremlinPipeline<>().start(groupVertex).in("BelongsTo").has("_id", Contains.IN, memberIds).remove();

Stack Trace: java.lang.ClassCastException: com.orientechnologies.orient.core.type.tree.OMVRBTreeRIDSet cannot be cast to com.orientechnologies.orient.core.db.record.OIdentifiable at com.tinkerpop.blueprints.impls.orient.OrientEdge.getConnection(OrientEdge.java:66) at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeInverseEdge(OrientVertex.java:370) at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeEdges(OrientVertex.java:227) at com.tinkerpop.blueprints.impls.orient.OrientVertex.remove(OrientVertex.java:571) at com.tinkerpop.gremlin.java.GremlinPipeline.remove(GremlinPipeline.java:1608)

Schema for Group, User and Belongs To: ` Create class Subject extends V ABSTRACT ; Create property subject._id STRING ; alter property subject._id NOTNULL true

Create class User extends Subject ; Create property user.name STRING

Create class Group extends Subject ; Create property user.name STRING

Create class BelongsTo extends E ; create property BelongsTo.out LINK Subject ; create property BelongsTo.in LINKSET Group ; alter property BelongsTo.out MANDATORY=true ; alter property BelongsTo.in MANDATORY=true ; create index UniqueBelongsTo on BelongsTo(out,in) unique" `

lvca commented 10 years ago

What release?

machinelearner commented 10 years ago

Sorry forgot to mention.

1.7.6

lvca commented 10 years ago

Reproduced! Working to fix it.

lvca commented 10 years ago

I'm wrong, sorry. I'm not able to reproduce it. Can you write also the steps to create the graph, not only the schema?

machinelearner commented 10 years ago

I've tried to create database and schema in various different ways. using tinkerpop graph graph = new OrientGraph("local:localhost/userNetwork")

console create database 'remote:localhost/userNetwork' root root plocal graph

Both local and remote

I think the cause for this is the use of LINKSET in edge schema. Currently as a workaround i've changed to a less strict schema (LINK) and things dont seem to break

lvca commented 10 years ago

Where did you set LINKSET in schema?

On 16 August 2014 11:46, Pramod N notifications@github.com wrote:

I've tried to create database and schema in various different ways. using tinkerpop graph graph = new OrientGraph("local:localhost/userNetwork")

console create database 'remote:localhost/userNetwork' root root plocal graph

Both local and remote

I think the cause for this is the use of LINKSET in edge schema. Currently as a workaround i've changed to a less strict schema (LINK) and things dont seem to break

— Reply to this email directly or view it on GitHub https://github.com/orientechnologies/orientdb/issues/2682#issuecomment-52388882 .

machinelearner commented 10 years ago

in property of the custom edge create property BelongsTo.in LINKSET Group

lvca commented 10 years ago

OK, so this isn't a bug. EDGE can't be hyperedge.

machinelearner commented 10 years ago

Oohh, damn! so the normalised view(which i called work around) is the actual solution. Cool. Thanks for responding.