Hi Peter, I will start writing test-code first. Some nice creation code will definitely be part of that, which I will post on the graph-collections Wiki, together with the resulting data (reminder to self: install neoclipse to make neat images of the graph). The Enhanced stuff still needs thorough testing. My Scala app only uses the non-enhanced features, so it was basically a test proving the wrappers all work properly. In two or three days, I am confident the software is ready for others to try out. Niels
> From: [email protected] > Date: Tue, 26 Jul 2011 14:48:36 -0700 > To: [email protected] > Subject: Re: [Neo4j] Enhanced API and HyperRelationships > > That is cool Niels, > I am looking forward to you testing it out, maybe some else people? > Also, I would love to see how to query such a structure at the API > level. Could you post some nice creation code and the resulting graph > so we can see how it looks? > > Cheers, > > /peter neubauer > > GTalk: neubauer.peter > Skype peter.neubauer > Phone +46 704 106975 > LinkedIn http://www.linkedin.com/in/neubauer > Twitter http://twitter.com/peterneubauer > > http://www.neo4j.org - Your high performance graph database. > http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. > > > > On Tue, Jul 26, 2011 at 2:44 PM, Niels Hoogeveen > <[email protected]> wrote: > > > > I just ported my own application 12kloc of Scala code to use the Enhance > > API and got it working. Of course more thorough testing needs to be done, > > but it proves that at least in the case of my own application the Enhanced > > API can work as a drop-in replacement. > > Niels > > > >> From: [email protected] > >> To: [email protected] > >> Date: Tue, 26 Jul 2011 22:13:59 +0200 > >> Subject: Re: [Neo4j] Enhanced API and HyperRelationships > >> > >> > >> A first stab at implementing the Enhanced API and HyperRelationships is > >> finished. It still needs thorough testing, so this is PRE-ALPHA quality.It > >> also still lacks proper documentation (java docs).The source code can be > >> found > >> at:https://github.com/peterneubauer/graph-collections/tree/master/src/main/java/org/neo4j/collections/graphdbA > >> description can be found > >> at:https://github.com/peterneubauer/graph-collections/wiki/Enhanced-APINiels > >> > From: [email protected] > >> > To: [email protected] > >> > Date: Tue, 26 Jul 2011 01:02:20 +0200 > >> > Subject: Re: [Neo4j] Enhanced API and HyperRelationships > >> > > >> > > >> > The implementation of HyperRelationships needs another day of work, > >> > though the hard parts are finished now. > >> > > >> > Time to explain the inner workings of HyperRelationships. > >> > > >> > HyperRelationships are a generalization of the binary relationships > >> > found in Neo4j. > >> > > >> > Instead of creating a relationship from a node to another node, > >> > we define a HyperRelationship as a set of Nodes each having a > >> > RelationshipRole within the HyperRelationship. > >> > > >> > For the binary case the RelationshipRoles are StartNode and EndNode. > >> > For HyperRelationships with an arity higher than 2, the Roles need to be > >> > defined for each HyperRelationshipType. > >> > > >> > A HyperRelationship is layed-out in the database as a regular > >> > relationship in the binary case. > >> > > >> > For HyperRelationship with an arity higher than 2, a Node is created > >> > subsuming the role of Relationship. > >> > From this Node, binary relationships (regular Neo4J relationships) are > >> > created for each Element of the relationship. > >> > > >> > The RelationshipTypes of these binary relationships are a concatenation > >> > of the name of the HyperRelationshipType used > >> > and the RelationshipRole of the attached Element. > >> > > >> > Example: > >> > > >> > Suppose we want to store the fact that Flo and Eddie give Tom, Dick and > >> > Harry a Book. > >> > > >> > This is a ternary relationship, with the following RelationshipRoles: > >> > > >> > Giver: Flo and Eddie > >> > Recipient: Tom, Dick and Harry > >> > Gift: Book > >> > > >> > The GIVE relationship is first created with a Set of Roles (Giver, > >> > Recipient and Gift). > >> > When the example relation is created the following binary relationships > >> > will be create: > >> > > >> > HyperRelationshipNode --GIVE/#/Giver--> Flo > >> > HyperRelationshipNode --GIVE/#/Giver--> Eddie > >> > HyperRelationshipNode --GIVE/#/Recipient--> Tom > >> > HyperRelationshipNode --GIVE/#/Recipient--> Dick > >> > HyperRelationshipNode --GIVE/#/Recipient--> Harry > >> > HyperRelationshipNode --GIVE/#/Gift--> Book > >> > > >> > We can now retrieve all Relationships where Flo is the Giver in a GIVE > >> > relationship, > >> > simply by concatenating GiVE and Giver into GIVE/#/Giver, > >> > and then ask all incoming Relationships with that RelationshipType. > >> > > >> > This fetches the HyperRelationship nodes and the other attached Elements > >> > of the HyperRelationship can be loaded. > >> > > >> > I added an extra interface FunctionalRelationshipRole, which restricts > >> > the number of Elements attached to a RelationshipRole within a > >> > HyperRelationship to one. > >> > > >> > The use of this amounts to something similar to having a > >> > getSingleRelationship method, > >> > which cannot throw an Exception, because multiple entries with the same > >> > RelationshipType cannot be created by design. > >> > > >> > Niels > >> > > From: [email protected] > >> > > To: [email protected] > >> > > Date: Mon, 25 Jul 2011 02:03:54 +0200 > >> > > Subject: [Neo4j] Enhanced API and HyperRelationships > >> > > > >> > > > >> > > Today I wrote a piece about the Enhanced API and about > >> > > HyperRelationships, I have been working on over the last couple of > >> > > days. > >> > > > >> > > See: > >> > > https://github.com/peterneubauer/graph-collections/wiki/Enhanced-API > >> > > > >> > > The API as presented in the graph-collections repo on Git is not > >> > > feature complete yet with respect to HyperRelationships. > >> > > The interfaces are there, but the implementation only works for binary > >> > > relationships at present. Need one more day for the implementation. > >> > > > >> > > I posted the Wiki page and the source code to open the discussion > >> > > about these new features. > >> > > > >> > > Niels > >> > > _______________________________________________ > >> > > Neo4j mailing list > >> > > [email protected] > >> > > https://lists.neo4j.org/mailman/listinfo/user > >> > > >> > _______________________________________________ > >> > Neo4j mailing list > >> > [email protected] > >> > https://lists.neo4j.org/mailman/listinfo/user > >> > >> _______________________________________________ > >> Neo4j mailing list > >> [email protected] > >> https://lists.neo4j.org/mailman/listinfo/user > > > > _______________________________________________ > > Neo4j mailing list > > [email protected] > > https://lists.neo4j.org/mailman/listinfo/user > > > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

