It's all about the answers!

Ask a question

DOORS OSLC API Query search "type of module"


HIROAKI JOSAKO (47429) | asked Jul 05 '21, 12:37 a.m.

I'm looking for a way to search for artifacts of type module.
I think I need to make the following properties searchable in order to define it as a module, but it doesn't work.
Is there a good way?

oslc.where=jazz_rm:artifactFormat="http://jazz.net/ns/rm/dng/type/format#Module"

or

oslc.where=rdf:type="http://jazz.net/ns/rm#Module"

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Jul 05 '21, 6:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 05 '21, 11:56 a.m.

 oslc.where=jazz_rm:artifactFormat="http://jazz.net/ns/rm/dng/type/format#Module"


This doesn't work because
1) the capitalisation of artifactFormat is wrong, should be ArtifactFormat 
2) the prefix jazz_rm (http://jazz.net/ns/rm#) isn't right for ArtifactFormat
3) URIs aren't strings - they MUST be surrounded by < >

This works for 7.0.2:
Where prefixes are:


oslc.where=rdf:type="http://jazz.net/ns/rm#Module"

This doesn't work because the URI isn't surrounded by < > 

This does work:


Don't forget the correct URL parameter encoding is needed for the strings on RHS of oslc.where= and oslc.prefix=

An example of a fully encoded query (this includes oslc.select so some additional prefixes are included)::
The GET has to be accompanied by required header:
  • OSLC-Core-Version: 2.0
and a configuration header such as:

HIROAKI JOSAKO selected this answer as the correct answer

Comments
HIROAKI JOSAKO commented Jul 06 '21, 4:12 a.m.

Thank you carefully.
It is embarrassing with the input mistake. .
PREFIX is set, so probably the case of upper case lower case letters and <> will be fine.

I'll try! !

One other answer



permanent link
David Honey (1.8k17) | answered Jul 05 '21, 5:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In OSLC query expressions, URIs should be enclosed in <>. They are not string literals. See OSLC Query 3.0 - oslc.where . Also, remember that parameter values should be URL encoded in the HTTP GET or POST.


Comments
HIROAKI JOSAKO commented Jul 06 '21, 4:10 a.m.

Using URL, set <> even in the case of parameter values! !
I did not know this rule.
Thank you very much.
I will fix it.

Encoding when executing a request command.

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.