Absent UID attribute for permission/prohibition in XML
Hello,
I was wondering why the <o:permission> and <o:prohibition> do not allow a uid attribute? This prevents you from round-tripping between RDF (where they may have a URI) and XML, because it will either dismiss or recreate a URI or blank node. Or is there some other way to do this? id and idref are allowed, but do not allow URIs. The spec mentions that the Rule class MAY have uid: https://www.w3.org/TR/odrl-model/#rule
We tend to maintain pre-made definitions of rules in our knowledge graph and refer to them from elsewhere like XML.
Cheers,
Miel
Hi Meil, because a Permission "is a" Rule, then it can have the uid property.
As you can see in Example 2 here: https://www.w3.org/TR/odrl-vocab/#xml you then need to locally manage the id/idrefs in XML
Hi @riannella , not sure I understand your answer. The XML section only mentions the following elements about the Permission and Prohibition class; there's nothing about attributes.
The Permission element contains the following elements:
asset (REQUIRED)
action (REQUIRED)
constraint
party
duty
The Prohibition element contains the following elements:
asset (REQUIRED)
action (REQUIRED)
constraint
party
remedy
The XSD also does not allow any attributes except id and idref, despite them not being mentioned in the spec.
The absence of uid is inconsistent with both the Rule concept and RDF/JSON-LD, where you are allowed to add uid.
From the spec:
- A Rule MAY have none or one uid property values (of type IRI [rfc3987]) to identify the Rule so it MAY be referenced by other Rules.
I didn't find any examples in the documents, but this would be allowed in JSON-LD:
{
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "Offer",
"uid": "http://example.com/policy:9090",
"profile": "http://example.com/odrl:profile:07",
"permission": [{
"uid": "http://example.com/rule:0001";
"target": "http://example.com/game:9090",
"assigner": "http://example.com/org:xyz",
"action": "play",
"constraint": [{
"leftOperand": "dateTime",
"operator": "lteq",
"rightOperand": { "@value": "2017-12-31", "@type": "xsd:date" }
}]
}]
}
The model says it allowed, but the XML Schema has omitted it.
I think we need to add:
<xs:attribute name="uid" type="xs:anyURI "/>
to
<xs:attributeGroup name="idAttributes">
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute name="idref" type="xs:IDREF"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:attributeGroup>
Would that do it?
yes that would do it!
Moving to Errata to fix XML Schema