How to get Baseline Module Artifacts using OSLC
Pratyush Sharma (11●1)
| asked Aug 08 '23, 11:38 a.m.
edited Aug 15 '23, 4:06 a.m. by Ian Barnard (2.0k●6●13) Hello,
I wish to get all Module Artifacts for a Baseline, however when I try the approach of first getting the folders related to a baseline and then get the Artifacts related to those folders, I end up getting all the Module Artifacts for the Stream, not for that individual baseline,
Is there a method or function I can use to get all Module Artifacts related to a baseline using OSLC?
showing 5 of 9
show 4 more comments
|
One answer
Let me rephrase it, hopefully this clarifies my position
Lets say I have this baseline configuration URl
https://rtc-rm2-tpd.gm.com:XXXX/rm/cm/stream/_BOzHMDVWEe6Mk5WLfeaNHA
And I'm able to get the ResourceShape Service provider which returns this xml file https://rtc-rm2-tpd.gm.com:XXXX/rm/oslc_rm/_dSOn4M7fEeihvZ3ZnaL_3Q/services.xml
Which has this format
<?xml version="1.0" encoding="UTF-8"?> <oslc_rm:ServiceDescriptor xmlns:oslc_rm="http://open-services.net/xmlns/rm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="https://rtc-rm2-tpd.gm.com:XXXX/rm/oslc_rm/_dSOn4M7fEeihvZ3ZnaL_3Q/services.xml"> <oslc_rm:links> <oslc_rm:LinkCreationServices> <oslc_rm:validatedByLinkFactory rdf:resource="https://rtc-rm2-tpd.gm.com:XXXX/rm/links/oslc/validatedByLinks"/> <oslc_rm:implementedByLinkFactory rdf:resource="https://rtc-rm2-tpd.gm.com:XXXX/rm/links/oslc/implementedByLinks"/> </oslc_rm:LinkCreationServices> </oslc_rm:links> <oslc_rm:collections> <oslc_rm:CollectionSelectionDialog> <oslc_rm:heightHint>550px</oslc_rm:heightHint> <oslc_rm:widthHint>800px</oslc_rm:widthHint> <oslc_rm:widget rdf:resource="https://rtc-rm2-tpd.gm.com:XXXX/rm/pickers/com.ibm.rdm.web.CollectionPicker?projectURL=https%3A%2F%2Frtc-rm2-tpd.gm.com%3AXXXX%2Frm%2Frm-projects%2F_dSOn4M7fEeihvZ3ZnaL_3Q"/> <dc:title xmlns:dc="http://purl.org/dc/terms/">Collection Selection</dc:title> </oslc_rm:CollectionSelectionDialog> </oslc_rm:collections> <oslc_rm:requirements> <oslc_rm:SelectionDialog> <oslc_rm:heightHint>550px</oslc_rm:heightHint> <oslc_rm:widthHint>800px</oslc_rm:widthHint> <oslc_rm:widget rdf:resource="https://rtc-rm2-tpd.gm.com:XXXX/rm/pickers/com.ibm.rdm.web.RRCPicker?projectURL=https%3A%2F%2Frtc-rm2-tpd.gm.com%3AXXXX%2Frm%2Frm-projects%2F_dSOn4M7fEeihvZ3ZnaL_3Q"/> <dc:title xmlns:dc="http://purl.org/dc/terms/">Requirement Selection</dc:title> </oslc_rm:SelectionDialog> </oslc_rm:requirements> <dc:description xmlns:dc="http://purl.org/dc/terms/">Service Descriptor for Project: ECS Sandbox Project (RM2)</dc:description> <dc:title xmlns:dc="http://purl.org/dc/terms/">ECS Sandbox Project (RM2)</dc:title> </oslc_rm:ServiceDescriptor>
What should be my next step to get Baseline artifacts? Comments Doesn't make any difference querying for things in a stream or a baseline - you just provide the configuration URL whatever it is.
Cant see any QueryCapability in the XML you show so don't know where you are. You need to use discovery to find the QueryCapability for requirements, see step-by-step here https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area
Make sure to always have headers OSLC-Core-Version: 2.0 and Accept: application/rdf+xml on every GET.
Then build an OSLC query URL preferably adding an additional parameter &oslc_config.context= and then the config URL suitable URL-encoded. This shouldn't have < > around it. Doing it this way means you can look at the URL to see the configuration you're querying in, as against having to look at a header.
Again use those two headers on the OSLC Query GET.
Decode the results...
The OSLC Query specification is here: http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/csprd03/part1-overview/oslc-core-v3.0-csprd03-part1-overview.html#bib-OSLCQuery3
|
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.
Comments
Are you specifying the baseline configuration URL when accessing the OSLC API? Also when accessing the OSLC APIs you must provide headre OSLC-Core-Version: 2.0 with every operation.
If you still need help provide the URL you are accessing complete with all parameters (you can XXX the hostname) and also list all the headers you're providing. And show the response body.
Hello,
However, after getting the Folder this response correlates to (the response is a ClientResponse object), we get the Folder that is related to the stream, not to the baseline itself (in other words, the folder has artifacts the baseline shouldn't have captured)
I posted my followup as an answer (even though its not an answer), due to character limit
This is some java code I'm unaware of so I can't help you with that. But the URL you're using looks like an OSLC Query because it has oslc.where, but the query in oslc.where for public_rm:parent=(a folder url) isn't correctly formatted, the URI MUST be surrounded by < > example below. Also there MUST be a definition of the prefix you've used public_rm in an oslc.prefix= statement
This is an OSLC Query for contents of a folder::
https://jazz.ibm.com:9443/rm/views?oslc.query=true&projectURL=https%3A//jazz.ibm.com%3A9443/rm/process/project-areas/_tg0CsFEhEe2d5dG-54qhbg&oslc.prefix=rm_nav%3D%3Chttp%3A//jazz.net/ns/rm/navigation%23%3E%2Cdcterms%3D%3Chttp%3A//purl.org/dc/terms/%3E&oslc.where=rm_nav%3Aparent%3D%3Chttps%3A//jazz.ibm.com%3A9443/rm/folders/FR_ttGLRVEhEe2d5dG-54qhbg%3E&oslc.select=dcterms%3Aidentifier%2Crm_nav%3Aparent
this has: oslc.where=rm_nav%3Aparent%3D%3Chttps%3A//jazz.ibm.com%3A9443/rm/folders/FR_ttGLRVEhEe2d5dG-54qhbg%3E
which URL-decoded is:
oslc.where=rm_nav:parent=<https://jazz.ibm.com:9443/rm/folders/FR_ttGLRVEhEe2d5dG-54qhbg>
I got a little stuck using this process and rephrased my question,
If the folder didn't exist in the stream when the baseline was taken then obviously you won't find it in the baseline; it simply won't be there. But you would discover this by trying to find it and failing - very fragile and poor style to hardcode a URL for a folder and then expect it to be there because it might not.