It's all about the answers!

Ask a question

How do I fetch all requirements for a folder with OSLC?


Cecilia Lindgren (431213) | asked Oct 10 '12, 8:45 a.m.

Hi,

I want to fetch all requirements that exists in a folder using OSLC and tried it by using the RESTClient.

I have added &oslc.prefix=nav=<http://jazz.net/ns/rm/navigation#>&nav:parent="

5 answers



permanent link
Gabriel Ruelas (1.1k13) | answered Oct 10 '12, 9:52 a.m.
Hi,

Try following query :
" &oslc.prefix=nav=<http://com.ibm.rdm/navigation%23>&oslc.select=*&oslc.where=nav:parent=<YOUR_FOLDER_URL> "

Where your folder URL may looks like : "https://grarrc.ibm.com:9443/rm/folders/_RHCJYN5jEeGb6IIbvOh9Dw"
NOTE: On the query does not use the beginning and ending " chars

permanent link
Cecilia Lindgren (431213) | answered Oct 11 '12, 8:25 a.m.
Hi,

Sorry, but that did not help.

So now I wonder if someone can tell me which is the best way to getting all the requirements in a folder using OSLC?
I got the folder name and are able to retrieve the uri to the folder.

Comments
Gabriel Ruelas commented Oct 11 '12, 9:51 a.m.

Could you attach the query your are using?


Cecilia Lindgren commented Oct 11 '12, 10:12 a.m.

https://server:9443/rm/views?oslc.query=true&amp;projectURL=https%3A%2F%2Fserver%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_xdjJsP2cEeGoOoZWLhSJmQ&oslc.prefix=nav=<http://jazz.net/ns/rm/navigation#>&oslc.where=nav:parent=https://server:9443/rm/folders/_-0W0x_5KEeGoOoZWLhSJmQ&oslc.select=*

the value of the nav prefix is fetched from the response.

What is the best way to fetch the requirements for a folder?
From query base for requirements, from query base for folders or something complete different?
Am I missing any headers in my request?



Rosa Naranjo commented Nov 20 '12, 11:09 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Cecilia Lindgren commented Nov 21 '12, 6:48 a.m.

Good article, but it does not solve the issue about fetching requirements for a spcific folder.


permanent link
Clyde Icuspit (1) | answered Oct 18 '12, 8:18 p.m.
Hi Cecilia,

I encoded the # character in the nav ns using UTF-8 and removed the amp after &. Can you please try this:

https://server:9443/rm/views?oslc.query=true&projectURL=https%3A%2F%2Fserver%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_xdjJsP2cEeGoOoZWLhSJmQ&oslc.prefix=nav=<http://jazz.net/ns/rm/navigation%23>&oslc.where=nav:parent=https://server:9443/rm/folders/_-0W0x_5KEeGoOoZWLhSJmQ&oslc.select=*

permanent link
Michael Fiedler (9113) | answered Nov 19 '12, 1:08 p.m.
JAZZ DEVELOPER
edited Nov 19 '12, 1:10 p.m.
 After attempting several variations I was (mostly) able to do this.   The root problem is that I could find no way to get RRC 4.0.1 to accept an oslc.prefix that used the <http://jazz.net/ns/rm/navigation#> namespace.   I think there is a bug here, but wanted to see if anyone sees a better solution.

First,  I am putting all URLs/query strings un-encoded in this post for readability in these examples.  In reality I was encoding them correctly.

1.  Do a GET on a Requirement with OSLC-Core-Version=2.0 and Accept = application/rdf+xml.   In part it returns:
snip...
xmlns:nav="http://jazz.net/ns/rm/navigation#"
...snip 
<nav:parent rdf:resource="https://server:9443/rm/folders/_jJkdxjJVEeKUCMIZfXk1OA"/>
2. I want to do a query for all requirements in that same folder. This query (properly encoded), does not work
oslc.prefix=nav=<http://jazz.net/ns/rm/navigation#>&oslc.where=nav:parent=<https://server:9443/rm/folders/_jJkdxjJVEeKUCMIZfXk1OA>
There is a SPARQL error and the namespace is not properly escaped with &lt; &gt; in the SPARQL in the RRC log.
3. This query DOES work (note the namespace which does not match the one on the GET in step 1):
oslc.prefix=nav=<http://com.ibm.rdm/navigation#>&oslc.where=nav:parent=<https://server:9443/rm/folders/_jJkdxjJVEeKUCMIZfXk1OA>
This looks like a "legacy" RRC namespace.
The nav namespace on the original GET should be the one I can use on the query, but in this case I could only get it working using the "alternate" namespace. Does anyone have a better approach?




Comments
Gabriel Ruelas commented Nov 20 '12, 9:34 a.m.

Hi Mike,
It seems to be an issue in 4.0.1 I have opened a wi to fix that. As you mentioned, the workaround is to use the old namespace.


permanent link
Krzysztof Gemser (1036) | answered Mar 23 '16, 3:30 p.m.
edited Mar 23 '16, 3:43 p.m.
Hi, i know that this is a very old question, but i have the same problem with this query. 
I tried to use both namespaces, but none of them works. 
I use the RM in version 5.0.2.
My sample queries (i encode them, because when i  paste the address, format was not readable. Please to read use something to decode, for example this page)

https%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Fviews%3Foslc.query%3Dtrue%26projectURL%3Dhttps%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_lSxTMu7LEeW7ncSEDSVoCA%26oslc.prefix%3Dnav%3D%3Chttp%3A%2F%2Fjazz.net%2Fns%2Frm%2Fnavigation%23%3E%26oslc.where%3Dnav%3Aparent%3D%3Chttps%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Ffolders%2F_7oeNsfDrEeW7ncSEDSVoCA%3E


https%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Fviews%3Foslc.query%3Dtrue%26projectURL%3Dhttps%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_lSxTMu7LEeW7ncSEDSVoCA%26oslc.prefix%3Dnav%3D%3Chttp%3A%2F%2Fcom.ibm.rdm%2Fnavigation%23%3E%26oslc.where%3Dnav%3Aparent%3D%3Chttps%3A%2F%2F%5Bserwer%5D%3A9443%2Frm%2Ffolders%2F_7oeNsfDrEeW7ncSEDSVoCA%3E


My goal is to display all requirements that are located in the specified folder. Is something has changed between versions 4.0.1 and 6.0.1 with regard to this topic ?

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.