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.

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 JSON syntax [JSON] and using a JSON Schema [JSON-SCHEMA].

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

2. Approach

ODRL can express complex contracts and policies which may require quite sophisticated systems to evaluate contractual permissions, restrictions and duties. However, the ODRL in JSON encoding is designed to be lightweight and requires only standard JSON software to generate or parse the representation.

In order to make the JSON encoding of ODRL as “natural” as possible, certain terms which are represented in the ODRL Common Vocabulary as values become JSON properties. For example, both “assigner” and “assignee” are Role controlled vocabulary values of Party. However, in the JSON encoding, they are expressed as full-fledged Properties. This contrasts with the XML encoding which has a Party element and a Role attribute.

Similarly, the Asset object has a Relation controlled vocabulary with values of “target” and “output”. The JSON encoding directly represents these as first-class properties.

The ODRL Model and Common Vocabulary is designed in this manner, in part, to allow for extensibility. In other words, it is possible to add additional types of Party or other kinds of Asset. The JSON ODRL Encoding allows for this by using patternProperties – for example, for additional types of Party or Scope.

Unlike XML, JSON doesn’t support the concept of namespaces. This means that property values need to be expressed using globally unique identifiers, in order to be unambiguous. Therefore, one key implementation decision for ODRL in JSON is to require that terms drawn from the ODRL Common Vocabulary or any ODRL profile (such as RightsML [RIGHTSML]) must be expressed using complete URLs. (This differs from the XML encoding of ODRL, which allows various short forms of URLs to be used, like QNames [Q-NAMES] or QCodes [Q-CODES]).

All of the URIs used in ODRL JSON 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.

2.1 A Note on JSON-LD

JSON-LD [JSON-LD] (JSON for Linked Data) is a method to convey Linked Data using JSON. It is a W3C Recommendation and it is a JSON syntax for RDF (similar to the RDF/XML and Turtle syntaxes for RDF). If you would prefer to use JSON-LD, it is recommended that you use the ODRL Ontology [ODRL-ONTO] and appropriate software to parse and serialize the RDF triples using JSON-LD.

3. Examples

Example 1 Set

1

2

3

4

5

6

7

8

9

10

11

12

{

"policytype":"http://www.w3.org/ns/odrl/2/Set",

"policyid":"http://example.com/policy:0099",

"permissions":[{

"target":"http://example.com/asset:9898",

"action":"http://www.w3.org/ns/odrl/2/reproduce"

}],

"prohibitions":[{

"target":"http://example.com/asset:9898",

"action":"http://www.w3.org/ns/odrl/2/modify"

}]

}

Example 2 Offer

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

{

"policytype":"http://www.w3.org/ns/odrl/2/Offer",

"policyid":"http://example.com/policy:0231",

"permissions":[

{

"target":"http://example.com/music:4545",

"action":"http://www.w3.org/ns/odrl/2/play",

"assigner":"http://example.com/sony:10",

"duties":[{

"action":"http://www.w3.org/ns/odrl/2/compensate",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/payAmount",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"0.50",

"rightoperanddatatype":"http://www.w3.org/2001/XMLSchema#decimal",

"rightoperandunit":"http://cvx.iptc.org/iso4217a/AUD"

}]

}]

},

{

"target":"http://example.com/music:4545",

"action":"http://www.w3.org/ns/odrl/2/copy",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/count",

"operator":"http://www.w3.org/ns/odrl/2/lteq",

"rightoperand":"1"

}],

"assigner":"http://example.com/sony:10",

"duties":[{

"action":"http://www.w3.org/ns/odrl/2/compensate",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/payAmount",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"0.50",

"rightoperanddatatype":"http://www.w3.org/2001/XMLSchema#decimal",

"rightoperandunit":"http://cvx.iptc.org/iso4217a/AUD"

}]

}]

}

]

}

Example 3 Agreement

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

{

"policytype":"http://www.w3.org/ns/odrl/2/Agreement",

"policyid":"http://example.com/policy:9001",

"permissions":[

{

"target":"http://example.com/music:4545",

"action":"http://www.w3.org/ns/odrl/2/play",

"assigner":"http://example.com/sony:10",

"assignee":"http://example.com/billie:888",

"duties":[{

"action":"http://www.w3.org/ns/odrl/2/compensate",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/payAmount",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"0.50",

"rightoperanddatatype":"http://www.w3.org/2001/XMLSchema#decimal",

"rightoperandunit":"http://cvx.iptc.org/iso4217a/AUD"

}]

}]

},

{

"target":"http://example.com/music:4545",

"action":"http://www.w3.org/ns/odrl/2/copy",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/count",

"operator":"http://www.w3.org/ns/odrl/2/lteq",

"rightoperand":"1"

}],

"assigner":"http://example.com/sony:10",

"assignee":"http://example.com/billie:888",

"duties":[{

"action":"http://www.w3.org/ns/odrl/2/compensate",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/payAmount",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"0.50",

"rightoperanddatatype":"http://www.w3.org/2001/XMLSchema#decimal",

"rightoperandunit":"http://cvx.iptc.org/iso4217a/AUD"

}]

}]

}

]

}

Example 4 Request

1

2

3

4

5

6

7

8

9

