-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix: fix RDF triples example from Thing description json-ld 1.1 #1167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's unfortunate but security definition IDs resolve against the URI of the document, not the id
of the TD. It would be more accurate to put <basic_sc>
instead of <urn:dev:ops:32473-WoTLamp-1234/basic_sc>
(which assumes the context overrides the base URI to the TD's id
).
Thanks for spotting the change, though!
@AndreaCimminoArriaga - FYI, since you also use a workaround for this in wot-jtd |
I'm not sure how this is going to be solved, just to add some personal experience to the conversation. When a TD is translated into triples the It would be really great if this issue could be fixed directly in the context providing an absolute URI. If the absolute URI of the basic_sc should be resolved using the id of the Thing, e.g., urn:dev:ops:32473-WoTLamp-1234/basic_sc, this is fine too. If I recall correctly however, in the spec, the way of resolving it is not clear. |
How so? If the TD originates from a programmatic call to a Sail, it's not surprising the library throws an error because the source document is not known. Without source, relative URIs cannot be resolved. It's always possible to pass a base URI as a configuration argument, as far as i know, though. Libraries that wouldn't fail when parsing relative URIs without base (Jena, for instance) just have a default base URI in their code base. This is not necessarily a good thing, since it injects erroneous information into an RDF dataset. In any case, in your code (for a TDir or a TD processing library), you can pass the Thing's |
I discovered this issue recently. As you mentioned Jena does not have this problem since it has a default base URI. For Sail I have to specifically add the base, since I'm injecting data using SPARQL I rely on the BASE statement and that does the work. Anyway, now that I know that the base for the security should be the id, I think I will modify the code of the JTD so it automatically handles this issue. |
As far as I'm concerned, I wouldn't make it a requirement that the base be the Thing's Yet, the Thing's {
"@context": [
"https://www.w3.org/2019/wot/td/v1",
{ "@base": "urn:dev:ops:32473-WoTLamp-1234" }
],
"id": "urn:dev:ops:32473-WoTLamp-1234",
"title": "MyLampThing",
"securityDefinitions": {
"basic_sc": {"scheme": "basic", "in":"header"}
},
"security": ["basic_sc"],
...
} |
Thanks for the suggestion, we amended the commit to implement the |
from today's TD call:
|
the PR is almost ready for merging. It depends on another recently created PR, though (#1289) because that PR slightly changes security definition triples. |
@vcharpenay many thanks. If I understand correctly, when #1289 is merged we can merge this one, right? |
from today's TD call:
|
Hello,
We have noticed that the triples about the security definition were not present in the RDF example (https://www.w3.org/2019/wot/td#thing-description-json-ld-1-1-instance-to-rdf-dataset).
Using the https://www.w3.org/2019/wot/td/v1 context in the JSON-LD playground, we did not get exactly the same triples as our correction but the following:
We figured there may be an issue with the context and we will try to propose a PR to fix it.