Skip to toolbar

Community & Business Groups

ODRL Version 2.1 XML Encoding

Final Specification: 5 March 2015

This Version: http://www.w3.org/community/odrl/xml/2.1/

Latest Version: http://www.w3.org/community/odrl/xml/2/

Editors:
Renato Iannella, Semantic Identity, riATsemanticidentity.com

Status of this document

This specification was published by the W3C ODRL Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.

The W3C ODRL Community Group publishes a Final Specification to indicate that the document is believed to be mature and stable for implementation by the wider community. This Final Specification is now endorsed by the W3C ODRL Community Group as appropriate for widespread deployment and that promotes the Community Groups’s mission.

Discussion and feedback of this document takes place on the W3C ODRL Community Group mailing list (see Contributor Archive). Feedback from the public is encouraged and can be send to public-odrl@w3.org (see Public Archive).


Copyright © 2015 the Contributors to the Final Specification, published by the W3C ODRL Community Group under the W3C Community Final Specification Agreement (FSA). A human-readable summary is available.

Table of contents


1. Overview

The ODRL Version 2.1 language is defined by the ODRL Model [ODRL-MODEL] and ODRL Common Vocabulary [ODRL-VOCAB] in an abstract manner to capture the semantics of the expression, without any specific syntax and/or encoding method.

This document describes how to encode both the Model and Common Vocabulary, including any community developed Profiles, using the XML syntax

[XML]
with XML Schema [XML-SCHEMA] and XML Schema Datatypes [XML-SCHEMA-DT]

This document utlilises the key words “MUST”, “MAY”, “REQUIRED”, and “OPTIONAL” in accordance to [RFC2119]. Lowercase wording is used in this document.

2. Namespace and Identifiers

The XML Namespace [XML-NAME] for the ODRL Version 2 Core Model XML Schema is defined as:

http://www.w3.org/ns/odrl/2/

Examples in this document will use “o” as the prefix for this Namespace. However, any prefix may be utilised as long as it is associated with the correct URI Namespace.

To enable compact URIs, this encoding also supports the use of Qualified Names (QNames) [XML-NAME] for the specification of the value identifiers. In addition, Qualified Codes [Q-CODE] may also be used for vocabulary values. QCodes are similar to QNames but also allow a digit as the first character of the value.

All of the URIs used in ODRL XML instances MUST follow those defined in the ODRL Ontology [ODRL-ONTO]. This includes URIs for policy types, actions, operators, operands, functions, scopes, conflict handling terms, and unsupported action-handling terms.

3. XML Encoding

Each of the core entities (UML Classes) from the ODRL Model will be represented by an XML element of the same name. Additionally, each entity attribute will be represented as an XML attribute of the parent element. The fixed values defined in the Model are represented as enumerated types. Cardinalities are also represented with XML Schema occurrence rules. Attributes are optional unless explicitly noted as required.

The Policy element contains the following attributes:

  • uid – a URI/Qname/Qcode (required)
  • type – a URI/Qname/Qcode (required)
  • conflict – fixed enumeration (defined in XML Schema)
  • undefined – fixed enumeration (defined in XML Schema)
  • inheritAllowed – a boolean
  • inheritFrom – a URI/Qname/Qcode
  • inheritRelation – a URI/Qname/Qcode
  • profile – a URI/Qname/Qcode

The Policy element may contain the following elements:

  • permission, and/or
  • prohibition

Note that under the ODRL context rules (see ODRL Model [ODRL-MODEL]) there MUST be at least one Permission in the complete ODRL Policy taking into account any Profile and Inheritance requirements.

The Asset and Relation association class are merged into a single Asset element to represent both the Asset and how it is related to the Permission/Prohibition/Duty. The Asset element contains the following attributes:

  • uid – a URI/Qname/Qcode
  • relation – a URI/Qname/Qcode
  • id – an local identifier for this element
  • idref – a reference to an Asset element

Asset element attributes MUST be used as defined by one of the sets of attributes and their cardinalities below:

  1. uid (required), relation (required), id (optional), or
  2. idref (required)

