Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

OSLC DOORS/DWA get Requirement by URL

Hi,

I have a quite basic Use-Case.
I need to get the XML Representation of a Requirement and I want to find it by its link / urn:

e.g my input is: https://mydwa:myport/dwa/rm/urn:rational::1-5855s7436e7d0cbb-O-3-000000c0

Therefore I am using the Eclipse lyo and I am able to authenticate and to get Modules and so on.
Anyway I am still unable to get the correct endpoint for getting exactly this and only this Requirement.

Can somebody suggest how to do it with lyo or how the OSLC Endpoint must look like?

Thanks!

0 votes


Accepted answer

Permanent link

 If you already have the url of the requirement, next step, you perform a /GET on it  to pull its RDF document that will contain all its attributes. Find out more at  http://git.eclipse.org/c/lyo/org.eclipse.lyo.client.git/tree/org.eclipse.lyo.client.java.sample/src/main/java/org/eclipse/lyo/client/oslc/samples/DoorsOauthSample.java 


around STEP 12,  this instruction is performed 

ClientResponse getResponse = client.getResource(requirementURL,OslcMediaType.APPLICATION_RDF_XML);

You could then parse it to extract every single attribute. Or you can serialize it into an OSLC requirement object as well. 

Julian Hemm selected this answer as the correct answer

0 votes


4 other answers

Permanent link

Hi all,

thanks for you help. It works now.
System.setProperty(AbstractOslcRdfXmlProvider.OSLC4J_STRICT_DATATYPES, "false");
made the trick with the date parsing.

1 vote


Permanent link

 Have you seen https://jazz.net/library/article/1382 ?  It point to Eclipse Lyo samples which have one that talk to Doors 9...

0 votes

Comments

I have started with the lyo sample but I didnt find any example on how to query the requirement by its link.
I made it now by simply invoking a get on the URL and set the accept type to XML but now I face another Issue which I am not yet able to resolve when reading the Entity:

com.hp.hpl.jena.datatypes.DatatypeFormatException: Lexical form '2017-01-27' is not a legal instance of Datatype[http://www.w3.org/2001/XMLSchema#dateTime -> class com.hp.hpl.jena.datatypes.xsd.XSDDateTime] Lexical form '2017-01-27' is not a legal instance of Datatype[http://www.w3.org/2001/XMLSchema#dateTime -> class com.hp.hpl.jena.datatypes.xsd.XSDDateTime] during parse -org.apache.xerces.impl.dv.InvalidDatatypeValueException: cvc-datatype-valid.1.2.1: '2017-01-27' is not a valid value for 'dateTime'.

Thanks for your help


I'm not familiar DOORS/DWA but it appears to me that the content from DWA is not compatible with Lyo. Check the below web page for the correct/expected syntax of the dateTime string.
https://wiki.xmldation.com/Support/Validator/cvc-datatype-valid-1-2-1

I guess if you cannot configure DWA to return the desired format, you may have to "hack" the response before putting it through Lyo.


Permanent link

 Hello,

Your scenario is not clear. How your query could look like in natural language?
I guess you would like to select only the property URL where xxx (what)?


0 votes

Comments

Hi,

basically I got a DOORS Requirement URL.
I want to use lyo to get this Requirement from DWA using OSLC.
As I said, I was able to authenticate and to apply some filters on my query, but I did not yet find a way to simply retrieve the XML+RDF/XML Representation of the Requirement by its ID.

I need something like
"Give me all attributes of requirement where requirement.url = xxx:xxx/uri:xxxxx"


Permanent link

I am glad it works. Good luck with your integration challenges. I hope you will spread the word! 

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 516
× 139
× 27
× 25

Question asked: Mar 21 '17, 11:53 a.m.

Question was seen: 4,571 times

Last updated: Mar 22 '17, 2:29 p.m.

Confirmation Cancel Confirm