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

Why am I getting Exception while executing OSLC properties query on DNG?

 When I try to execute oslc.properties query with a dcterm and a custom value, I am getting the below error

com.ibm.oslc.query.parser.select.ParseException: Invalid prefix definition: j.0
 
 
Please let me know how this can be fixed ASAP.

0 votes

Comments

I've never seen an OSLC Query for DNG based on something like your URL  https://localhost:9090/testserver/resources - was this retrieved from a query capability? Or where else did you get it from? Also what is j.0:sample as a URI - this has to be the URI of an attribute type definition. I'm not sure j.0 is valid as a prefix, try j0 or just j? And what headers are you sending with the GET? It's usually easiest to get your query working the first time by using a REST client like Postman - once it works then apply the same headers/parameters in your code.

   https://localhost:9090/testserver/resources - This is my server URL from where I am getting response using OSLC query.

In have my sample response as shown below

<dcterms:title rdf:parseType="Literal">Some Title</dcterms:title>

AFAICT https://localhost:9090/testserver/resources isn't a published OSLC query URL, i.e. it's not in a QueryCapability, so you're unlikely to get any sense out of it using OSLC Query parameters.



For more details about using OSLC with DOORS Next see https://jazz.net/library/article/1197

This is the most likely cause of the exception you're getting. To avoid the exception, use a published QueryCapability urls. 



2 answers

Permanent link

Are you URL encoding the values for the oslc.properties and oslc.prefix parameters?
URL encoding is required for these because they typically contain characters such as ":", "<", ">" etc.

0 votes

Comments

 I tried encoding as well, but if I encode, I am not getting the filtered results.

I am using oslc.properties just because I need only those values in the response specified in the query


Permanent link

You might try oslc.select instead of oslc.properties. As explained in OSLC Query 3.0 oslc.properties selects properties of the query result container itself, whereas oslc.select selects properties of each member of that container found by the query. For OSLC queries, you almost always want to use oslc.select. While most server implementations that implement OSLC query support oslc.select, many might not support oslc.properties.

0 votes

Comments

 I tried using OSLC select but it is not filtering selected values from the response, my query is like 

I would expect that to fail because:
  • The oslc.select value is not URL encoded and contains ":", and
  • The oslc.select value references the prefix "j.0" which is unlikely to have been defined by default and the URI does not define it using oslc.prefix. As a general principle, it's better to use a meaningful prefix name, and if it's not defined by default, specify oslc.prefix to define it. The known prefixes will be listed on the OSLC service provider using oslc:prefixDefinition. See section 5.2 of https://docs.oasis-open-projects.org/oslc-op/core/v3.0/ps01/discovery.html

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,935
× 7,494
× 1,324

Question asked: Dec 04 '20, 1:28 a.m.

Question was seen: 2,196 times

Last updated: Dec 07 '20, 8:59 a.m.

Confirmation Cancel Confirm