The Party and Role association class are merged into a single Party element to represent both the Party and the role to the Permission/Prohibition/Duty. The Party element contains the following attributes:

  • uid – a URI/Qname/Qcode
  • function – a URI/Qname/Qcode
  • scope – a URI/Qname/Qcode
  • id – an local identifier for this element
  • idref – a reference to a Party element

Party element attributes MUST be used as defined by one of the sets of attributes and their cardinalities below:

  1. uid (required), function (required), scope (optional), id (optional), or
  2. idref (required)

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

The Duty element contains the following elements:

  • action – (required)
  • constraint
  • asset
  • party

The Duty element contains the following attributes:

  • uid – a URI/Qname/Qcode
  • id – an local identifier for this element
  • idref – a reference to an Duty element

Duty element attributes MUST be used as defined by one of the sets of attributes and their cardinalities below:

  1. uid (optional), or
  2. id (required), or
  3. idref (required)

The Action element contains the following attribute:

  • name – a URI/Qname/Qcode
  • id – an local identifier for this element
  • idref – a reference to an Action element

Action element attributes MUST be used as defined by one of the sets of attributes and their cardinalities below:

  1. name (required), id (optional), or
  2. idref (required)

The Constraint element contains the following attributes:

  • name – a URI/Qname/Qcode
  • operator – a URI/Qname/Qcode
  • rightOperand – string, space separated list for set values
  • dataType – a URI/Qname/Qcode
  • unit – a URI/Qname/Qcode
  • status – string
  • id – an local identifier for this element
  • idref – a reference to an Constraint element

Constraint element attributes MUST be used as defined by one of the sets of attributes and their cardinalities below:

  1. name (required), operator (required), rightOperand (required), dataType (optional), unit (optional), status (optional), id (optional), or
  2. idref (required)

In some cases where Duties refer to (external) Assets, it will be necessary to package the ODRL XML expression with the representation of that (external) Asset. This XML Encoding specification does not mandate any specific packaging mechanism as communities will utilise their preferred options for data interoperability.

The examples in Section 5 give concrete instances of these XML encoding rules for the Model and Common Vocabulary. Appendix A shows the formal XML Schema that encapsulates these rules.

4. XML Linking

4.1 XML Elements

To support repeating the same element content across Permissions and Prohibitions, the Asset, Party, Constraint, Action, and Duty elements support the id and idref attributes. Any of these element that has been identified using the id attribute can then be referred to by an element with the same name using the idref attribute. In this case, the referring element must have no other content. As shown in the below example, the Prohibition refers to elements defined in the Permission, except for the Constraint element. In this case, the assignee can play the music asset in Italy but not in France.

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:Z1XZ">
  <o:permission>
     <o:asset id="as1" uid="http://example.com/music:1234908" relation="http://www.w3.org/ns/odrl/2/target"/>
     <o:action id="ac1" name="http://www.w3.org/ns/odrl/2/play"/>
     <o:constraint id="c1" name="http://www.w3.org/ns/odrl/2/spatial" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.itu.int/tML/tML-ISO-3166:it"/>
     <o:party id="p1" uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
     <o:party id= "p2" uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
   </o:permission>
   <o:prohibition>
     <o:asset idref="as1"/>
     <o:action idref="ac1"/>
     <o:constraint name="http://www.w3.org/ns/odrl/2/spatial" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.itu.int/tML/tML-ISO-3166:fr"/>
     <o:party idref="p1"/>
     <o:party idref="p2"/>
   </o:prohibition>
</o:Policy>
<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:Z1XZ">
  <o:permission>
     <o:asset id="as1" uid="http://example.com/music:1234908" relation="http://www.w3.org/ns/odrl/2/target"/>
     <o:action id="ac1" name="http://www.w3.org/ns/odrl/2/play"/>
     <o:constraint id="c1" name="http://www.w3.org/ns/odrl/2/spatial" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.itu.int/tML/tML-ISO-3166:it"/>
     <o:party id="p1" uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
     <o:party id= "p2" uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
   </o:permission>
   <o:prohibition>
     <o:asset idref="as1"/>
     <o:action idref="ac1"/>
     <o:constraint name="http://www.w3.org/ns/odrl/2/spatial" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.itu.int/tML/tML-ISO-3166:fr"/>
     <o:party idref="p1"/>
     <o:party idref="p2"/>
   </o:prohibition>
