This document presents several examples of use of ODRL, describes good 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": "http://example.com/policy:1010", 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).http://example.com/policy:1010
. 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.{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.com/policy:1010", "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.
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.com/policy:1010", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "spatial", "operator": "eq", "rightOperand": "https://www.wikidata.org/wiki/Q183", "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": "http://example.com/policy:1010", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "dateTime", "operator": "gt", "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": "http://example.com/policy:1010", "permission": [{ "target": "http://example.com/asset:9898.movie", "action": "display", "constraint": [{ "leftOperand": "dateTime", "operator": "gt", "rightOperand": { "@value": "2019-01-01", "@type": "xsd:date" } }, { "leftOperand": "spatial", "operator": "eq", "rightOperand": "https://www.wikidata.org/wiki/Q183", "comment": "i.e Germany" }] }] }
Constraints can also be used to 'inject' additional semantics into the definition of an Action, Asset, or Party
The following Permission allows the distribution of a video but resticts 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": "http://example.com/policy:6161", "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" }] }] }] }
In financial markets the value of a piece of data is sometimes proportional to its timeliness. 15-minute delayed stock price is often much cheaper than real-time. We'd probably want different permissions to reflect this. How would we specify the 15 minute delay?
We could model them as two different Assets. Or we could use Constraints on the same Asset, the stock price:
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.com/policy:1010", "obligation": [{ "target": "http://example.com/asset:9898.movie", "assignee": "John", "action": "play" }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.com/policy:1010", "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/5", "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/5", "action": "use", "target": "http://example.com/asset/1", "permission": [{ "assignee": "http://example.com/party/Alice", }], "prohibition": [{ "assignee": "http://example.com/party/Bob", }] }
{ "@context": "http://www.w3.org/ns/odrl.jsonld", "@type": "Set", "uid": "http://example.com/policy:1010", "prohibition": [{ "target": "http://example.com/asset:9898.movie", "assignee": "John", "action": "play" }] }
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/5", "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.
odrl:Policy
, which is defined in the ODRL Ontology. No knowledge on the ODRL Ontology is needed if you want to use ODRL.
Example 1 and Example 2 have the same meaning.
@prefix odrl: <http://www.w3.org/ns/odrl/2/> <http://example.org/policy/1> a odrl:Policy, odrl:Set ; odrl:permission [ odrl:target <http://example.com/asset/1> ; odrl:assignee <http://example.com/party/Alice> ; 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 and Example 2 (odrl prefix declaration has also been removed for clarity).
<http://example.com/policy:1010> 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.com/policy:1010> . 03 <http://example.com/policy:1010> odrl:permission [ 04 odrl:target <http://example.com/asset:9898.movie> ; 05 odrl:action odrl:use 06 ] ;
<http://example.org/policy/5> odrl:permission [ odrl:target <http://example.com/asset/1> ; odrl:assignee <http://example.com/party/Alice> ; odrl:action odrl:use ]; odrl:prohibition [ odrl:target <http://example.com/asset/1> ; odrl:assignee <http://example.com/party/Bob> ; odrl:action odrl:use ].
<http://example.org/policy/5> odrl:target <http://example.com/asset/1> ; odrl:action odrl:use ; odrl:permission [ odrl:assignee <http://example.com/party/Alice> ; ]; odrl:prohibition [ odrl:assignee <http://example.com/party/Bob> ; ].
The policies in this file has been used to evaluate some test cases.
ODRL policies can represent the key content in instance licenses. As an example, the representation of the W3C Software and Document Notice and License follows. Please do note that the W3C Consortium does not endorse nor recommend this representation, which is only an effort of the editors of this document to illustrate how ODRL policies could represent textual licenses.
@prefix cc: <http://creativecommons.org/ns#> . @prefix dct: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix odrl: <http://www.w3.org/ns/odrl/2/> . <http://purl.org/NET/rdflicense/W3C1.0> a odrl:Policy ; rdfs:label "W3C Software Notice and License" ; dct:source <https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document> ; dct:hasVersion "1.0" ; dct:language <http://www.lexvo.org/page/iso639-3/eng> ; dct:publisher "W3C" ; odrl:permission [ odrl:action odrl:distribute , odrl:modify , odrl:reproduce odrl:duty [ odrl:action cc:Notice , cc:ShareAlike ] ; ] ; cc:legalcode """ License By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." Disclaimers THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders. Notes This version: http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document Previous version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 This version makes clear that the license is applicable to both software and text, by changing the name and substituting "work" for instances of "software and its documentation." It moves "notice of changes or modifications to the files" to the copyright notice, to make clear that the license is compatible with other liberal licenses. """@en .
We would like to acknowledge the contributions to this document by the participants of the W3C POE WG and the W3C ODRL Community Group.