This document presents several examples of the use of ODRL V2.2, describes good implementation practices and provides sample ODRL policies.
In order to read this document a basic knowledge of either RDF or JSON is supposed.
Within this document, the following namespace prefix bindings are used:
Prefix | Namespace | Description |
---|---|---|
odrl | http://www.w3.org/ns/odrl/2/ | ODRL Vocabulary |
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# | [[rdf11-concepts]] |
rdfs | http://www.w3.org/2000/01/rdf-schema# | [[rdf-schema]] |
owl | http://www.w3.org/2002/07/owl# | [[owl2-overview]] |
xsd | http://www.w3.org/2001/XMLSchema# | [[xmlschema11-2]] |
skos | http://www.w3.org/2004/02/skos/core# | [[skos-reference]] |
dcterms | http://purl.org/dc/terms/ | [[dcterms]] |
vcard | http://www.w3.org/2006/vcard/ns# | [[vcard-rdf]] |
foaf | http://xmlns.com/foaf/0.1/ | [[foaf]] |
schema | http://schema.org/ | schema.org |
cc | https://creativecommons.org/ns# | creativecommons.org |
ex | http://example.com/ns# |
While ODRL can represent elements of a license or regulation for machine consumption, it cannot replace them in court! It is best practice to explicitly point to the license or regulation that a policy models using the dc:terms property provided by the Dublin Core Metadata Initiative.
00 { 01 "@context": "http://www.w3.org/ns/odrl.jsonld", 02 "@type": "Set", 03 "uid": "https://w3c.github.io/odrl/bp/examples/1", 04 "permission": [{ 05 "target": "http://example.com/asset:9898.movie", 06 "action": "use" 07 }] 08 }
http://www.w3.org/ns/odrl.jsonld
(see line 01).odrl:Set
means this is positive assertion. Somebody affirms that Movie 9898 can be used (line 02).https://w3c.github.io/odrl/bp/examples/1
. ODRL policies are best identified with URIs (see line 03).http://example.com/asset:9898.movie
, probably a movie (line 05). Assets are best identified with URIs.odrl:Policy
, which is defined in the ODRL Ontology. No knowledge on the ODRL Ontology is needed if you want to use ODRL.
@prefix odrl: <http://www.w3.org/ns/odrl/2/> <http://example.org/policy/1> a odrl:Policy, odrl:Set ; odrl:permission [ odrl:target <https://w3c.github.io/odrl/bp/examples/1> ; odrl:assignee <http://example.com/party/Alice> ; odrl:action odrl:use ] ;
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/2", "permission": [{ "target": "http://example.com/asset:9898.movie", "assignee": "John", "action": "play" }] }
Photographs are often licensed on a geographic basis: global rights will likely be more expensive than a country-specific permission. Such conditions are frequently modelled in ODRL by Constraints. The way of representing a geographic entity has not been standardized, though.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/3", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "spatial", "operator": "eq", "rightOperand": "https://www.wikidata.org/resource/Q183", "dct:comment": "i.e Germany" }] }] }
Photographs for the news media can sometimes be "embargoed" - only publishable after a certain data. We can achieve this by putting a time-Constraint on the Permission.
The following permission can only be exercised after the turn of the New Year in 2019.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/4", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "dateTime", "operator": "gte", "rightOperand": { "@value": "2019-01-01", "@type": "xsd:date" } }] }] }
We can easily create a permission that only allows the picture to be displayed in Germany after 2018 by adding both Constraints. In this simple scenario, ODRL insists both Constraints are satisfied before the Permission becomes active.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/5", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "dateTime", "operator": "gte", "rightOperand": { "@value": "2019-01-01", "@type": "xsd:date" } }, { "leftOperand": "spatial", "operator": "eq", "rightOperand": "https://www.wikidata.org/resource/Q183", "comment": "i.e Germany" }] }] }
The following Permission allows the distribution of a video but restricts the delivery channel to mobile networks only. This video cannot be distributed from a website under this Permission.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/6", "permission": [{ "target": "http://example.com/asset:9898.movie", "assigner": "http://example.com/org:616", "action": [{ "action": "distribute", "refinement": [{ "leftOperand": "deliveryChannel", "operator": "eq", "rightOperand": "http://example.com/cv/audMedia/MOBILE" }] }] }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/7", "obligation": [{ "target": "http://example.com/asset:9898.movie", "assignee": "John", "action": "play" }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "https://w3c.github.io/odrl/bp/examples/8", "prohibition": [{ "target": "http://example.com/asset:9898.movie", "assignee": "John", "action": "play" }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.org/policy/9", "permission": [{ "target": "http://example.com/asset/1", "assignee": "http://example.com/party/Alice", "action": "use" }], "prohibition": [{ "target": "http://example.com/asset/1", "assignee": "http://example.com/party/Bob", "action": "use" }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.org/policy/10", "action": "use", "target": "http://example.com/asset/1", "permission": [{ "assignee": "http://example.com/party/Alice", }], "prohibition": [{ "assignee": "http://example.com/party/Bob", }] }
display
is redundant because having permitted play
also implies permitting display
.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.org/policy/11", "permission": [{ "assignee": "http://example.com/party/Alice", "action": [ "play","display"], "target": "http://example.com/asset/1" }] }
:implies
), hence if the former is permitted the latter cannot be prohibited.
Although the actions in the ODRL Core Vocabulary do not have these implications, and although the actions in the ODRL Core Vocabulary are hardly dependent from each other, this may be of interest if you some day want to define your own actions.
A party publishes an odrl:Offer
policy for the target data http://example.com/asset:1
and a second party makes an odrl:Request
to that asset. The parties reach an agreement which is recorded using an odrl:Agreement
.
The dcterms:references property should be used to connect the agreement with the offer and the request that originated it.
ex:offer a odrl:Offer ; odrl:uid <http://example.com/offer:1> ; odrl:permission [ odrl:target <http://example.com/asset:1> ; odrl:assigner <http://example.com/party:A> ; odrl:action odrl:use ] . ex:request a odrl:Request ; odrl:uid <http://example.com/request:1> ; odrl:permission [ odrl:target <http://example.com/asset:1> ; odrl:assignee <http://example.com/party:B> ; odrl:action odrl:use ] . ex:agreement a odrl:Agreement ; dcterms:references ex:offer, ex:request ; odrl:uid <http://example.com/agreement:1> ; odrl:permission [ odrl:target <http://example.com/asset:1> ; odrl:assigner <http://example.com/party:A> ; odrl:assignee <http://example.com/party:B> ; odrl:action odrl:use ] .
odrl:Policy
can be inferred, hence its specification is not necessary. As per the ODRL Information Model (2.1.1 Set Class), Set is the default type of policy, hence its specification is not necessary. The policy shown in Example 3 is also equivalent to the policies in Example 1 (odrl prefix declaration has also been removed for clarity).
<http://example.org/policy/13> odrl:permission [ odrl:target <http://example.com/asset:9898.movie> ; odrl:action odrl:use ] ;
01 @prefix dct: <http://purl.org/dc/terms/> 02 <http://example.com/asset:9898.movie> odrl:hasPolicy <http://example.org/policy/14> . 03 <http://example.org/policy/14> odrl:permission [ 04 odrl:target <http://example.com/asset:9898.movie> ; 05 odrl:action odrl:use 06 ] ;
<http://rightsstatements.org/rs/ic-edu> a dcterms:RightsStatement ,odrl:Policy; skos:prefLabel "In Copyright - Educational Use Only"@en ; skos:definition "This digital object is protected by copyright and/or related rights. For educational uses, no additional copyright permission is required from the copyright holder. Please refer to the Data Provider for additional information."@en ; dc:creator: "Digital Public Library of America and Europeana Rights Working Group" ; dcterms:hasVersion "1.0" ; dcterms:modified "2014-12-18" ; dc:identifier "ic-edu" ; skos:relatedMatch premiscopy:cpr ;odrl:permission [ odrl:action odrl:use ; odrl:constraint [ odrl:operator odrl:eq ; odrl:purpose <http://rightsstatements.org/purpose/education> # This would be preferably from an existing namespace, not ours. ]] .
ex:offer_example terms:description "example of an offer"@en; a odrl:Offer, odrl:Asset; odrl:conflict odrl:prohibit; odrl:prohibition ex:demo_prohibition; prov:version "0.1"@en. ex:demo_prohibition terms:description "example of a prohibition that targets a policy"@en; a odrl:Prohibition; odrl:action odrl:use; odrl:assigner ex:assigner; // --- the constraint ellaborates on the conditions for the triggered odrl:constraint ex:some_constraint; // --- here we target the policy odrl:target ex:offer_example.
odrl:payAmout
using an odrl:RightOperandReference
ex:demo_duty a odrl:Duty; terms:description "duty for use of a DPROD asset"@en; odrl:action md:example_action; odrl:assigner ex:assigner; odrl:target ex:data_product. md:example_action a odrl:Action; rdf:value odrl:compensate; odrl:refinement ex:example_constraint. ex:example_constraint a odrl:Constraint; odrl:leftOperand odrl:payAmount; odrl:operator odrl:eq; odrl:rightOperandReference ex:example_roperand. ex:example_roperand a odrl:RightOperand; // --- values point at respective URI's of an asset and a pricing list rdf:value ex:data_product, ex:pricing_list. ex:data_product a dprod:DataProduct, odrl:Asset. // --- the pricing list could be represented in many different ways: // ----- using schema.org combined with DCAT (https://schema.org/UnitPriceSpecification) ex:pricing_list a dcat:Dataset; dcterms:conformsTo schema:priceSpecification. // ----- as a DCAT dataset conforming to GoodRelations (http://purl.org/goodrelations/v1) ex:pricing_list a dcat:Dataset; dcterms:conformsTo gr:UnitPriceSpecification. // ----- as a DCAT dataset conforming to the product ontology (http://www.productontology.org/doc/Price) ex:pricing_list a dcat:Dataset; dcterms:conformsTo pto:Price. // ----- as a FIBO structured collection of prices ex:pricing_list a fibo-fnd-agr-agr:PriceSpecification.
We would like to acknowledge the contributions to this document by the participants of the W3C POE WG and the W3C ODRL Community Group.