</o:Policy>

Note that there is an important distinction when using this feature with the Duty element which also has the uid attribute. The uid attribute is used to refer to the same Duty from multiple Permissions. In this case the Duty has to be performed only once to gain access to all the Permissions. When using the id and idref attributes then the semantics change as in this case the Duty must be performed for each time it is referenced (potentially, many times). Note that the use of the uid and id attribute for the same Duty element is not permitted.

4.2 Inline Assets

In some scenarios, the Asset of an ODRL Policy maybe also be XML or HTML markup. In these specific cases, it makes sense to enable the ODRL Policy to be articulated as part of the Asset and to support abbreviated expressions. All default values should be assumed. The preferred method of linking is to utilise the XML ID attribute. The source Asset markup may be identified with an ID attribute and the ODRL Asset element can then refer to this ID as the UID (as a URI hash fragment). An example is shown below.

<rnews:Article xml:id="item8HEX">
    <rnews:title>Allies are Split<rnews:title>
    <rnews:description>Rebel fighters take control...<rnews:description>
    ...
    <o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:ABAABA">
      <o:permission>
        <o:asset uid="#item8HEX"/>
        <o:action name="http://w3.org/ns/odrl/vocab#distribute"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/dateTime" operator="http://www.w3.org/ns/odrl/2/gteq" rightOperand="2011-11-11"/>
      </o:permission>
    </o:policy>
    ...
</rnews:Article>

5. Scenario Examples

These examples represent the XML Encodings for all the Scenarios described in the [ODRL-Model] document.

5.1 Set

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:0099">
    <o:permission>
        <o:asset uid="http://example.com/asset:9898" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/reproduce"/>
    </o:permission>
    <o:prohibition>
        <o:asset uid="http://example.com/asset:9898" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/modify"/>
    </o:prohibition>
</o:Policy>

5.2 Offer

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Offer" uid="http://example.com/policy:0231">
    <o:permission>
        <o:asset uid="http://example.com/music:4545" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/play"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="d1">
            <o:action name="http://www.w3.org/ns/odrl/2/compensate"/>
            <o:constraint name="http://www.w3.org/ns/odrl/2/payAmount" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="0.50"
                dataType="http://www.w3.org/2001/XMLSchema:decimal" unit="http://cvx.iptc.org/iso4217a:AUD"/>
        </o:duty>
    </o:permission>
    <o:permission>
        <o:asset uid="http://example.com/music:4545" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/copy"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/count" operator="http://www.w3.org/ns/odrl/2/lteq" rightOperand="1"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="#d1"/>
    </o:permission>
</o:Policy>

5.3 Agreement

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:9001">
    <o:permission>
        <o:asset uid="http://example.com/music:4545" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/play"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
        <o:duty uid="d1">
            <o:action name="http://www.w3.org/ns/odrl/2/compensate"/>
            <o:constraint name="http://www.w3.org/ns/odrl/2/payAmount" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="0.50"
                dataType="http://www.w3.org/2001/XMLSchema:decimal" unit="http://cvx.iptc.org/iso4217a:AUD"/>
        </o:duty>
    </o:permission>
    <o:permission>
        <o:asset uid="http://example.com/music:4545" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/copy"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/count" operator="http://www.w3.org/ns/odrl/2/lteq" rightOperand="1"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
        <o:duty uid="#d1"/>
    </o:permission>
</o:Policy>

5.4 Request

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Request" uid="http://example.com/policy:04311">
    <o:permission>
        <o:asset uid="http://example.com/news:0099" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/display"/>
        <o:party uid="http://example.com/guest:0589" function="http://www.w3.org/ns/odrl/2/assignee"/>
    </o:permission>
</o:Policy>

