Not able to get owned by attribute through OSLC API in rest client
Hi Team,
We are working on RTC 7.0.2 SR1. We are trying to get Resolver and owner IDs through OSLC Query
Below is the query:
Method: GET
Headers-
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
When we are trying this query in web browser we are getting below result
<oslc_cm:Collection xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" oslc_cm:totalCount="1">
<oslc_cm:ChangeRequest rdf:resource="https://Servername/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/148">
<dc:identifier>148</dc:identifier>
<rtc_cm:ownedBy rdf:resource="https://Servername/jts/users/USerID"/>
<rtc_cm:resolvedBy rdf:resource="https://Servername/jts/users/unassigned"/>
</oslc_cm:ChangeRequest>
</oslc_cm:Collection>
it contains both resolved by and owned by tags available which is expected answer
but when we are trying through Rest client we are giving below output:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" >
<rdf:Description rdf:about="https://Servername/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/148">
<rdf:type rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<rtc_cm:resolvedBy rdf:resource="https://Servername/jts/users/unassigned"/>
</rdf:Description>
<rdf:Description rdf:about="https://Servername/ccm/oslc/contexts/ProjectUUID/workitems">
<rdfs:member rdf:resource="https://Servername/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/148"/>
</rdf:Description>
<rdf:Description rdf:about="https://Servername/ccm/oslc/contexts/ProjectUUID/workitems?oslc.select=dc:identifier,rtc_cm:resolvedBy,rtc_cm:ownedBy&oslc.pageSize=100">
<dcterms:title>Work Items</dcterms:title>
<oslc:totalCount>1</oslc:totalCount>
<rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo"/>
</rdf:Description>
</rdf:RDF>
Here we are getting only resolved by attribute value and not owned by attribute
Why these are giving different results.
Please help us if anything is missing from API client
Thanks
Accepted answer
I OSLC GET a work item with OSLC-Core_Version=2.0 and Accept=application/xml+rdf and there is no rtc_cm:ownedBy attribute. I looked into the resource shape and there is no either.
I found
<oslc:propertyDefinition rdf:resource="http://purl.org/dc/terms/contributor"/>
<oslc:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">contributor</oslc:name>
<dcterms:title rdf:parseType="Literal">Owned By</dcterms:title>
in the resource shape and
dcterms:contributor in the work item like
<dcterms:contributor rdf:resource="https://elm.example.com:3443/jts/users/bob"/>
One other answer
Using 7.0.2 iFix023 - AFAICT it's dcterms:creator rather than rtc_cm:owner, but rtc_cm:resolvedBy works.
So this query with headers as you use (querying just for a WI id of 2):
Returns:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" >
<rdf:Description rdf:about="https://jazz.ibm.com:9443/ccm/oslc/contexts/_GzoSIFEfEe2WNNAD5CjSHA/workitems">
<rdfs:member rdf:resource="https://jazz.ibm.com:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/2"/>
</rdf:Description>
<dcterms:title>Work Items</dcterms:title>
<oslc:totalCount>1</oslc:totalCount>
<rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo"/>
</rdf:Description>
<rdf:Description rdf:about="https://jazz.ibm.com:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/2">
<rdf:type rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">2</dcterms:identifier>
<rtc_cm:resolvedBy rdf:resource="https://jazz.ibm.com:9443/jts/users/unassigned"/>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/deb"/>
</rdf:Description>
</rdf:RDF>
Comments
1 vote
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 13 '23, 6:31 a.m.KT PD
Jul 13 '23, 8:15 a.m.