OSLC API for values of custom attributes with RDF URI
Hello,
I am using DOORS NG 6.0.2
I would like to use the OSLC Rest API to get attribute values for custom attributes.
I am using the resource shape to find the details of the attributes.
For custom attributes which I did not set "RDF URI" I get something like:
<oslc:property> <oslc:Property> <oslc:name>_JiJg8aZfEeawLZF4r8p6_Q</oslc:name> <dcterms:title rdf:parseType="Literal">UDA2</dcterms:title> <dcterms:description rdf:parseType="Literal"></dcterms:description> <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/> <oslc:propertyDefinition rdf:resource="https://vlnx488:9443/rm/types/_JiJg8aZfEeawLZF4r8p6_Q"/> <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> </oslc:Property> </oslc:property>I can use the oslc:name to find the attribute value in the response I get from my query:
<oslc_rm:Requirement rdf:about="https://vlnx488:9443/rm/resources/_85e358db6bb94d92b8a9d7fdd707bd25"> ... <rt:_JiJg8aZfEeawLZF4r8p6_Q>bbb</rt:_JiJg8aZfEeawLZF4r8p6_Q>
The probelm is when I have attributes which "RDF URI" was set I get from the resource shape something like:
<oslc:property> <oslc:Property> <oslc:name>xyz</oslc:name> <dcterms:title rdf:parseType="Literal">UDA1</dcterms:title> <dcterms:description rdf:parseType="Literal"></dcterms:description> <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/> <oslc:propertyDefinition rdf:resource="https://www.example.com/abc/xyz"/> <oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#string"/> </oslc:Property> </oslc:property>But, in the resopnse I get from the query the attribute value is with this generated attribute name like:
<oslc_rm:Requirement rdf:about="https://vlnx488:9443/rm/resources/_85e358db6bb94d92b8a9d7fdd707bd25"> ... <rt:_HA8IcaZfEeawLZF4r8p6_Q>aaaxxx</rt:_HA8IcaZfEeawLZF4r8p6_Q>
So, my question is how can I find the value of a custom attribute which was definef with "RDF URI", from where should I get this "rt:_HA8IcaZfEeawLZF4r8p6_Q" name.
Thanks
Dan Leibovich
Accepted answer
I have got a result slightly different from yours, and it appears to be working as it should. Also, you should not need to consult the Resource Shape either.
I've set up an attribute named "Forum" with the RDF URI "http://mycompany.com/rm/forum". Then when I retrieve the XML presentation of a requirement containing such attribute, I can see the name space 'xmlns:j.0="http://mycompany.com/rm/"' specified, and the attribute as < j.0:forum rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >forum question< /j.0:forum >. Basically, you should be able to get the attribute by using the RDF URI that you have specified. Is it what you're looking for?
I've set up an attribute named "Forum" with the RDF URI "http://mycompany.com/rm/forum". Then when I retrieve the XML presentation of a requirement containing such attribute, I can see the name space 'xmlns:j.0="http://mycompany.com/rm/"' specified, and the attribute as < j.0:forum rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >forum question< /j.0:forum >. Basically, you should be able to get the attribute by using the RDF URI that you have specified. Is it what you're looking for?
Comments
Hi,
Thank you for your answer.
I got the XML I pasted above in the response to the query capability service. If I take the "rdf:about" url and GET it I do get the expected tag (j.0:xyz).
Unfortunately I can not use the url I got from the "rdf:about" because the values I get when using it are from the default "initial stream". I want to get value of this attribute under a specific configuration. So far I was able to see the correct value only when using query capability (while appending vvc.configuration=...), unfortunately the when I do get the correct value the xml tag name is wrong..
Ok, I found that I can append vvc.configuration also the the resource url and get the expected value. So my issue is resolved.
However, the value I got from the query capability service is wrong, seems to me like a defect.
Thanks
Umh...if you use a GCM-enabled project area, you should get the "vvc.configuration" parameter in the query capability service URL. Are you seeing the issue same as the below one?
https://jazz.net/forum/questions/231472/what-is-causing-a-propagated-exception-when-i-do-an-http-on-the-query-base-of-doors-next-generation