5.5 Ticket

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Ticket" uid="http://example.com/policy:04311">
    <o:permission>
        <o:asset uid="http://example.com/game:4589" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/play"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/dateTime" operator="http://www.w3.org/ns/odrl/2/lteq" rightOperand="2010-12-31"/>
    </o:permission>
</o:Policy>

5.6 Offer and Next Policy

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Offer" uid="http://example.com/policy:5531">
    <o:permission>
        <o:asset uid="http://example.com/wallpaper:2321" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/distribute"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/spatial" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.itu.int/tML/tML-ISO-3166:it"/>
        <o:party uid="http://example.com/sony:99" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="d1">
            <o:action name="http://www.w3.org/ns/odrl/2/compensate"/>
            <o:constraint name="http://www.w3.org/ns/odrl/2/payAmount" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="1000.00"
                dataType="http://www.w3.org/2001/XMLSchema:decimal" unit="http://cvx.iptc.org/iso4217a:EUR"/>
        </o:duty>
        <o:duty uid="d2">
            <o:action name="http://www.w3.org/ns/odrl/2/nextPolicy"/>
            <o:asset uid="http://example.com/policy:7777" relation="http://www.w3.org/ns/odrl/2/target"/>
        </o:duty>
    </o:permission>
</o:Policy>

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:7777">
    <o:permission>
        <o:asset uid="http://example.com/wallpaper:2321" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/display"/>
    </o:permission>
</o:Policy>

5.7 Privacy

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Privacy" uid="http://example.com/policy:1111">
    <o:permission>
        <o:asset uid="http://example.com/billie:888:personal-data" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/distribute"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/purpose" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.w3.org/2002/01/P3Pv1:contact"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/gov:health:au" function="http://www.w3.org/ns/odrl/2/assignee"/>
        <o:duty>
            <o:action name="http://www.w3.org/ns/odrl/2/delete"/>
            <o:asset uid="http://example.com/billie:888:personal-data" relation="http://www.w3.org/ns/odrl/2/target"/>
            <o:constraint name="http://www.w3.org/ns/odrl/2/dateTime" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="P30D"/>
        </o:duty>
    </o:permission>
</o:Policy>

5.8 Permission and Prohibition

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:3433" conflict="http://www.w3.org/ns/odrl/2/perm">
    <o:permission>
        <o:asset uid="http://example.com/music:1234908" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/play"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
    </o:permission>
    <o:prohibition>
        <o:asset uid="http://example.com/music:1234908" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://oma.org/drm:ringtone"/>
        <o:party uid="http://example.com/sony:10" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
    </o:prohibition>
</o:Policy>

5.9 Inheritance

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:5531" inheritAllowed="true">
    <o:permission>
        <o:asset uid="http://example.com/report:2321" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/print"/>
        <o:party uid="http://example.com/pub:88" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/billie:888" function="http://www.w3.org/ns/odrl/2/assignee"/>
    </o:permission>
</o:Policy>

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:9999" inheritFrom="http://example.com/policy:5531">
    <o:permission>
        <o:asset uid="http://example.com/report:2333" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/display"/>
        <o:party uid="http://example.com/pub:88" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/class:IT01" function="http://www.w3.org/ns/odrl/2/assignee" scope="http://www.w3.org/ns/odrl/2/Group"/>
    </o:permission>
</o:Policy>

5.10 Social Network

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:5109">
    <o:permission>
        <o:asset uid="http://example.com/myPlace:billie:photos:football2010" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/display"/>
        <o:party uid="http://example.com/myPlace:billie" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:party uid="http://example.com/myPlace:network:football" function="http://www.w3.org/ns/odrl/2/assignee" scope="http://www.w3.org/ns/odrl/2/Group"/>
    </o:permission>
</o:Policy>

5.11 Multiple Assets

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" xmlns:x="http:example.com" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:881212">
    <o:permission>
        <o:asset uid="http://example.com/archive2010" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:asset uid="http://example.com/x/database" relation="x:collection"/>
        <o:action name="http://www.w3.org/ns/odrl/2/index"/>
    </o:permission>
</o:Policy>

6. Other Examples

6.1 ODRL Profile

