Open matthieubosquet opened 1 year ago
Thanks for the observation Matthieu. Perhaps I have missed your point, because I do not see the context file should behave otherwise.
In the one hand, not having coupled uid
and @id
may have as a consequence integrity problems -two identifiers.
In the other hand, the context file implements the spec:
"A Policy MUST have one uid property value (of type IRI [rfc3987]) to identify the Policy."
What would be the point of having two different identifiers? Thanks again for your comment
The ODRL vocabulary defines the odrl:uid
property as a way to link instances of Asset, Constraint, LogicalConstraint, Party, Policy and Rule to a unique identifier.
When using that property, I can write an RDF graph of the form:
prefix odrl: <http://www.w3.org/ns/odrl/2/>
prefix ex: <http://example.org/>
[] odrl:uid ex:p1 .
Or even make the odrl:uid
property self-referencing:
prefix odrl: <http://www.w3.org/ns/odrl/2/>
prefix ex: <http://example.org/>
ex:p1 odrl:uid ex:p1 .
Stating that something has a unique identifier is different from collapsing uid
as the node identifier.
Going back to the example in my description of the issue, let's consider the following RDF graphs:
[] a odrl:Policy ; odrl:uid ex:p1 .
is made up of two statement: []
is an odrl:Policy
and []
has a unique identifier ex:p1
.ex:p1 a odrl:Policy
is made up of one statement: ex:p1
is an odrl:Policy
.The first and second RDF graphs are not equivalent, which matters when implementing an ODRL processor.
Let's consider for example a program performing shape validation of ODRL graphs. Such a program would implement checks for every requirement of the ODRL spec, among which:
A Policy MUST have one uid property value (of type IRI [rfc3987]) to identify the Policy. — https://www.w3.org/TR/odrl-model/#policy
That requirement of the ODRL spec corresponds to verifying that a Policy has exactly one statement of the form s odrl:uid o
(and that the object of that statement is an IRI).
If collapsing uid
as the node identifier, this verification (mandated by the spec) will always fail with error A Policy MUST have exactly one odrl:uid
.
The JSON-LD context "https://www.w3.org/ns/odrl.jsonld" used in all examples (eg. 5) incorrectly maps what one would assume as being the
odrl:uid
property to JSON-LD's @id syntax keyword.Which results in the following:
corresponding rdf as turtle:
expected rdf as turtle:
It would be good if the context was ammended to reflect the ODRL vocabulary. I would be happy to submit a PR.
See also: https://github.com/w3c/odrl/issues/26