So there are two problems with that.

Probably we have to add this unique property behavior to the auto-indexing 
framework.

Right now we have no means to mark properties as unique.

So whenever you take a different node and set one of its "unique" properties to 
a value already contained in an unique index it should fail on commit, this is 
the point where the auto-indexing would come into play.

There should probably also be a different index type (besides the "exact" and 
"fulltext" types that handles unique values and for instance fails at duplicate 
key insertion.

We would have to provide the low-level methods for the obtain* operations which 
you could use in the embedded graphdb mode. All other operations should be 
protected either by auto-indexing storing the values in the unique index.

Just my thoughts on this matter

Cheers

Michael
Am 06.08.2011 um 20:30 schrieb espeed:

> 
> Michael Hunger wrote:
>> 
>> What one could do at a lower level is to create operations like
>> db.obtainUniqueNode(Map properties,String...idProperties);
>> node.obtainUniqueRelationship(dir, type, props, String...idProperties);
>> node.obtainUniqueRelationship(dir, type, targetNode, props,
>> String...idProperties);
>> 
>> which handle the lock, index lookup and property-update in one go.
>> 
>> That operation can be exposed on the REST layer.
>> 
> 
> Hi Michael -
> 
> Yes, ultimately you would have a "create or update" REST endpoint that would
> do something like that. 
> 
> BTW I re-read my previous post and realized I may have jumped from
> discussing the unique index to the "create or update" endpoint in a
> confusing way so let me clarify:
> 
> On Rexster and/or Neo4j Server, there would be a "create or update" endpoint
> that does a silent update if the node already exists. The question then
> would be is how do you enforce the unique property on operations that don't
> use the endpoint and  how do you (potentially) allow for versioning of the
> node.
> 
> - James
> 
> 
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Are-Unique-Indices-in-the-Works-tp3229971p3231501.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to