To illustrate the use of the ODRL profile attribute, consider the ABC Community that has developed an ODRL/ABC Profile. The profile includes a number of restrictions from the ODRL Core Model, in particular, it does not support Inheritance and Prohibitions. They have also defined a new Action called “spell”. They define the identifier for both the vocabulary and the profile as “http://example.com/ABC/ODRL/”.

In the example below, the use of the profile attribute means that any consuming system must be aware of the ODRL/ABC Profile, and conform to its rules. For example, in this case using the ODRL/ABC Profile, no expression is allowed to include any Prohibitions or use inheritance.

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Set" uid="http://example.com/policy:ABC:000011" profile="http://example.com/ABC/ODRL/">
    <o:permission>
        <o:asset uid="http://example.com/asset:abc:01" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://example.com/ABC/ODRL/spell"/>
    </o:permission>
</o:Policy>

6.2 W3C Privacy Rulesets

The W3C Privacy Rulesets Editor’s Draft has been developed by the W3C Device APIs and Policy Working Group as a scheme for defining privacy rulesets: bundles of user privacy preferences that can be conveyed together with user data in the context of a web site or application interaction. The document defines three Privacy Elements with a number of attributes, summarised here:

  • Sharing, with attributes to scope the extend of sharing to; internal, affiliates, unrelated-companies, public
  • Secondary Use, with defined purposes; contextual, customization, marketing-or-profiling
  • Retention, with defined periods; no, short (retained for the baseline period of 35 days), long

The following example shows how to represent the Privacy Ruleset “Internal customization/personalization” from the document.

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://www.w3.org/ns/odrl/2/Privacy" uid="http://example.com/policy:2442">
    <o:permission>
        <o:asset uid="http://example.comjane-doe:personal-data" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/share"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/purpose" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.w3.org/2009/dap:internal"/>
        <o:duty uid="d1">
            <o:action name="http://www.w3.org/ns/odrl/2/delete"/>
            <o:constraint name="http://www.w3.org/ns/odrl/2/dateTime" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="P35D"/>
        </o:duty>
    </o:permission>
    <o:permission>
        <o:asset uid="http://example.com/jane-doe:personal-data" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/secondaryUse"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/purpose" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.w3.org/2009/dap:customization"/>
        <o:duty uid="#d1"/>
    </o:permission>
</o:Policy>

6.3 Open Data Commons

The Open Data Commons provides a number of licenses for the sharing of open databases. One example is the Open Database License (ODbL) v1.0 which enables you to “share, create, and adapt” the database as long as you “attribute, share-a-like, and keep open” the outcomes.

The following example shows how to represent that license in ODRL. Note that the “keep open” option is represented as a distribute Prohibition with “drm-restriction” constraint. Also, since Open Data Commons are “instant” licenses, no assignee is indicated, but assumed to be the recipient of the database asset.

<o:Policy xmlns:o="http://www.w3.org/ns/odrl/2/" type="http://w3.org/ns/odrl/2/Agreement" uid="http://example.com/policy:0101Z">
    <o:permission>
        <o:asset uid="http://example.com/gov.au:database:environment" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/distribute"/>
        <o:party uid="http://example.com/gov.au:env-dept" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="d1">
            <o:action name="http://www.w3.org/ns/odrl/2/attribute"/>
        </o:duty>
        <o:duty uid="d2">
            <o:action name="http://creativecommons.org/ns#Notice"/>
        </o:duty>
        <o:duty uid="d3">
            <o:action name="http://creativecommons.org/ns#ShareAlike"/>
        </o:duty>
    </o:permission>
    <o:permission>
        <o:asset uid="http://example.com/database:environment" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/v2/derive"/>
        <o:party uid="http://example.com/gov.au:env-dept" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="#d1"/>
        <o:duty uid="#d2"/>
        <o:duty uid="#d3"/>
    </o:permission>
    <o:permission>
        <o:asset uid="http://example.com/database:environment" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://wwww.w3.org/ns/odrl/2/transform"/>
        <o:party uid="http://example.com/gov.au:env-dept" function="http://www.w3.org/ns/odrl/2/assigner"/>
        <o:duty uid="#d1"/>
        <o:duty uid="#d2"/>
        <o:duty uid="#d3"/>
    </o:permission>
    <o:prohibition>
        <o:asset uid="http://example.com/database:environment" relation="http://www.w3.org/ns/odrl/2/target"/>
        <o:action name="http://www.w3.org/ns/odrl/2/distribute"/>
        <o:constraint name="http://www.w3.org/ns/odrl/2/system" operator="http://www.w3.org/ns/odrl/2/eq" rightOperand="http://www.opendatacommons.org:drm-restriction"/>
        <o:party uid="http://example.com/gov.au:env-dept" function="http://www.w3.org/ns/odrl/2/assigner"/>
    </o:prohibition>
