OSLC Query: Artifacts with a specific type [BASE ARTIFACTS ONLY]
Hi All
With following the Query I am able to get the Artifact Type T - Requirement in a specific Project:
string QueryURL = "https://jazz.xxx.com/rm/views?oslc.query=true" + "&projectURL=https://jazz.xxx.com/rm/process/project-areas/" + selectedProject.itemId + "&oslc.prefix=rm=<http://www.ibm.com/xmlns/rdm/rdf/>" + "&oslc.select=*&oslc.where=rm:ofType=<https://jazz.xxx.com/rm/types/OT_Hwvzh3hLEeyCz8SUQBPl2w>";
The catch is that I am getting ALL Artifacts of the type T - Rquirements Base Artifacts and Module Artifacts
I am only interested in the base Artifacts...
I am wondering if its possible to get this constraint (Base Artifacts ONLY) with one Query.
As work around I'd probably do the query against all Base Artifacts folder...
Any help or suggestion is highly appreciated
Philipp
Accepted answer
Hi Philipp
OSLC Query doesn't currently have the ability to eliminate or exclude based on presence or absence of a property value, and the difference between a module binding of an artifact (i.e. reuse) and the core artifact is that the core artifact has a rm_nav:parent property which is the URI of the folder where the artifact is held. Bindings don't have this.
So AFAIK it's not possible to get only base artifacts in a query for a specific artifact type - the workaround is to add rm_nav:parent to the oslc.select in the query and then post-filter the results excluding any artifact without a value for rm_nav:parent, i.e. filtering out module bindings.
HTH
Ian
Comments
1 vote
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 08 '22, 5:10 a.m.1 vote
Philipp Thomann
Nov 08 '22, 6:36 a.m.