Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to generate a report for getting all the configuration that contain a specific data?

 What user is looking for is a method by which configurations related to a specific data to be retrieved. Let’s say given an artifact id / artifact type, they want to know which all configurations (streams and baselines) of a specific project has that data within.


   
A report that will have the following details
  • Project area name / URL
  • Component name / URL
  • Configuration name / URL
  • Specified Data

I tried to use a SPARQL which was shared few years back by IBM to get the information of a specific artifact type, but not able to customise that to get the column for configuration details. Can some help in adding a column that will also give the configuration name / URL as well in addition to the project name and component name?

NOTE: I tried to submit a PMR with IBM to get help on this and they confirmed it is out of scope for support and suggested to submit a post in Forum.

SPARQL used: 
 PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX merge: <http://jazz.net/ns/lqe/merge/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX oslc: <http://open-services.net/ns/core#>
PREFIX oslc_config: <http://open-services.net/ns/config#>
PREFIX process: <http://jazz.net/ns/process#>
SELECT DISTINCT ?uri ?project ?component ?title
WHERE {
?uri rdf:type oslc:ResourceShape .
?uri merge:mergeShape ?mergedShapeUri.
FILTER(contains(str(?mergedShapeUri), "Requirement"))
?uri dcterms:title ?title.
?uri oslc_config:component ?component.
?uri oslc:serviceProvider ?provider.
?provider oslc:details ?projectUri .
?projectUri rdf:type process:ProjectArea.
?projectUri dcterms:title ?project.
}
ORDER BY ?project


-   

0 votes

Comments

 Can someone help here please?



2 answers

Permanent link

 Look at the OSLC Configuration Management specification at https://tools.oasis-open.org/version-control/browse/wsvn/oslc-core/trunk/specs/config/oslc-config-mgt.html for the RDF you need to write the query.


To find all uses of some version of one or more resources, you would need SPARQL similar to that below. Note that the values for ?v need to be version resource URIs, not concept resource URIs, and that you need to run this query against the all data endpoint, not in the scope of any configuration. Configurations themselves are not in the scope of a configuration.


PREFIX oslc_config: <http://open-services.net/ns/config#>
PREFIX dcterms:     <http://purl.org/dc/terms/>

SELECT DISTINCT ?artifactTitle ?componentTitle ?gstreamTitle
WHERE
{
   # Include this part to get the component and title for the version resource
   ?v dcterms:isVersionOf ?concept .
   graph ?v
   {
    ?concept oslc_config:component ?component ;
            dcterms:title ?artifactTitle .
   }
   ?component dcterms:title ?componentTitle .

   # Find all local streams that select one of the given version resources
   ?lc oslc_config:selections/oslc_config:selects ?v ;
      a oslc_config:Stream .

   #  Find all global streams that have the above local streams as contributions (directly or indirectly)
   ?gc (oslc_config:contribution/oslc_config:configuration)* ?lc ;
      a oslc_config:Stream ;
      dcterms:title ?gstreamTitle .
}
VALUES ?v
{
    # Put the version resource URIs of the things you are looking for here, e.g.:
    <https://server:port/rm/versionedResources/_hTz9YMNWEeeDsvM8pel38g>
    #...
}

Nick.

0 votes

Comments

 Thanks Nick for the response. I tried to get the versioned resource URI of a testcase in RQM using REST API but could not get it. As RQM web links for artifacts do not expose the configuration link, I tried REST API and could not get the info there either.


Permanent link

If you use the OSLC API to GET an RQM resource in the context of some configuration, you will see the version resource URI in the response. You can also use OSLC query.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 7,489
× 481
× 73

Question asked: Oct 09 '18, 7:49 a.m.

Question was seen: 3,431 times

Last updated: Oct 15 '18, 5:19 p.m.

Confirmation Cancel Confirm