</o:Policy>

Appendix-A. XML Schema (Normative)

The XML Schema for ODRL Version 2.1 is shown below.

To support extensibility and reuse all the elements and their respective datatypes are global. Additionally, the elements have been defined to include xs:any element and xs:anyAttribute attribute from any (non-odrl) namespace. Note that to support the id/idref attributes some of the attributes that would normally be mandatory are now optional. They must be mandatory when not referring to an element using an idref attribute.

Note that the XML Schema version attribute will always match the version of this ODRL specification.

This XML Schema is available at http://www.w3.org/ns/odrl/2/ODRL21.xsd

<xs:schema xmlns:o="http://www.w3.org/ns/odrl/2/" version="2.1" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3.org/ns/odrl/2/" elementFormDefault="qualified" attributeFormDefault="unqualified">

    <xs:element name="Policy" type="o:Policy"/>
    <xs:complexType name="Policy">
                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element ref="o:permission" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="o:prohibition" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="uid" type="o:URIQnameQcode" use="required"/>
                <xs:attribute name="type" type="o:URIQnameQcode" use="required"/>
                <xs:attribute name="conflict" type="o:ConflictTerm"/>
                <xs:attribute name="undefined" type="o:UndefinedTerm"/>
                <xs:attribute name="inheritAllowed" type="xs:boolean"/>
                <xs:attribute name="inheritFrom" type="o:URIQnameQcode"/>
                <xs:attribute name="inheritRelation" type="o:URIQnameQcode"/>
                <xs:attribute name="profile" type="o:URIQnameQcode"/>
                <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:element name="permission" type="o:Permission"/>
    <xs:complexType name="Permission">
           <xs:sequence>
                    <xs:element ref="o:asset" maxOccurs="unbounded"/>
                    <xs:element ref="o:action" />
                    <xs:element ref="o:constraint"  minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="o:party"  minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="o:duty"  minOccurs="0" maxOccurs="unbounded"/>
                    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
           </xs:sequence>
           <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="prohibition" type="o:Prohibition"/>
    <xs:complexType name="Prohibition">
        <xs:sequence>
            <xs:element ref="o:asset"  maxOccurs="unbounded"/>
            <xs:element ref="o:action" />
            <xs:element ref="o:constraint" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="o:party"  minOccurs="0" maxOccurs="unbounded"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="duty" type="o:Duty"/>
    <xs:complexType name="Duty">
        <xs:sequence>
            <xs:element ref="o:action" minOccurs="0"/> <!--Required Element-->
            <xs:element ref="o:asset"  minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="o:constraint"  minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="o:party"  minOccurs="0" maxOccurs="unbounded"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="uid" type="o:URIQnameQcode"/>
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="asset" type="o:Asset"/>
    <xs:complexType name="Asset">
        <xs:attribute name="uid" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attribute name="relation" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="party" type="o:Party"/>
    <xs:complexType name="Party">
        <xs:attribute name="uid" type="o:URIQnameQcode"/> <!--Required Attribute-->
        <xs:attribute name="function" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attribute name="scope" type="o:URIQnameQcode"/>
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="action" type="o:Action"/>
    <xs:complexType name="Action">
        <xs:attribute name="name" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:element name="constraint" type="o:Constraint"/>
    <xs:complexType name="Constraint">
        <xs:attribute name="name" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attribute name="operator" type="o:URIQnameQcode" /> <!--Required Attribute-->
        <xs:attribute name="rightOperand" type="o:listOfValues" /> <!--Required Attribute-->
        <xs:attribute name="dataType" type="o:URIQnameQcode" />
        <xs:attribute name="unit" type="o:URIQnameQcode" />
        <xs:attribute name="status" type="xs:string" />
        <xs:attributeGroup ref="o:idAttributes"/>
    </xs:complexType>

    <xs:simpleType name="listOfValues">
        <xs:list itemType="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="ConflictTerm">
        <xs:restriction base="xs:string">
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/perm"/>
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/prohibit"/>
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/invalid"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="UndefinedTerm">
        <xs:restriction base="xs:string">
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/support"/>
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/ignore"/>
            <xs:enumeration value="http://www.w3.org/ns/odrl/2/invalid"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="URIQnameQcode">
        <xs:union memberTypes="xs:anyURI xs:QName o:QCode"/>
    </xs:simpleType>

    <xs:simpleType name="QCode">
        <xs:restriction base="xs:string">
            <xs:pattern value="[^\s:]+:[^\s]+"/>
        </xs:restriction>

    </xs:simpleType>
    <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>
