SchemaViolationException from Groovy class [titan09 branch]

49 views
Skip to first unread message

Jordi Chacón

unread,
Apr 17, 2015, 11:25:30 AM4/17/15
to aureliu...@googlegroups.com
Hi!

I have written a very small Groovy application that queries a TitanGraph.

I am using the titan09 branch from a couple of days ago (52ce310b24fa0625760d47a92a629cc4bbe86432).

This is an extract of my Groovy class:
TitanGraph tg = TitanFactory.build().set('storage.backend','inmemory').open()
def mgmt = tg.openManagement()
mgmt.makePropertyKey('important').dataType(Boolean.class).cardinality(Cardinality.SINGLE).make()
mgmt.makeVertexLabel('person').make()
mgmt.commit()
Graph g = tg
def person = g.addVertex('person')
person.property('important', true)   // Exception happens here

And this is the exception I get when I run the application:
com.thinkaurelius.titan.core.SchemaViolationException: Value [true] is not an instance of the expected data type for property key [important] and cannot be converted. Expected: boolean, found: class java.lang.Boolean
        at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.verifyAttribute(StandardTitanTx.java:577)
        at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.addPropertyInternal(StandardTitanTx.java:721)
        at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.addProperty(StandardTitanTx.java:706)
        at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.property(AbstractVertex.java:139)

I have also tried to cast the boolean:
person.property(IMPORTANT, (boolean) true)

But the same error happens.

This also happens with the Long data type: I have a property called 'user_id' of type Long which I use in some vertices to store the id of the user vertex. This is the error I get then:
Value [256] is not an instance of the expected data type for property key [user_id] and cannot be converted. Expected: long, found: class java.lang.Long

Is this a bug or am I doing something wrong?

Any help is greatly appreciated.

Thanks!!

Matthias Broecheler

unread,
May 1, 2015, 3:38:54 PM5/1/15
to aureliu...@googlegroups.com
We will release a Titan09M2 pretty soon. Can you check then. The current development branch is not stable enough to assess such issues against.
Thanks,
Matthias

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/c7a3ce1c-57a8-4b98-9c8c-60789ee49117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordi Chacón

unread,
May 5, 2015, 9:47:32 AM5/5/15
to aureliu...@googlegroups.com
Thank you for your reply Matthias!
Will check again when you make that release and let you know if it's fixed.
Reply all
Reply to author
Forward
0 new messages