It's all about the answers!

Ask a question

OSLC DOORS/DWA get Requirement by URL


Julian Hemm (58416) | asked Mar 21 '17, 11:53 a.m.

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!

Accepted answer


permanent link
Jean-Luc Johnson (8125) | answered Mar 22 '17, 9:01 a.m.
edited Mar 22 '17, 9:05 a.m.

 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

4 other answers



permanent link
Julian Hemm (58416) | answered Mar 22 '17, 2:22 p.m.

Hi all,

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


permanent link
Gabriel Ruelas (1.1k13) | answered Mar 21 '17, 12:25 p.m.

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


Comments
Julian Hemm commented Mar 21 '17, 12:50 p.m.

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



Donald Nong commented Mar 21 '17, 8:38 p.m.

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
Jean-Luc Johnson (8125) | answered Mar 22 '17, 5:25 a.m.

 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)?



Comments
Julian Hemm commented Mar 22 '17, 8:03 a.m.

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
Jean-Luc Johnson (8125) | answered Mar 22 '17, 2:29 p.m.

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

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.