-
Notifications
You must be signed in to change notification settings - Fork 11
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
support for nested resources #15
Comments
Do you mean implementing relational resources? Here is the API from last time I did this: https://github.com/flatiron/resourceful/wiki/Relational-Resources |
yes. |
JSON-Schema has support in the spec for defining relationships between resources. see: http://json-schema.org/links There seems to be a few ways to achieve this. Googling: "defining relationships between JSON-Schemas" yields some good results. Regardless of whatever |
I would love to see graph supported relationships, so we can eventually persist these to a graph db as well! |
related issue: 1602/jugglingdb#251
possible implementation, to provide support for these relations while keeping the relationships defined within the schemas, based on http://json-ld.org/spec/latest/json-ld/#embedding. after thinking about it, i no longer think this will work but i'm keeping it anyways. i think we should just use what jugglingdb has. what i propose fails because it doesn't take into account the doubly-linkedness of relationships. i'll think about it more and maybe it can be fixed. let's say we have a resource
now for a creature to
now if we .get a creature instance as let's assume the same tool resource. now for a creature to ``hasMany` tools
now if we .get a creature instance as TODO: belongsTo, hasAndBelongsToMany my thoughts would be to define as properties in the reverse object, maybe we can do something like http://json-ld.org/spec/latest/json-ld/#reverse-properties. however one important piece of functionality from belongsTo is that |
a resource should be able to contain a resource instance within any of its properties. this is currently possible with using ids as a placeholder for child instances, but then it takes multiple requests to create or get the entire root instance.
The text was updated successfully, but these errors were encountered: