DNG OSLC Query or Rest API to get list of baselines from stream or artifact
Accepted answer
Hi Jyoti
I don't believe DOORS Next has an API for revisions, although there is a History option in the Reportable REST API I haven't explored what this can provide. See https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI
DOORS Next doesn't provide OSLC Query for configurations.
Expanding a previous answer of mine about how to find the configurations in a project see https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area
When retrieving a stream like
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:j.0="http://jazz.net/ns/rm/dng/config#"
xmlns:acc="http://open-services.net/ns/core/acc#"
xmlns:process="http://jazz.net/ns/process#">
<oslc_config:Configuration rdf:about="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw">
<oslc_config:previousBaseline rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_RkpaQCqeEeyWb76OEa4MVA"/>
<dcterms:description></dcterms:description>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/rm/oslc_rm/_4-Qq0Nd4EeqV5_5cfWW9rw/services.xml"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_OclNkdd5EeqV5_5cfWW9rw"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2020-08-06T00:10:24.92Z</dcterms:created>
<rdf:type rdf:resource="http://open-services.net/ns/config#Stream"/>
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<dcterms:identifier>_OdB5gNd5EeqV5_5cfWW9rw</dcterms:identifier>
<j.0:changesets rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw/changesets"/>
<dcterms:title rdf:parseType="Literal">SGC AMR Production stream</dcterms:title>
<oslc_config:baselines rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw/baselines"/>
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/rm/acclist#_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/rm/configSelections/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
</oslc_config:Configuration>
</rdf:RDF>
use the link in <oslc_config:baselines rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_SG-bsdd5EeqV5_5cfWW9rw/baselines"/>
The result when there are two previous baselines in the stream looks like this:
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:prov="http://www.w3.org/ns/prov#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:ldp="http://www.w3.org/ns/ldp#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:acc="http://open-services.net/ns/core/acc#"
xmlns:process="http://jazz.net/ns/process#">
<ldp:DirectContainer rdf:about="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw/baselines">
<rdfs:member>
<oslc_config:Configuration rdf:about="https://jazz.ibm.com:9443/rm/cm/baseline/_RkpaQCqeEeyWb76OEa4MVA">
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/rm/configSelections/baseline/_RkpaQCqeEeyWb76OEa4MVA"/>
<dcterms:description></dcterms:description>
<dcterms:title rdf:parseType="Literal">test1</dcterms:title>
<oslc_config:baselineOfStream rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/rm/oslc_rm/_4-Qq0Nd4EeqV5_5cfWW9rw/services.xml"/>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<rdf:type rdf:resource="http://open-services.net/ns/config#Baseline"/>
<dcterms:identifier>_RkpaQCqeEeyWb76OEa4MVA</dcterms:identifier>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_OclNkdd5EeqV5_5cfWW9rw"/>
<oslc_config:previousBaseline>
<oslc_config:Baseline rdf:about="https://jazz.ibm.com:9443/rm/cm/baseline/_aLlyY9d5EeqV5_5cfWW9rw">
<oslc_config:previousBaseline>
<oslc_config:Configuration rdf:about="https://jazz.ibm.com:9443/rm/cm/baseline/_R4EdBNd5EeqV5_5cfWW9rw">
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_OclNkdd5EeqV5_5cfWW9rw"/>
<dcterms:description></dcterms:description>
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/rm/configSelections/baseline/_R4EdBNd5EeqV5_5cfWW9rw"/>
<dcterms:identifier>_R4EdBNd5EeqV5_5cfWW9rw</dcterms:identifier>
<prov:wasDerivedFrom rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc_config:baselineOfStream rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<dcterms:title rdf:parseType="Literal">SGC AMR 1.0 Release</dcterms:title>
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/rm/acclist#_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:overrides rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<oslc_config:streams rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_R4EdBNd5EeqV5_5cfWW9rw/streams"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2020-08-06T00:10:47.888Z</dcterms:created>
<rdf:type rdf:resource="http://open-services.net/ns/config#Baseline"/>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/rm/oslc_rm/_4-Qq0Nd4EeqV5_5cfWW9rw/services.xml"/>
</oslc_config:Configuration>
</oslc_config:previousBaseline>
<dcterms:description></dcterms:description>
<dcterms:identifier>_aLlyY9d5EeqV5_5cfWW9rw</dcterms:identifier>
<oslc_config:baselineOfStream rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<dcterms:creator rdf:resource="https://jazz.ibm.com:9443/jts/users/ibm"/>
<dcterms:title rdf:parseType="Literal">SGC AMR 1.1 Release</dcterms:title>
<process:projectArea rdf:resource="https://jazz.ibm.com:9443/rm/process/project-areas/_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc:serviceProvider rdf:resource="https://jazz.ibm.com:9443/rm/oslc_rm/_4-Qq0Nd4EeqV5_5cfWW9rw/services.xml"/>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_OclNkdd5EeqV5_5cfWW9rw"/>
<oslc_config:selections rdf:resource="https://jazz.ibm.com:9443/rm/configSelections/baseline/_aLlyY9d5EeqV5_5cfWW9rw"/>
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/rm/acclist#_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc_config:streams rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_aLlyY9d5EeqV5_5cfWW9rw/streams"/>
<prov:wasDerivedFrom rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<rdf:type rdf:resource="http://open-services.net/ns/config#Configuration"/>
<oslc_config:overrides rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2020-08-06T00:11:43.622Z</dcterms:created>
</oslc_config:Baseline>
</oslc_config:previousBaseline>
<acc:accessContext rdf:resource="https://jazz.ibm.com:9443/rm/acclist#_4-Qq0Nd4EeqV5_5cfWW9rw"/>
<oslc_config:streams rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_RkpaQCqeEeyWb76OEa4MVA/streams"/>
<oslc_config:overrides rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
<oslc_config:acceptedBy rdf:resource="http://open-services.net/ns/config#Configuration"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2021-10-11T14:19:41.428Z</dcterms:created>
<prov:wasDerivedFrom rdf:resource="https://jazz.ibm.com:9443/rm/cm/stream/_OdB5gNd5EeqV5_5cfWW9rw"/>
</oslc_config:Configuration>
</rdfs:member>
<rdfs:member rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_aLlyY9d5EeqV5_5cfWW9rw"/>
<rdfs:member rdf:resource="https://jazz.ibm.com:9443/rm/cm/baseline/_R4EdBNd5EeqV5_5cfWW9rw"/>
</ldp:DirectContainer>
</rdf:RDF>
One other answer
You should be able to get the latest baseline created from a stream using the
oslc_config:latestBaseline
property of the stream. See the OSLC Configuration Management Version 1.0 specification. If earlier baselines of that stream were created, you should be able to traverse through each baseline's
prov:wasRevisionOf
property. It may also be possible to use an OSLC query on configurations with an oslc.where that includes
oslc_config:baselineOfStream
property. Whether that specific query is supported is application dependent, but feel free to try it using Poster/RESTED or other browser plugin.
Best regards,
David