-
Notifications
You must be signed in to change notification settings - Fork 17
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
Need information model for directory #98
Comments
To be clearer, I'm thinking each TD record would "internally" look like this: <td_record> :=
{
// metadata
"ttl": <ttl>,
"location": <location>,
"lastUpdated": <timestamp>,
...
// tds (not modified by directory)
"td": <parsed TD JSON>,
"original": <raw string, for signing preservation purposes>
} and the directory would basically stored as a JSON-LD object containing a set of these: <directory> := {
"@context": <directory ontology>,
<local_id>: <td_record>, ...
} See however discussion in #18, which already discussed something similar to this (and the issues with it...). In particular we might want to link to tds rather than embedding them, and need to look into JSON-LD friendliness. @farshidtz will look at the above issue and try to extract the various options and their pros and cons. |
I provided a summary of all proposals in my presentation (slides 9-11) back in June 2020 F2F. But an up-to-date summary would be more useful. For the API spec, it is important to know how the directory exposes the resources, and that is what I will cover below. I will create separate posts for the three proposals to allow 👍 👎 votes. Exposing the collection of resources and pagination is another issue: #16 I will only include |
1. Wrapped TDGET /td-wrapper/urn:example:1234 {
"@context":"https://www.w3.org/2019/wot/tdd/v1",
"id":"urn:example:1234", // this may or may not be equal to td.id
"created": "2020-06-10T09:00:00Z",
"modified":"2020-06-12T10:00:01Z",
"td": {
"@context":"https://www.w3.org/2019/wot/td/v1",
"id":"urn:example:1234",
"title":"ExampleSensor",
"created":"2020-05-01T08:00:00Z",
"modified":"2020-06-12T10:00:00Z",
...
}
}
|
2. Enriched TDGET /td/urn:example:1234?registration_info=true {
"@context":[
"https://www.w3.org/2019/wot/td/v1",
{"tdd": "https://www.w3.org/2019/wot/tdd/v1"},
],
"id":"urn:example:1234",
"title":"ExampleSensor",
"created":"2020-05-01T08:00:00Z",
"modified":"2020-06-12T10:00:00Z",
...
"tdd:info":{ // present because of the query parameter (registration_info=true)
"id":"urn:example:1234", // this may or may not be equal to td.id
"created": "2020-06-10T09:00:00Z",
"modified":"2020-06-12T10:00:01Z"
}
}
|
3. Decoupled ResourcesGET /td/urn:example:1234 {
"@context":"https://www.w3.org/2019/wot/td/v1",
"id":"urn:example:1234",
"title":"ExampleSensor",
"created":"2020-05-01T08:00:00Z",
"modified":"2020-06-12T10:00:00Z",
...
}
GET /td-info/urn:example:1234 {
"@context":"https://www.w3.org/2019/wot/tdd/v1",
"id":"urn:example:1234", // this may or may not be equal to td.id
"created": "2020-06-10T09:00:00Z",
"modified":"2020-06-12T10:00:01Z",
"link":"/td/urn:example:1234” // relative link to TD
}
|
I think having an information model to express data regarding directories is a good idea. If the model is expressed as an ontology, SPARQL queries could refer to those terms. Additionally, those terms could be also useful for the federation, e.g., if we know that a known TDD has a 'response ratio' very low we could avoid including such TDD in the federation. The best way to proceed in case of expressing these data as an ontology, would be to develop a TDD ontology that imports the TD one and extends it. |
MAYBE we can use TD Links for metadata... to discuss. |
So I'm personally leaning towards option 2 at this point (because it satisfies both "being RESTful" and "supports SPARQL queries on the metadata") but think we should give it another week to collect votes. Let's plan to make a decision in the Jan 11 meeting. |
During the call on 11 Jan 2021, we agreed option 2 would be the best, and would like to think about detailed data flow based on some concrete use case(s). Note that this issue is related to issue #54 on possible additional vocabulary. |
Changed title to "refine" since now we have one, but it may need some improvements. |
I did a proposal for the pagination in issue #54, this solution can resolve the problem of nested contexts, and also, the possible namespace collision that may occur using TDs extended with other ontologies. |
From the Discovery call:
|
We need an overall information model for all the data in a directory. Does it include information besides TDs? Eg out-of-band information (TTL, update timestamps, location...), links (eg to other directories), Thing Models, etc.
Can SPARQL queries be over the entire model?
Related issues:
The text was updated successfully, but these errors were encountered: