It's all about the answers!

Ask a question

OSLC API for values of custom attributes with RDF URI


0
1
Dan Leibovich (1314) | asked Dec 06 '16, 7:35 a.m.
edited Dec 06 '16, 7:43 a.m.
 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


permanent link
Donald Nong (14.5k414) | answered Dec 06 '16, 10:04 p.m.
edited Dec 06 '16, 10:04 p.m.
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?
Dan Leibovich selected this answer as the correct answer

Comments
Dan Leibovich commented Dec 07 '16, 3:16 a.m.

 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..



Dan Leibovich commented Dec 07 '16, 3:32 a.m.

 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


Donald Nong commented Dec 07 '16, 7:16 p.m.

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

One other answer



permanent link
Dominic Tulley (38114) | answered Dec 06 '16, 1:18 p.m.
Hi Dan,
I think you've probably found a defect here - the attribute value should be using the element tag based on the RDF-URI you have defined.  I suggest you raise a defect describing this problem.
thanks
Dominic

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.