It's all about the answers!

Ask a question

Trying to get all modules in RM using OSLC query


Susanta Adhikary (111) | asked Aug 19 '19, 9:11 a.m.
edited Aug 19 '19, 9:15 a.m.
I am using the below query to get all the modules in RM

'oslc.query': 'true',
'projectURL': self.project_uri,
'oslc.prefix': 'rmTypes=<http://www.ibm.com/xmlns/rdm/types/>,dcterms=<http://purl.org/dc/terms/>',
'oslc.where': 'rmTypes:ArtifactFormat=<%s>' Module,

'oslc.select': 'dcterms:title'  

Is the query correct?
I wanted to get a particular Module by name. 
After getting all the modules I am iterating through .//rdfs:member/* and matching dcterms:title with the actual module name. It was working before something happened recently.

One answer



permanent link
Ian Barnard (1.3k613) | answered May 11, 5:21 a.m.
JAZZ DEVELOPER

Late response I know. These work in 7.0.2 but AFAIK should work in earlier versions too.


Your oslc.where should be:

oslc.where=rmTypes:ArtifactFormat=<http://jazz.net/ns/rm#Module>

Or (the exact same thing done using a prefix)::

oslc.where=rmTypes:ArtifactFormat=jazz_rm:Module

But rather than postprocessing you can make the query also look for a title, e.g.:

oslc.where=rmTypes:ArtifactFormat=jazz_rm:Module and dcterms:title="My Module Title"

or even match any of several titles:

oslc.where=rmTypes:ArtifactFormat=jazz_rm:Module and dcterms:title in ["My Module Title","My Other Module Title"]

Don't forget the oslc.where and oslc.select values must be encoded into the URL

HTH
Ian

Your answer


Register or to post your answer.