learningtapestry / metadataregistry

DEPRECATED - THIS CODE BASE IS NO LONGER MAINTAINED. Metadata Registry
Apache License 2.0
7 stars 4 forks source link

Resource json-schema versioning #67

Open andersoncardoso opened 7 years ago

andersoncardoso commented 7 years ago

We need to versionate json-schemas, so we can handle updates without breaking existing data. Some of the points to be taken in account:

ver 1.0.0
{
    "ctid": "xyz",
    "descr": "abc"
}

ver 1.1.0
{
    "ctid": "xyz",
    "descrElements": {
        "descr": "abc",
        "shortDescr": "a"
    }   
}

Locator "dispatch" for query:
  v 1.0.0: "descr" => /descr
  v 1.1.0: "descr" => /descrElements/descr

So if someone searches for descr, there could be sql like:

where 
-- descr seach "dispatch"
(
    (schema_version = "1.0.0" and "/descr" = "abc")
    OR
    (schema_version = "1.1.0" and "/descrElements/descr" = "abc)
)

So for any searchable field, each schema version must maintain a "dispatch" locator for each searchable field. In this way, each schema is "responsible" for it's own query elements, and future schema don't need to know anything about that responsibility..