It's all about the answers!

Ask a question

Advise to Query Requirement in RM-Project (part of a Global Configuration)


magnus Elfving (347) | asked Mar 29 '21, 10:09 a.m.
Hi,

I am querying (for the first time) a RM-project for attribute data, according to the Query shown below.<o:p></o:p>

The RM-project is part of a global configuration with three requirement components.

I have tried numerous variants of the query, but I always receive an empty response, see Response below

Furthermore, I receive attribute data when I sending a GET HttpRequest with the URI of the requirement.

I have read the examples in “https://jazz.net/library/article/635” and found the start-up information as follows:<o:p></o:p>

·       Catalog Entry:<o:p></o:p>

o   https://x1.x2.x3.x4/rm/oslc_rm/catalog/<o:p></o:p>

·       Service Provider:<o:p></o:p>

o   https:// x1.x2.x3.x4/rm/oslc_rm/_u9BacHJ7EeuYaNFaR904Vg/services.xml<o:p></o:p>

·       Query Capability:<o:p></o:p>

o   https://x1.x2.x3.x4/rm/views?oslc.query=true&projectURL=https%3A%2F% x1.x2.x3.x4%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg

Can anyone advise me to be able to properly connect and query the RM-project?

Regards 

Magnus 

Headers:<o:p></o:p>

   OSLC-Core-Version: 2.0<o:p></o:p>

   Accept: application/rdf+xml

Query:<o:p></o:p>

https://x1.x2.x3.x4/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fx1.x2.x3.x4%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3Eoslc.select=dcterms%3Atitleoslc.where=dcterms%3Aidentifier%3D13289

Response: <o:p></o:p>

<?xml version="1.0"?>

-<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" <o:p></o:p>

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" <o:p></o:p>

xmlns:dcterms="http://purl.org/dc/terms/" <o:p></o:p>

xmlns:oslc_rm="http://open-services.net/ns/rm#" <o:p></o:p>

xmlns:oslc="http://open-services.net/ns/core#" <o:p></o:p>

xmlns:nav="http://jazz.net/ns/rm/navigation#" <o:p></o:p>

xmlns:jazz_rm="http://jazz.net/ns/rm#"><o:p></o:p>


-<oslc:ResponseInfo rdf:about="https://x1.x2.x3.x4/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fx.x.x.sx%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3Eoslc.select&dcterms%3Atitleoslc.where=dcterms%3Aidentifier%3D13289"><o:p></o:p>

 

<dcterms:title>Query Results</dcterms:title><o:p></o:p>

 

</oslc:ResponseInfo><o:p></o:p>

 

<rdf:Description rdf:about="https://x1.x2.x3.x4/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fx1.x2.x3.x4%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg"> </rdf:Description><o:p></o:p>

 

</rdf:RDF> 

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Apr 06 '21, 5:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 07 '21, 9:32 a.m.

Hi


In your query URL the HTTP query string parameters aren't specified correctly. I think the reference for this is https://tools.ietf.org/html/rfc3986#section-3.4

You have:
Which split into URL (the bit before the ?) and query parameters (first parameter is at the ?, subsequent parameters all must start with &) is:

?oslc.query=true
&projectURL=https%3A%2F%2Fx1.x2.x3.x4%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg
&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3Eoslc.select=dcterms%3Atitleoslc.where=dcterms%3Aidentifier%3D13289

Removing the parameter value encoding this is:

You can see that the oslc.select and oslc.where parameters don't start with &

I'd expect this to look like:

?oslc.query=true
&oslc.prefix=dcterms=<http://purl.org/dc/terms/>
&oslc.select=dcterms:title
&oslc.where=dcterms:identifier=13289

When the parameter values are encoded these are:

?oslc.query=true
&projectURL=https%3A%2F%2Fx1.x2.x3.x4%2Frm%2Fprocess%2Fproject-areas%2F_u9BacHJ7EeuYaNFaR904Vg
&oslc.prefix=dcterms%3D%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E
&oslc.select=dcterms%3Atitle
&oslc.where=dcterms%3Aidentifier%3D13289

And reassembled into a URL the query URL should be:


ALSO you must provide the configuration URL using a header Configuration-Context on the GET, with the value of the config URL.

HTH
Ian

magnus Elfving selected this answer as the correct answer

Comments
magnus Elfving commented Apr 08 '21, 3:48 a.m.

Thanks Ian!


You are right,  I've got a  valid response from the server.

Regards 
Magnus
  

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.