Purpose
This document shows some informative examples of XML formats and is not a specification itself.
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>
This
example shows a collection of change requests returned from the following paged query (note: this example is not URL-encoded):
{Simple Query URL}?oslc_cm.query=dc:title="Junit*"&oslc_cm.properties=dc:identifier,dc:title,dc:creator{dc:title}&oslc_cm.pageSize=2