How to get the value of Owned by attribute using HTTP Client Query method(Custom Java implementation)?
Hi,
+"oslc.where=rtc_cm:type=%22com.ibm.team.workitem.workItemType.p6%22&oslc.select=dcterms:contributor,rtc_cm:filedAgainst";
Thanks.
Accepted answer
rtc_cm:ownedBy
is not defined as property.
rtc_cm:ownedBy
propery. Instead, the owner is represented by
dcterms:contributor
as per the OSLC Change Management specification - see https://docs.oasis-open-projects.org/oslc-op/cm/v3.0/os/change-mgt-shapes.html#changerequest.
<https://jazz.net/jazz/oslc/shapes/workitems/_yOoaIKY7Ee2RrPFw5xrdAg/property/owner>
a oslc:Property ;
oslc:allowedValues <https://jazz.net/jazz/oslc/shapes/workitems/_yOoaIKY7Ee2RrPFw5xrdAg/property/owner/allowedValues> ;
oslc:defaultValue <https://jazz.net/jts/users/unassigned> ;
oslc:name "contributor"^^<http://www.w3.org/2001/XMLSchema#string> ;
oslc:occurs oslc:Zero-or-one ;
oslc:propertyDefinition
dcterms:contributor ;
oslc:range <http://xmlns.com/foaf/0.1/Person> ;
oslc:readOnly "false"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
oslc:representation oslc:Either ;
oslc:valueType oslc:Resource ;
dcterms:title "Owned By"^^rdf:XMLLiteral .
dcterms:contributor
is the property for owner.
2 other answers
If you are using OSLC related REST services, such as OSLC query, you should use a supported RDF media type. OSLC and Linked Lifecycle data is about RDF. Data is interchanged using RDF serialization formats such a RDF/XML or Turtle. Commonly supported RDF media types include
application/rdf+xml
,
application/turtle
,
test/turtle
.See section 4.1.3 of https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/oslc-core.html#resourceShapes.
application/json
is not an RDF media type. While some ELM application REST services might support it, the JSON representation is not defined by OSLC. Clients doing so are likely to become dependent on proprietary and undocumented JSON representations. You can represent RDF as json using
JSON-LD
for which the media type is
application/ld+json
. However, few, if any, ELM REST services currently support that media type.
Lastly, 6.0.6.1 went end of service on 2022-10-31 and will no longer be remediated against security vulnerabilities. I highly recommend you upgrade to 7.0.2.
Comments
I would like to point out that we have gotten another question from this user, about the same or similar topics (OSLC, JSON, JAVA API) and answered pretty much already. The parser error is the same as before. You have also pointed out the issues already in your answer David.
Hi Ralph,
The Parser issue is already resolved. For other attributes like Planned for, filed against, we are getting the expected output but for only Owned by attribute it is giving this issue. But other attributes are working fine.
In the HTTP Client Query if I used dcterms:contributor as id in the query it is showing the above parser issue. But other attributes are working fine.
The Key [rtc_cm:ownedby] was not in the Map.
Thanks.
How? You seem to ignore the answers.