[closed] RQM OSLC Query or Rest API to get latest baselines from stream
The question has been closed for the following reason: "Other" by davidhoney Mar 20 '23, 1:10 p.m.
2 answers
For any stream, its
oslc_config:previousBaseline
property should reference the latest baseline that was created from that stream. See Resource shape for Stream in OSLC Configuration Management 1.0.
Hi Jyoti
I guess this is related to your similar question about finding configurations in DOORS Next https://jazz.net/forum/questions/277352/dng-oslc-query-or-rest-api-to-get-list-of-baselines-from-stream-or-artifact
The ETM (RQM) application, at least in 7.x (not sure about 6.x) provides OLSC Query capability for configurations. This isn't a project-specific query, and the project area is included in the results which you'll have to filter on.
To find this on the application level:
Use headers:
* Accept: application/rdf+xml
* OSLC-Core-Version: 2.0
1. GET /qm/rootservices
Find:
<oslc_config:cmServiceProviders
xmlns:oslc_config="http://open-services.net/ns/config#"
rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/catalog" />
2. GET (always use the URL from rootservices) https://jazz.ibm.com:9443/qm/oslc_config/catalog
Find the tag containing a rdf:type with attribute rdf:resource="http://open-services.net/ns/core#QueryCapability"
<rdf:Description rdf:nodeID="A18">
<oslc:resourceType rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc:queryBase rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration"/>
<oslc:resourceShape rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resourceShapes/com.ibm.team.vvc.Configuration"/>
<dcterms:title rdf:parseType="Literal">Default query capability for Configuration</dcterms:title>
<rdf:type rdf:resource="http://open-services.net/ns/core#QueryCapability"/>
</rdf:Description>
The OSLC Query base url in oslc:queryBase attribute rdf:resource. Always use the value retrieved, i.e. don't hardcode it.
A simple query on that capability - i.e. no oslc.where or oslc.select) will return all configurations with many properties - you probably want to filter for the project area, that should be oslc.where=process:projectArea=<yourprojectareauri> although I haven't tried it. I was able to get only baselines by using oslc.where=oslc_config:mutable="false"^^xsd:boolean (properly encoded, of course).
The query result without any oslc.select is like this (from 7.0.1) for a baseline (oslc_config:mutable is false):
<rdf:Description rdf:about="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_XtGEwNd7EeqhD9rw3oe_og">
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc_config:mutable rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_config:mutable>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:25:45.996Z</dcterms:created>
<oslc_config:committed rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:25:45.996Z</oslc_config:committed>
<dcterms:title rdf:parseType="Literal">SGC Agile 1.0 Release</dcterms:title>
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/qm/acclist#_8UPIIdd4EeqhD9rw3oe_og"/>
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_XtGEwNd7EeqhD9rw3oe_og/selections"/>
<oslc:instanceShape rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resourceShapes/baseline"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Component/_qqKoMNd6EeqhD9rw3oe_og"/>
<prov:wasDerivedFrom rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_qqnUINd6EeqhD9rw3oe_og"/>
<oslc_config:streams rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_XtGEwNd7EeqhD9rw3oe_og/streams"/>
<dcterms:relation rdf:resource="https://jazz.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_8UPIIdd4EeqhD9rw3oe_og/baseline/_XtGEwNd7EeqhD9rw3oe_og"/>
<oslc:modifiedBy rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<oslc_config:baselineOfStream rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_qqnUINd6EeqhD9rw3oe_og"/>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/qm/process/project-areas/_8UPIIdd4EeqhD9rw3oe_og"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:25:45.996Z</dcterms:modified>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/serviceProviders/configuration"/>
<dcterms:identifier>_XtGEwNd7EeqhD9rw3oe_og</dcterms:identifier>
<rdf:type rdf:resource="http://open-services.net/ns/config#Configuration"/>
<rdf:type rdf:resource="http://open-services.net/ns/config#Baseline"/>
</rdf:Description>
Here's an example of a stream from the query results (don't think this is related to above baseline) which has the oslc_config:previousBaseline that @david mentions.
<rdf:Description rdf:about="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_kqCcUdd7EeqhD9rw3oe_og">
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/qm/acclist#_8UPIIdd4EeqhD9rw3oe_og"/>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/qm/process/project-areas/_8UPIIdd4EeqhD9rw3oe_og"/>
<oslc_config:baselineOfStream rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_9jXNsNd4EeqhD9rw3oe_og"/>
<dcterms:title rdf:parseType="Literal">SGC MTM 1.1 Release</dcterms:title>
<oslc_config:streams rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_kqCcUdd7EeqhD9rw3oe_og/streams"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:27:12.917Z</dcterms:modified>
<oslc:modifiedBy rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<rdf:type rdf:resource="http://open-services.net/ns/config#Baseline"/>
<oslc_config:mutable rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_config:mutable>
<oslc_config:committed rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:27:12.917Z</oslc_config:committed>
<oslc_config:previousBaseline rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_XrdGAdd7EeqhD9rw3oe_og"/>
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_kqCcUdd7EeqhD9rw3oe_og/selections"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/serviceProviders/configuration"/>
<dcterms:identifier>_kqCcUdd7EeqhD9rw3oe_og</dcterms:identifier>
<dcterms:relation rdf:resource="https://jazz.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_8UPIIdd4EeqhD9rw3oe_og/baseline/_kqCcUdd7EeqhD9rw3oe_og"/>
<rdf:type rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Component/_9jgXoNd4EeqhD9rw3oe_og"/>
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-08-06T00:27:12.917Z</dcterms:created>
<prov:wasDerivedFrom rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_9jXNsNd4EeqhD9rw3oe_og"/>
<oslc:instanceShape rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resourceShapes/baseline"/>
</rdf:Description>
FYI the EWM app also provides component query capability.
HTH
Ian
Comments
@Ian Barnard
Hello. Do you know what rights should the user have in order to access the query capability that gets configurations? This one more precisely.
<oslc:queryBase rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration"/>
I am hoping for a quick answer. Thank you,
Catalin
Please ask your own question instead of writing a question in an answer to a question of someone else. Thanks.
1 vote
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 12 '21, 12:07 p.m.I understand what you mean by the latest baseline of a stream. Why do you have in mind by "latest baseline based on Artifact ID"? An Artifact does not have a "latest baseline" (an artifact can appear in multiple streams, and each stream could have a different "latest" version of that artifact ... the latest based purely on date stamp is not an interesting version, unless that artifact happens to only exist in a single stream).