Trying to get all modules in RM using OSLC query
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
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.prefix=rmTypes=<http://www.ibm.com/xmlns/rdm/types/>,dcterms=<http://purl.org/dc/terms/>,jazz_rm=<http://jazz.net/ns/rm#>
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