[oslc-core] Issue with the Use of dcterms:title and dcterms:description with oslc:ResponseInfo
Arthur Ryman
ryman at ca.ibm.com
Tue Nov 23 12:46:45 EST 2010
While reviewing an implementation I noticed that dcterms:title and
dcterms:description can be used with oslc:ResponseInfo. This can lead to
confusion in the case of requesting a any resource, since that resource
itself may use those properties. The resource URI of the first page of a
multi-page response is the same as the URI of the resource itself.
For example, suppose we have a resource that is a list of bugs and that it
has the dcterms:title "List of Bugs". Suppose it contains 10,000 bugs, and
this is too much to return in one response. This resource is like:
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc="
http://open-services.net/ns/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.org/bugs">
<dcterms:title>Bug List</dcterms:title>
<rdfs:member rdf:resource="http://example.org/bugs/1" />
<rdfs:member rdf:resource="http://example.org/bugs/2" />
<!-- etc. -->
<rdfs:member rdf:resource="http://example.org/bugs/10000"
/>
</rdf:Description>
</rdf:RDF>
Suppose the service will only return 1,000 or less bugs per response. When
you get the bug list URI, the response therefore gets paged. The OSLC Core
spec says that the first page looks something like:
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc="
http://open-services.net/ns/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.org/bugs">
<dcterms:title>Bug List</dcterms:title>
<rdfs:member rdf:resource="http://example.org/bugs/1" />
<rdfs:member rdf:resource="http://example.org/bugs/2" />
<!-- etc. -->
<rdfs:member rdf:resource="http://example.org/bugs/1000"
/>
</rdf:Description>
<oslc:ResponseInfo rdf:about="http://example.org/bugs">
<dcterms:title>Bug List - Page 1</dcterms:title>
<oslc:totalCount>10000</oslc:totalCount>
<oslc:nextPage rdf:resource="
http://example.org/bugs/pages/2" />
</oslc:ResponseInfo>
</rdf:RDF>
The issue here is that now there are two dcterms:title triples associated
with the subject node <http:example.org/bugs>, which is confusing since
the second one (a child of the oslc:ResponseInfo element) is really the
title of the response.
I can see two fixes. I prefer fix 1 since it cleanly separates the
response info from the request result data.
1. (Preferred) Introduce another property, e.g. oslc:request to identify
the request URI, and use a blank node for oslc:ResponseInfo. The result is
now:
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc="
http://open-services.net/ns/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.org/bugs">
<dcterms:title>Bug List</dcterms:title>
<rdfs:member rdf:resource="http://example.org/bugs/1" />
<rdfs:member rdf:resource="http://example.org/bugs/2" />
<!-- etc. -->
<rdfs:member rdf:resource="http://example.org/bugs/1000"
/>
</rdf:Description>
<oslc:ResponseInfo>
<oslc:request rdf:resource="http://example.org/bugs" />
<dcterms:title>Bug List - Page 1</dcterms:title>
<oslc:totalCount>10000</oslc:totalCount>
<oslc:nextPage rdf:resource="
http://example.org/bugs/pages/2" />
</oslc:ResponseInfo>
</rdf:RDF>
2. Use different properties for title and description, e.g.
oslc:responseTitle, oslc:responseDescription
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc="
http://open-services.net/ns/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://example.org/bugs">
<dcterms:title>Bug List</dcterms:title>
<rdfs:member rdf:resource="http://example.org/bugs/1" />
<rdfs:member rdf:resource="http://example.org/bugs/2" />
<!-- etc. -->
<rdfs:member rdf:resource="http://example.org/bugs/1000"
/>
</rdf:Description>
<oslc:ResponseInfo rdf:about="http://example.org/bugs">
<oslc:responseTitle>Bug List - Page 1</oslc:responseTitle>
<oslc:totalCount>10000</oslc:totalCount>
<oslc:nextPage rdf:resource="
http://example.org/bugs/pages/2" />
</oslc:ResponseInfo>
</rdf:RDF>
Regards,
___________________________________________________________________________
Arthur Ryman, PhD, DE
Chief Architect, Project and Portfolio Management
IBM Software, Rational
Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063
More information about the Oslc-Core
mailing list