It's all about the answers!

Ask a question

RRC v4.0.5 and oslc query


nicolas teulier (621712) | asked Feb 23 '14, 9:33 p.m.
 Hi,

I've been through the OSLC workshop (https://jazz.net/library/article/635) on RRC v4.0.1 and devloped a java application to extract requirements without any problem.

I've just upgraded one of our test servers to RRC v4.0.5 and neither my application nor the workshop are working.

In the workshop, there's a sample query to retrieve all the requirements for a given project.
My project code is "PRJ_CODE" and let's assume my server name is MYSERVER.

Then, the URL provided in the workshop is:
https://MYSERVER/rm/views?oslc.query=true&projectURL=https%3A%2F%2FMYSERVER%2Fjts%2Fprocess%2Fproject-areas%2FPRJ_CODE&oslc.prefix=rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns%23>,dcterms=<http://purl.org/dc/terms/>&oslc.select=*&oslc.where=rdf:type=<http://openservices.net/ns/rm%23Requirement>

This query was working properly on v4.0.1 but not anymore on v4.0.5.
In my request headers, I have the following options:
Accept:application/xml
OSLC-Core-Version:2.0

Response is an error 500.
See images for header/body reponse.
error response header


error response body

And here's the server error log (I've truncated part of the message. If complete sequence call is needed, let me know!):
Error: Entry [ca2df761e87bee6d]
java.lang.RuntimeException: Error when converting:
oslc.query=true&
oslc.prefix=rdf&
oslc.select=*&
oslc.where=rdf:type=<http://openservices.net/ns/rm#Requirement>
com.ibm.oslc.query.parser.select.ParseException: Invalid prefix definition: rdf
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.convert(OslcQueryToRql.java:112)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.<init>(OslcQueryToRql.java:49)
at com.ibm.rdm.fronting.server.rrs.views.OslcViewExecutionRequest.createViewFromOslcQuery(OslcViewExecutionRequest.java:133)
.....
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)
Caused by: com.ibm.oslc.query.parser.select.ParseException: Invalid prefix definition: rdf
at com.ibm.oslc.query.parser.prefix.OslcPrefixParser.parsePrefixDefinition(OslcPrefixParser.java:36)
at com.ibm.oslc.query.parser.prefix.OslcPrefixParser.parse(OslcPrefixParser.java:26)
at com.ibm.oslc.query.parser.CustomOslcParser.select(CustomOslcParser.java:31)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.invokePrefixParser(OslcQueryToRql.java:119)
at com.ibm.rdm.oslc.query.rql.OslcQueryToRql.convert(OslcQueryToRql.java:73)
... 59 more

How can I fix this problem?

Thank you.
Nico

Accepted answer


permanent link
Gabriel Ruelas (1.1k13) | answered Feb 24 '14, 7:21 a.m.
Hi,
Pls try using an oslc.prefix entry for each namespace definition like :
&olsc.prefix=<dcterms....>&oslc.prefix=<other prefix.....>
   
nicolas teulier selected this answer as the correct answer

3 other answers



permanent link
nicolas teulier (621712) | answered Feb 24 '14, 7:44 p.m.
It's working now! thank you.
Now let's try to fix the other queries returning errors!

permanent link
Venkatesh Nadamuni (135) | answered Dec 02 '18, 7:31 p.m.

I tried using and oslc.prefix for each ns definition 


This ignored the DCterms and selected all the uses (~over 6K rows)!!!!



permanent link
Cedric Marin (111) | answered Jan 29, 11:18 a.m.
edited Jan 29, 12:00 p.m.
@Venkatesh Nadamuni :  I had the same problem, it was caused by forgotting to escape "#" to '%23', it causes the remaining of the request being ignored.

Some hints from my experience with DOORS NG 6.0.5:

Your answer


Register or to post your answer.