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

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

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="

0 votes



5 answers

Permanent link
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

1 vote


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

0 votes

Comments

Could you attach the query your are using?

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?


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


Permanent link
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=*

0 votes


Permanent link
 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?



0 votes

Comments

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

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,942

Question asked: Oct 10 '12, 8:45 a.m.

Question was seen: 6,676 times

Last updated: Mar 23 '16, 3:43 p.m.

Confirmation Cancel Confirm