How to get queryCapability's ResourceShape in Doors Next Generation ?
Hi,
in my company we are using Doors Next generation version 6.0.1 M2.
We want to get ResourseShape for our QueryCapability, but it is not returned.
I make call to:
Headers:
Accept: application/rdf+xml
GET: https://<ip>:<port>/rm/oslc_rm/_Agw1YEA_EeW9sdfabXRPPL/services.xml
And the result:
<oslc:queryCapability><oslc:QueryCapability><oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/><oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement"/><oslc:queryBase rdf:resource="<ip:port>/rm/views?oslc.query=true&projectURL=https%3A%2F%2F<ip>%3A<port>%2Frm%2Fprocess%2Fproject-areas%2F_Agw1YEA_EeW98vRsdfRPEQ"/><dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Query Capability</dcterms:title></oslc:QueryCapability>
As you can see oslc:queryBase URI is returned but there is not resourceShape for the QueryCapability? My question is why and how to get one?
One answer
I don't recall ever seeing "resourceShape" in the "queryCapability" returned by RDNG, and I believe it is not implemented that way. In other words, you cannot get it at all. According to OSLC-RM V2 specification, oslc:ResourceShape SHOULD (not MUST) be returned on oslc:QueryCapability. And it also says
I believe the reason behind it is that the query can return two types of resources - oslc_rm:Requirement and oslc_rm:RequirementCollection, and apparently they have different "shapes".
Where
oslc:ResourceShape
is not supported by the Query Capability, providers SHOULD use the following guidance to represent query results:
This is exactly what RDNG does.
- For RDF/XML and XML, use
rdf:Description
andrdfs:member
as defined by Core Specification Appendix B:Representations and Examples - RDF/XML Examples.
I believe the reason behind it is that the query can return two types of resources - oslc_rm:Requirement and oslc_rm:RequirementCollection, and apparently they have different "shapes".
Comments
OK. We use the sample DB for Water Meter Project from the workshop:
In Doors 9.5. in the QueryCapability there was resourceShape but in DoorsNG 6.0 with the same data the response was very different.
So now when I request the queryBase URL, the result contains as expected:
<oslc_rm:Requirement rdf:about="https://<ip>:<port>/rm/resources/-037a32e9aba74d6casd329a27f111b3"> <oslc_rm:RequirementCollection rdf:about="https://<ip>:<port>/rm/resources/_iLeAwUDUasd98vRabXRPEQ">And accessing the requirement I can see instanceShape of the requirement. Is it the right way to get the shape?