Adding this property for key and value violates a uniqueness constraint

1,883 views
Skip to first unread message

sanjay ahuja

unread,
Mar 20, 2015, 3:16:20 PM3/20/15
to aureliu...@googlegroups.com
Hi,

I am newbie to Titan and facing issue while trying out "Getting started" page of Titan documentation.

When I unzip the titan zip and follow the commands on the getting started page (http://s3.thinkaurelius.com/docs/titan/0.5.4/getting-started.html), I don't see any error. But when I close the gremlin shell and start again, I see following error 

Adding this property for key [system%&%SchemaName] and value [rt%name] violates a uniqueness constraint [SystemIndex#system%&%SchemaName]

I just used following commands:

g = TitanFactory.open('conf/titan-berkeleydb-es.properties')
GraphOfTheGodsFactory.load(g)

I have not done anything extra, not sure why I am seeing this error? Would appreciate any help on this.

Regards,
Sanjay Ahuja

manish kumar

unread,
Mar 22, 2015, 2:00:37 PM3/22/15
to aureliu...@googlegroups.com
This exception is thrown only when you already have added property key to index. So "name" is already added and next time when you run your program somewhere it is again adding "name" property key. So check if that particular code is running twice

Jian Fang

unread,
Jun 3, 2015, 7:40:49 AM6/3/15
to aureliu...@googlegroups.com
Hi,

I face the same problem. Does the exception affect anything?  Can I keep doing queries if I have already run load(g) twice? I got a warning after that.
 
gremlin> hercules = g.V().has("name","hercules").next()
WARN  com
.thinkaurelius.titan.graphdb.transaction.StandardTitanTx  - Query requires iterating over all vertices [(name = hercules)]. For better performance, use indexes
java
.util.NoSuchElementException
Does this means I need to index the graph?


在 2015年3月22日星期日 UTC+1下午7:00:37,manish kumar写道:

Jason Plurad

unread,
Jun 3, 2015, 10:17:52 AM6/3/15
to aureliu...@googlegroups.com
Hi Jian,

You're getting a java.util.NoSuchElementException because your gremlin query has an unchecked call to .next(). Seems like 1. the nameIndex was not created, and 2. the hercules node is not there.

You shouldn't call on GraphOfTheGodsFactory.load() twice. It doesn't do any checking right now for existing property keys, indexes, or vertices. I would load GraphOfTheGods into an empty graph.


-- Jason

Jian Fang

unread,
Jun 3, 2015, 1:17:43 PM6/3/15
to aureliu...@googlegroups.com
Hi Jason,

It was the second one the hercules node is not there. I checked all the nodes, and there is only one node. It's not the original graph of the gods. Maybe something is wrong when I used load(g) twice. However I can not reproduce the problem.

在 2015年6月3日星期三 UTC+2下午4:17:52,Jason Plurad写道:
Reply all
Reply to author
Forward
0 new messages