{

"policytype":"http://www.w3.org/ns/odrl/2/Request",

"policyid":"http://example.com/policy:04311",

"permissions":[{

"target":"http://example.com/news:0099",

"action":"http://www.w3.org/ns/odrl/2/display",

"assignee":"http://example.com/guest:0589"

}]

}

Example 5 Ticket

1

2

3

4

5

6

7

8

9

10

11

12

13

{

"policytype":"http://www.w3.org/ns/odrl/2/Ticket",

"policyid":"http://example.com/policy:04311",

"permissions":[{

"target":"http://example.com/game:4589",

"action":"http://www.w3.org/ns/odrl/2/play",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/dateTime",

"operator":"http://www.w3.org/ns/odrl/2/lteq",

"rightoperand":"2010-12-31"

}]

}]

}

Example 6 Offer and Next Policy

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

{

"policytype":"http://www.w3.org/ns/odrl/2/Offer",

"policyid":"http://example.com/policy:5531",

"permissions":[{

"target":"http://example.com/wallpaper:2321",

"action":"http://www.w3.org/ns/odrl/2/distribute",

"constraints":[{

"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"

}],

"assigner":"http://example.com/sony:99",

"duties":[

{

"action":"http://www.w3.org/ns/odrl/2/compensate",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/payAmount",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"1000.00",

"rightoperanddatatype":"http://www.w3.org/2001/XMLSchema#decimal",

"rightoperandunit":"http://cvx.iptc.org/iso4217a/EUR"

}]

},

{

"action":"http://www.w3.org/ns/odrl/2/nextPolicy",

"target":"http://example.com/policy:7777"

}

]

}]

}

{

"policytype":"http://www.w3.org/ns/odrl/2/Set",

"policyid":"http://example.com/policy:7777",

"permissions":[{

"target":"http://example.com/wallpaper:2321",

"action":"http://www.w3.org/ns/odrl/2/display"

}]

}

Example 7 Privacy

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

{

"policytype":"http://www.w3.org/ns/odrl/2/Privacy",

"policyid":"http://example.com/policy:1111",

"permissions":[{

"target":"http://example.com/billie:888:personal-data",

"action":"http://www.w3.org/ns/odrl/2/distribute",

"constraints":[{

"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"

}],

"assigner":"http://example.com/billie:888",

"assignee":"http://example.com/gov:health:au",

"duties":[{

"action":"http://www.w3.org/ns/odrl/2/delete",

"target":"http://example.com/billie:888:personal-data",

"constraints":[{

"name":"http://www.w3.org/ns/odrl/2/dateTime",

"operator":"http://www.w3.org/ns/odrl/2/eq",

"rightoperand":"P30D"

}]

}]

}]

}

Example 8 Permission and Prohibition

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

{

"policytype":"http://www.w3.org/ns/odrl/2/Agreement",

"policyid":"http://example.com/policy:3433",

"conflict":"perm",

"permissions":[{

"target":"http://example.com/music:1234908",

"action":"http://www.w3.org/ns/odrl/2/play",

"assigner":"http://example.com/sony:10",

"assignee":"http://example.com/billie:888"

}],

"prohibitions":[{

"target":"http://example.com/music:1234908",

"action":"http://oma.org/drm:ringtone",

"assigner":"http://example.com/sony:10",

"assignee":"http://example.com/billie:888"

}]

}

Example 9 Inheritance

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

{

"policytype":"http://www.w3.org/ns/odrl/2/Agreement",

"policyid":"http://example.com/policy:5531",

"inheritallowed":true,

"permissions":[{

"target":"http://example.com/report:2321",

"action":"http://www.w3.org/ns/odrl/2/print",

"assigner":"http://example.com/pub:88",

"assignee":"http://example.com/billie:888"

}]

}

{

"policytype":"http://www.w3.org/ns/odrl/2/Agreement",

"policyid":"http://example.com/policy:9999",

"inheritfrom":"http://example.com/policy:5531",

"permissions":[{

"target":"http://example.com/report:2333",

"action":"http://www.w3.org/ns/odrl/2/display",

"assigner":"http://example.com/pub:88",

"assignee":"http://example.com/class:IT01",

"assignee_scope":"http://www.w3.org/ns/odrl/2/group"

}]

}

Example 10 Social Network

1

2

3

4

5

6

7

8

9

10

11

{

"policytype":"http://www.w3.org/ns/odrl/2/Agreement",

"policyid":"http://example.com/policy:5109",

"permissions":[{

"target":"http://example.com/myPlace:billie:photos:football2010",

"action":"http://www.w3.org/ns/odrl/2/display",

"assigner":"http://example.com/myPlace:billie",

"assignee":"http://example.com/myPlace:network:football",

"assignee_scope":"http://www.w3.org/ns/odrl/2/group"

}]

}

Example 11 Multiple Assets

1

2

3

4

5

6

7

8

9

{

"policytype":"http://www.w3.org/ns/odrl/2/Set",

"policyid":"http://example.com/policy:881212",

"permissions":[{

"target":"http://example.com/archive2010",

"x:collection":"http://example.com/x/database",

"action":"http://www.w3.org/ns/odrl/2/index"

}]

}

Example 12 A request to display (according to the Common Vocabulary) and distribute (according to RightsML)