Examples of use (aug. 2013)

From ODRL Initiative

Note: the examples developed here will be published in the ontology document.

Examples from the specification

This section describes some useful examples, including those in Section 3 in the ODRL2 model, which shows a number of policy expression scenarios. In the following, the prefix ex corresponds to http://example.com/. Some individuals in the specification examples have been slightly renamed to gain readability.

Simple example #1

Attribute an existing license to an asset.

:myAsset dcterms:license <http://creativecommons.org/licenses/by/3.0/us/>;   

You don't need ODRL! Use Dublin Core (or Creative Commons ccREL) instead.

Simple example #2

Give permission to perform an action.

:myAsset
	dct:rights [
		a odrl:Set ;
		odrl:permission odrl:reproduce ;
	] .

You declare the rights (with Dublin Core rights) on your resource (:myAsset), expressing that you set the permission to reproduce.

Example for 3.1 Set

We declara as instances the Asset, the Policy, the Permission and the Prohibition. The policy is related to the permission and the prohibition, which are connected to the corresponding asset and action.

ex:asset0998 rdf:type odrl:Asset ,
                      owl:NamedIndividual .
ex:policy0099 rdf:type odrl:Set ,
                       owl:NamedIndividual ;
                                 odrl:permission _:permission1> ;
                                 odrl:prohibition _:prohibition:1> .
_:permission1 rdf:type odrl:Permission ,
                       owl:NamedIndividual ;
              odrl:target ex:asset0998 ;
              odrl:action odrl:reproduce .
_:prohibition1 rdf:type odrl:Prohibition ,
                        owl:NamedIndividual ;
               odrl:target ex:asset0998 ;
               odrl:action odrl:modify .

Example as TTL Example as RDF/XML


Alternative codification example. The use of dct:rights is accepted.

<http://example.com/asset:9899>
	dct:rights [
		a odrl:Policy ;
		odrl:permission odrl:reproduce ;
		odrl:prohibition odrl:modify
	] .

Example for 3.2 Offer

This example is more complex and requires up to 8 individuals to be declared. Example as TTL Example as RDF/XML

_:assetAUD050 rdf:type odrl:Asset ,
                           owl:NamedIndividual .
_:constraint1 rdf:type odrl:Constraint ,
                           owl:NamedIndividual ;
                  odrl:count "1" ;
                  odrl:operator odrl:lteq .
_:duty1 rdf:type odrl:Duty ,
                     owl:NamedIndividual ;
            odrl:target _:assetAUD050 ;
            odrl:action odrl:pay .
_:permission1 rdf:type odrl:Permission ,
                           owl:NamedIndividual ;
                  odrl:duty _:duty1 ;
                  odrl:target :asset4545 ;
                  odrl:assigner :sony10 ;
                  odrl:action odrl:play .
_:permission2 rdf:type odrl:Permission ,
                           owl:NamedIndividual ;
                  odrl:constraint _:constraint1 ;
                  odrl:duty _:duty1 ;
                  odrl:target :asset4545 ;
                  odrl:assigner :sony10 ;
                  odrl:action odrl:copy .
:asset4545 rdf:type odrl:Asset ,
                    owl:NamedIndividual .
:policy231 rdf:type odrl:Offer ,
                    owl:NamedIndividual .
:sony10 rdf:type odrl:Party ,
                 owl:NamedIndividual .

Counterexamples (bad practices)

1. Dont relate the policy directly to the asset, as in this counterexample:

ex:policy0099 rdf:type odrl:Set ,
              odrl:target ex:asset0998 ;