Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Model relationships #32

Closed
leplatrem opened this issue Dec 5, 2012 · 3 comments
Closed

Model relationships #32

leplatrem opened this issue Dec 5, 2012 · 3 comments
Labels

Comments

@leplatrem
Copy link
Contributor

We could envision a way to refer a model as a relationship :

Definition could look like:

{
"title": "Person",
"description": "An individual with a soul",
"fields": [
    {
        "name": "fullname",
        "type": "string",
    }, {
        "name": "brothers",
        "type": "many-to-many",
        "model": "Person"
    }

And an entry like :

{
    "name":  "Howard",
    "brothers": [54321, 9876]
}

Validating this entry would mean checking that provided brother ids exist.

@almet
Copy link
Member

almet commented Dec 14, 2012

make sense to me yep, +1.

I'm wondering how we will export these then? Should we include the linked resources?

some comments about that, though:

  1. should we include the complete uri of the resource instead of directly its id?
  2. Do we want to have a many-to-many, one-to-many etc? or is a simple "foreign key" enough?

This was referenced May 30, 2013
@leplatrem
Copy link
Contributor Author

  1. JSON schema seems to address this need with URI
     "storage": {
            "type": "object",
            "oneOf": [
                { "$ref": "#/definitions/diskDevice" },
                { "$ref": "#/definitions/diskUUID" },
            ]
        },
  1. We would just need anyOf (1-N, N-N) and oneOf (1-1, N-1).
    But we first must clarify the distinction between linking data (records URIs) and linking model definitions (validating duplicated data against shared schemas).

In the end forseen applications are fun ! daybed could be a data pad, where some common models are shared (cities, vegetables, units, currencies...) and linked together (ontologies). Dataset loaded from dbpedia :)

@leplatrem
Copy link
Contributor Author

Merged.

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

No branches or pull requests

2 participants