Skip to content

Commit

Permalink
Removed support for Qcodes and Qnames in XML serialisation #151
Browse files Browse the repository at this point in the history
  • Loading branch information
riannella committed May 16, 2017
1 parent 5405479 commit 04388d9
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 122 deletions.
159 changes: 76 additions & 83 deletions vocab/ODRL22.xsd
Original file line number Diff line number Diff line change
@@ -1,133 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:o="http://www.w3.org/ns/odrl/2/" version="2.2"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/ns/odrl/2/"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:schema xmlns:o="http://www.w3.org/ns/odrl/2/" version="2.2"
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/ns/odrl/2/"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
This is the XML Schema for ODRL Version 2.2 Working Draft
Copyright © 2016 W3C (MIT, ERCIM, Keio, Beihang).
W3C liability, trademark and document use rules apply.
</xs:documentation>
<xs:documentation> This is the XML Schema for ODRL Version 2.2 Working Draft Copyright ©
2016 W3C (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules
apply. </xs:documentation>
</xs:annotation>
<xs:element name="Policy" type="o:Policy"/>
<xs:complexType name="Policy">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="o:asset" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:party" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:action" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:permission" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:prohibition" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:constraint" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</xs:choice>
<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="inheritAllowed" type="xs:boolean"/>
<xs:attribute name="inheritFrom" type="o:URIQnameQcode"/>
<xs:attribute name="profile" type="o:URIQnameQcode"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="o:asset" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:party" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:action" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:permission" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:prohibition" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="o:constraint" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="uid" type="xs:anyURI" use="required"/>
<xs:attribute name="type" type="xs:anyURI" use="required"/>
<xs:attribute name="conflict" type="o:ConflictTerm"/>
<xs:attribute name="inheritAllowed" type="xs:boolean"/>
<xs:attribute name="inheritFrom" type="xs:anyURI"/>
<xs:attribute name="profile" type="xs:anyURI"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>

<xs:element name="permission" type="o:Permission"/>
<xs:complexType name="Permission">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="o:asset" maxOccurs="unbounded"/>
<xs:element ref="o:action" maxOccurs="unbounded" />
<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:choice>
<xs:attributeGroup ref="o:idAttributes"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="o:asset" maxOccurs="unbounded"/>
<xs:element ref="o:action" maxOccurs="unbounded"/>
<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:choice>
<xs:attributeGroup ref="o:idAttributes"/>
</xs:complexType>
<xs:element name="prohibition" type="o:Prohibition"/>

<xs:element name="prohibition" type="o:Prohibition"/>
<xs:complexType name="Prohibition">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="o:asset" maxOccurs="unbounded"/>
<xs:element ref="o:asset" maxOccurs="unbounded"/>
<xs:element ref="o:action" 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:element ref="o:party" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
<xs:attributeGroup ref="o:idAttributes"/>
</xs:complexType>

<xs:element name="duty" type="o:Duty"/>
<xs:complexType name="Duty">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<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: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:choice>
<xs:attribute name="uid" type="o:URIQnameQcode"/>
<xs:attribute name="uid" type="xs:anyURI "/>
<xs:attributeGroup ref="o:idAttributes"/>
</xs:complexType>
<xs:element name="asset" type="o:Asset"/>

<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:attribute name="scope" type="o:URIQnameQcode"/>
<xs:attribute name="uid" type="xs:anyURI"/>
<!--Required Attribute-->
<xs:attribute name="relation" type="xs:anyURI"/>
<!--Required Attribute-->
<xs:attribute name="scope" type="xs:anyURI"/>
<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:attribute name="uid" type="xs:anyURI"/>
<!--Required Attribute-->
<xs:attribute name="function" type="xs:anyURI"/>
<!--Required Attribute-->
<xs:attribute name="scope" type="xs:anyURI"/>
<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:attribute name="name" type="xs:anyURI"/>
<!--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" /> <!--leftOperand - Required Attribute-->
<xs:attribute name="operator" type="o:URIQnameQcode" /> <!--Required Attribute-->
<xs:attribute name="rightOperand" type="o:listOfValues" /> <!--Required Attribute (if no rightOperandReference)-->
<xs:attribute name="rightOperandReference" type="xs:anyURI" /> <!--Required Attribute (if no rightOperand)-->
<xs:attribute name="dataType" type="o:URIQnameQcode" />
<xs:attribute name="unit" type="o:URIQnameQcode" />
<xs:attribute name="status" type="xs:string" />
<xs:attribute name="name" type="xs:anyURI"/>
<!--leftOperand - Required Attribute-->
<xs:attribute name="operator" type="xs:anyURI"/>
<!--Required Attribute-->
<xs:attribute name="rightOperand" type="o:listOfValues"/>
<!--Required Attribute (if no rightOperandReference)-->
<xs:attribute name="rightOperandReference" type="xs:anyURI"/>
<!--Required Attribute (if no rightOperand)-->
<xs:attribute name="dataType" type="xs:anyURI"/>
<xs:attribute name="unit" type="xs:anyURI"/>
<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="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"/>
Expand Down
2 changes: 1 addition & 1 deletion vocab/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var respecConfig = {
specStatus: "ED",
shortName: "odrl-vocab",
publishDate: "2017-05-11",
publishDate: "2017-05-16",
edDraftURI: "https://w3c.github.io/poe/vocab/",
editors: [
{ name: "Renato Iannella",
Expand Down
41 changes: 22 additions & 19 deletions vocab/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1360,21 +1360,18 @@ <h2>XML Encoding</h2>
<p>The (editors draft) ODRL XML Schema can be <a href="http://w3c.github.io/poe/vocab/ODRL22.xsd">downloaded</a>.</p>
</div>

<p>To enable compact IRIs, this encoding also supports the use of Qualified Names (QNames) [[xml-names]] for the specification of the value identifiers. In addition, Qualified Codes (QCodes) [[news-ml]] MAY also be used for vocabulary values. QCodes are similar to QNames but also allow a digit as the first character of the value.</p>


<p>Each of the classes from the ODRL Information Model [[!odrl-model]] will be represented by an XML element of the same name. Additionally, each class property will be represented as an XML attribute of the parent element. The fixed values defined in the ODRL Information Model are represented as enumerated types. Cardinalities are also represented with XML Schema occurrence rules. Attributes are optional unless explicitly noted as REQUIRED. </p>
<p>Note that the Rule class is not represented in the XML encoding, only the child classes; Permission, Prohibition, and Duty.</p>
<P>Note that the Policy Type MAY infer additional constraints and requirements on the cardinalities of XML elements. See the definition of the <a href="#policyTypes">Policy Types</a> for further details. </P>

<p>The Policy element contains the following attributes:</p>
<ul>
<li>uid - an IRI/Qname/Qcode (REQUIRED)</li>
<li>type -an IRI/Qname/Qcode (REQUIRED)</li>
<li>uid - an IRI (REQUIRED)</li>
<li>type -an IRI (REQUIRED)</li>
<li>conflict - fixed enumeration (defined in XML Schema)</li>
<li>inheritAllowed - a boolean</li>
<li>inheritFrom - an IRI/Qname/Qcode</li>
<li>profile -an IRI/Qname/Qcode </li>
<li>inheritFrom - an IRI</li>
<li>profile -an IRI </li>
</ul>

<P><strong>NOTE:</strong> The <strong>type</strong> attribute is used to express the ODRL Policy subclass.</P>
Expand All @@ -1394,9 +1391,9 @@ <h2>XML Encoding</h2>

<p>The Asset class is a single asset element to represent both the Asset uid and how it is related to the Rule. The Asset element contains the following attributes:</p>
<ul>
<li>uid - an IRI/Qname/Qcode</li>
<li>relation - an IRI/Qname/Qcode</li>
<li>scope - an IRI/Qname/Qcode</li>
<li>uid - an IRI</li>
<li>relation - an IRI</li>
<li>scope - an IRI</li>
<li>id - an local identifier for this element</li>
<li>idref - a reference to an Asset element</li>
</ul>
Expand All @@ -1407,9 +1404,9 @@ <h2>XML Encoding</h2>
</ol>
<p>The Party class is a single party element to represent both the Party uid and the functional role to the Rule. The Party element contains the following attributes:</p>
<ul>
<li>uid - an IRI/Qname/Qcode</li>
<li>function - an IRI/Qname/Qcode</li>
<li>scope - an IRI/Qname/Qcode</li>
<li>uid - an IRI</li>
<li>function - an IRI</li>
<li>scope - an IRI</li>
<li>id - a local identifier for this element</li>
<li>idref - a reference to a Party element</li>
</ul>
Expand Down Expand Up @@ -1442,7 +1439,7 @@ <h2>XML Encoding</h2>
</ul>
<p>The Duty element contains the following attributes:</p>
<ul>
<li>uid - an IRI/Qname/Qcode</li>
<li>uid - an IRI</li>
<li>id - a local identifier for this element</li>
<li>idref - a reference to an Duty element</li>
</ul>
Expand All @@ -1454,7 +1451,7 @@ <h2>XML Encoding</h2>
</ol>
<p>The Action element contains the following attributes:</p>
<ul>
<li>name - an IRI/Qname/Qcode </li>
<li>name - an IRI </li>
<li>id - a local identifier for this element</li>
<li>idref - a reference to an Action element</li>
</ul>
Expand All @@ -1465,12 +1462,12 @@ <h2>XML Encoding</h2>
</ol>
<p>The Constraint element contains the following attributes:</p>
<ul>
<li>name - an IRI/Qname/Qcode</li>
<li>operator - an IRI/Qname/Qcode</li>
<li>name - an IRI</li>
<li>operator - an IRI</li>
<li>rightOperand - string, space separated list for set values</li>
<li>rightOperandReference - an IRI</li>
<li>dataType - an IRI/Qname/Qcode</li>
<li>unit - an IRI/Qname/Qcode</li>
<li>dataType - an IRI</li>
<li>unit - an IRI</li>
<li>status - string</li>
<li>id - a local identifier for this element</li>
<li>idref - a reference to an Constraint element</li>
Expand Down Expand Up @@ -1702,6 +1699,12 @@ <h2>Changes from the Community Group Reports</h2>

<li>Removed (deprecated) the Undefined Actions vocab terms. <code><a href="https://github.com/w3c/poe/issues/139">(Issue#139)</a></code></li>


<li>Removed period support from dateTime constraint. <code><a href="https://github.com/w3c/poe/issues/118">(Issue#118)</a></code></li>

<li>Removed support for Qnames and Qcodes in XML serialisation. <code><a href="https://github.com/w3c/poe/issues/151">(Issue#151)</a></code></li>


</ul></section>


Expand Down
3 changes: 3 additions & 0 deletions vocab/parts/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@

<li>Removed period support from dateTime constraint. <code><a href="https://github.com/w3c/poe/issues/118">(Issue#118)</a></code></li>

<li>Removed support for Qnames and Qcodes in XML serialisation. <code><a href="https://github.com/w3c/poe/issues/151">(Issue#151)</a></code></li>


</ul>
Loading

0 comments on commit 04388d9

Please sign in to comment.