Purpose
This specification describes how the XML format is used to represent OSLC resources and collection of resources.
Notation and Conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in
RFC2119. Domain name examples use
RFC2606.
Terminology
TBD
Intro
Overall Structure
The XML format follows these RDF conventions so that it can be parsed by RDF-XML parsers:
- rdf.about on root element (which references itself),
- instead of the "href" attribute the "rdf.resource" attribute is used,
- when inlining resources, an intermediate "Type" attribute is introduced.
The following example shows a single change request:
<?xml version="1.0" encoding="UTF-8"?>
<oscm:ChangeRequest rdf:about="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_QuslsChdEd6_n7s4KPukJQ"
xmlns:os="http://open-services.net/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oscm="http://open-services.net/cm/1.0/">
<dc:title>JUnit 4.3 contains samples and tests in junit-4.3[-src].jar</dc:title>
<dc:creator rdf:resource="https://localhost:9443/jazz/oslc/users/_LjbasChdEd6_n7s4KPukJQ" />
<dc:identifier>199</dc:identifier>
</oscm:ChangeRequest>
The following examples were produced by RTC 2.0 M3. The corresponding JSON version is shown at the bottom of this
page? .
This
example shows a non-inlined RTC work item in XML format.
For the second
example inlining was requested for all first level reference attributes.
Collections
Collections of change requests, e.g. the result set returned from a query, are represented as an oscm:Collection that only contains oscm:ChangeRequest elements. The size of the collection is limited in size by the request parameter oscm:pageSize.
Subsequent pages MUST be able to be requested using the following pagination attributes in the Collection element:
- oscm:next - A URI that refers to the immediately following document in a series of documents.
- oscm:previous - A URI that refers to the immediately preceding document in a series of documents.
The following example shows the first page of a paged query result:
<?xml version="1.0" encoding="UTF-8"?>
<oscm:Collection rdf:about="https://localhost:9443/jazz/oslc/contexts/_33WRoChcEd6_n7s4KPukJQ/workitems?oslc.query=..."
xmlns:os="http://open-services.net/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oscm="http://open-services.net/cm/1.0/"
oscm:next="https://localhost:9443/jazz/oslc/contexts/_33WRoChcEd6_n7s4KPukJQ/workitems?rtccm.resultToken=_f7Or4Cm-Ed6Mu7j_eP7g0Q">
<oscm:ChangeRequest rdf:resource="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_QuslsChdEd6_n7s4KPukJQ" />
<oscm:ChangeRequest rdf:resource="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_RA_PkChdEd6_n7s4KPukJQ" />
</oscm:Collection>
In this example inlining was requested for the dc:creator, dc:identifier, and dc:title properties.
<?xml version="1.0" encoding="UTF-8"?>
<oscm:Collection rdf:about="https://localhost:9443/jazz/oslc/contexts/_33WRoChcEd6_n7s4KPukJQ/workitems?oslc.query=..."
xmlns:os="http://open-services.net/1.0/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:oscm="http://open-services.net/cm/1.0/"
oscm:next="https://localhost:9443/jazz/oslc/contexts/_33WRoChcEd6_n7s4KPukJQ/workitems?rtccm.resultToken=_f7Or4Cm-Ed6Mu7j_eP7g0Q">
<oscm:ChangeRequest rdf:resource="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_QuslsChdEd6_n7s4KPukJQ">
<dc:creator rdf:resource="https://localhost:9443/jazz/oslc/users/_LjbasChdEd6_n7s4KPukJQ">
<dc:title>Jennifer Ginness</dc:title>
</dc:creator>
<dc:identifier>199</dc:identifier>
<dc:title>JUnit 4.3 contains samples and tests in junit-4.3[-src].jar</dc:title>
</oscm:ChangeRequest>
<oscm:ChangeRequest rdf:resource="https://localhost:9443/jazz/resource/itemOid/com.ibm.team.workitem.WorkItem/_RA_PkChdEd6_n7s4KPukJQ">
<dc:creator rdf:resource="https://localhost:9443/jazz/oslc/users/_LlBWIChdEd6_n7s4KPukJQ">
<dc:title>Rick Yuen</dc:title>
</dc:creator>
<dc:identifier>206</dc:identifier>
<dc:title>Junit version on the website is still 4.1</dc:title>
</oscm:ChangeRequest>
</oscm:Collection>
--
AndreWeinand - 24 Mar 2009