Skip to toolbar

Community & Business Groups

ODRL Version 2.1 JSON Encoding

Final Specification: 5 March 2015

This Version:

Latest Version:

Jonas Öberg, Commons Machinery in Sweden AB
Stuart Myles, The Associated Press
Lu Ai, The Associated Press

Status of this document

This work 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 (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 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

Example 2 Offer

Example 3 Agreement

Example 4 Request

Example 5 Ticket

Example 6 Offer and Next Policy

Example 7 Privacy

Example 8 Permission and Prohibition

Example 9 Inheritance

Example 10 Social Network

Example 11 Multiple Assets

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

4. Schema

A schema for ODRL in JSON using JSON-schema v4 [JSON-SCHEMA].

5. Acknowledgements

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

  • All members of the W3C ODRL Community Group

6. References

[ECMA-292] European Computer Manufacturers Association. ECMAScript
Language Specification 3rd Edition, December 1999.
[JSON] D. Crockford. JavaScript Object Notation, RFC 4627.
[JSON-LD] Manu Sporny, Dave Longley, Gregg Kellogg, Markus Lanthaler, Niklas Lindström. JSON-LD 1.0 A JSON-based Serialization for Linked Data. W3C Recommendation 16 January 2014.
[JSON-SCHEMA] K. Zyp – A JSON Media Type for Describing the Structure and Meaning of JSON Documents
[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.
[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.
[ODRL-XML] R. Iannella (eds). Open Digital Rights Language (ODRL) Version 2.1 – XML Encoding. Final Specification, W3C ODRL Community Group.
[ODRL-ONTO] M. McRoberts, V. Rodríguez Doncel. Open Digital Rights Language (ODRL) Version 2.1 – Ontology. Final Specification, W3C ODRL Community Group
[QCODE] NewsML Specification Version 2.4. International Press Telecommunications Council (IPTC) 2009
[RFC2119] Key words for use in RFCs to Indicate Requirement Levels, S. Bradner. The Internet Society, March 1997.
[RIGHTSML] RightsML: The IPTC Standard for Machine Readable Rights.

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.