</xs:schema>

Acknowledgements

The editors gratefully acknowledge feedback and contributions to this document from:

  • All members of the W3C ODRL Community Group
  • Especially Stuart Myles, Michael Steidl, Francis Cave, Jim Earley, Helge Hundacker, Daniel Paehler, Andreas Kasten, Rainer Weissenfels

References

[ODRL-MODEL] R. Iannella, S. Guth, D. Paehler, A. Kasten (eds). Open Digital Rights Language (ODRL) Version 2.1 – Core Model. Final Specification, W3C ODRL Community Group. http://www.w3.org/community/odrl/model/2.1/
[ODRL-VOCAB] R. Iannella, M. Steidl, S. Guth (eds). Open Digital Rights Language (ODRL) Version 2.1 – Common Vocabulary. Final Specification, W3C ODRL Community Group. http://www.w3.org/community/odrl/vocab/2.1/
[ODRL-ONTO] M. McRoberts, V. Rodríguez Doncel. Open Digital Rights Language (ODRL) Version 2.1 – Ontology. Final Specification, W3C ODRL Community Group
http://www.w3.org/ns/odrl/2/
[Q-CODE] NewsML Specification Version 2.4. International Press Telecommunications Council (IPTC) 2009 http://www.iptc.org/std/NewsML-G2/2.4/specification/NewsML-G2_2.4-spec-PCL.pdf
[RFC2119] Key words for use in RFCs to Indicate Requirement Levels, S. Bradner. The Internet Society, March 1997. http://www.ietf.org/rfc/rfc2119.txt
[XML] T. Bray & J. Paoli & C. M. Sperberg-McQueen & E. Maler & F. Yergeau (eds). Extensible Markup Language (XML) 1.0 (Fifth Edition). W3C Recommendation 26 November 2008. http://www.w3.org/TR/xml/
[XML-SCHEMA] H. S. Thompson & D. Beech & M. Maloney & N. Mendelsohn (eds). XML Schema Part 1: Structures Second Edition. W3C Recommendation 28 October 2004. http://www.w3.org/TR/xmlschema-1/
[XML-SCHEMA-DT] P. V. Biron & K. Permanente & A. Malhotra (eds). XML Schema Part 2: Datatypes Second Edition. W3C Recommendation 28 October 2004. http://www.w3.org/TR/xmlschema-2/
[XML-NAME] T. Bray & D. Hollander & A. Layman & R. Tobin & H. S. Thompson (eds). Namespaces in XML 1.0 (Third Edition). W3C Recommendation 8 December 2009. http://www.w3.org/TR/xml-names/
[XMPP-CORE] P. Saint-Andre (ed). Extensible Messaging and Presence Protocol (XMPP): Core. IETF RFC3920 October 2004. http://tools.ietf.org/html/rfc3920
No Comments |