Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create [relationship] resource #58

Open
erobit opened this issue Jun 20, 2013 · 1 comment
Open

create [relationship] resource #58

erobit opened this issue Jun 20, 2013 · 1 comment

Comments

@erobit
Copy link
Contributor

erobit commented Jun 20, 2013

The ability to relate resources (directionally) using an expressive library (not just parent/child) that can eventually persist to graph databases. A query syntax would also be required to traverse relationships depending on persistence mode.

http://docs.neo4j.org/chunked/milestone/graphdb-neo4j-relationships.html
http://aseemk.com/talks/neo4j-with-nodejs#/

var rel = resource.use('relationship');

// creates bidirectional link ?
rel.create(user, creature, 'friend');

Note: third param could be options to define type of relationship / schema along with directionality and make the relationships introspectable - easily graphed for doc generation and visual navigation uis.

// query
rel.find(user, 'friend');

Ideally more params could be added to support a detailed query syntax - start node, other node, depth, etc... and could utilize query engines for the different persistence adapters.

I don't know exactly how this should work in terms of IOC, if it makes more sense for it to be core resource functionality, or sit on top. It should be easy enough to extend the resource with methods like the persistence resource does (CRUD) to allow for orm style queries of relationships.

user.rel.create()
user.rel.find()

@ahdinosaur
Copy link

i think the best way to integrate graphs into big is through compatibility with http://json-ld.org/spec/latest/json-ld/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants