<div id="header-title" style="padding: 10px 15px; border-width:1px; border-style:solid; border-color:#FFD28C; background-image: url(<nop>https://jazz.net/wiki/pub/Deployment/WebPreferences/TLASE.jpg); background-size: cover; font-size:120%"> ---+!! Useful LQE SPARQL Queries %DKGRAY% Authors: Main.TimFeeney, Main.IanBarnard, Main.FabriceMendes <br> Build basis: 6.0.6.1 and above %ENDCOLOR%</div></sticky> <!-- Page contents top of page on right hand side in box --> <sticky><div style="float:right; border-width:1px; border-style:solid; border-color:#DFDFDF; background-color:#F6F6F6; margin:0 0 15px 15px; padding: 0 15px 0 15px;"> %TOC{title="Page contents"}% </div></sticky> <sticky><div style="margin:15px;"></sticky> This page contains some useful SPARQL queries to gather information from the LQE repository. These can be run from the [[https://www.ibm.com/support/knowledgecenter/SSYMRC_7.0.2/com.ibm.team.jp.lqe2.doc/topics/t_query.html][query interface]] of the LQE administration UI. Be advised that [[https://jazz.net/wiki/bin/view/Deployment/CLMExpensiveScenarios#Running_high_volume_and_very_com][complex and/or high volume queries can place load on the server]] so exercise caution and test these in a non-production environment first. ---++ Count components per project <verbatim> PREFIX oslc_config: <http://open-services.net/ns/config#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX process: <http://jazz.net/ns/process#> SELECT ?project ?projectName ( COUNT ( ?fgc ) AS ?components ) WHERE { ?fgc rdf:type oslc_config:Component . ?fgc process:projectArea ?project . ?project dc:title ?projectName . } GROUP BY ?project ?projectName </verbatim> ---++ Total baselines and streams per component If you remove or adapt the filter line for /rm/ these will work with gc and probably qm; it won't work with context root like /rm1. <verbatim> PREFIX process: <http://jazz.net/ns/process#> PREFIX ns_validity_: <http://jazz.net/ns/validity#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX merge: <http://jazz.net/ns/lqe/merge/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX oslc_config: <http://open-services.net/ns/config#> PREFIX oslc: <http://open-services.net/ns/core#> SELECT DISTINCT ?projectArea ?projectTitle ?component ?componentTitle ?baselineCount ?streamCount WHERE { ?projectArea rdf:type process:ProjectArea. ?projectArea <http://open-services.net/ns/core#archived> false . FILTER regex(str(?projectArea),"/rm/") OPTIONAL { ?projectArea dcterms:title ?projectTitle. } ?component rdf:type oslc_config:Component . ?component <http://jazz.net/ns/process#projectArea> ?projectArea . OPTIONAL { ?component dcterms:title ?componentTitle. } OPTIONAL { SELECT DISTINCT (COUNT(DISTINCT ?oslc_config_Baseline1) AS ?baselineCount) ?component WHERE{ ?oslc_config_Baseline1_uri oslc_config:component ?component. ?oslc_config_Baseline1_uri rdf:type oslc_config:Baseline. OPTIONAL {?oslc_config_Baseline1_ver dcterms:isVersionOf ?oslc_config_Baseline1_uri; rdf:type oslc_config:VersionResource.} BIND( IF (bound(?oslc_config_Baseline1_ver), concat(str(?oslc_config_Baseline1_uri), "?oslc_config.context="), ?oslc_config_Baseline1_uri) as ?oslc_config_Baseline1) } GROUP BY ?component } OPTIONAL { SELECT DISTINCT (COUNT(DISTINCT ?oslc_config_Stream1) AS ?streamCount) ?component WHERE{ ?oslc_config_Stream1_uri oslc_config:component ?component. ?oslc_config_Stream1_uri rdf:type oslc_config:Stream. OPTIONAL {?oslc_config_Stream1_ver dcterms:isVersionOf ?oslc_config_Stream1_uri; rdf:type oslc_config:VersionResource.} BIND( IF (bound(?oslc_config_Stream1_ver), concat(str(?oslc_config_Stream1_uri), "?oslc_config.context="), ?oslc_config_Stream1_uri) as ?oslc_config_Stream1) } GROUP BY ?component } } ORDER BY ?projectTitle ?componentTitle </verbatim> ---++ List baseline names with their UUIDs <verbatim> # Configuration PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX oslc: <http://open-services.net/ns/core#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX oslc_config: <http://open-services.net/ns/config#> PREFIX oslc_core: <http://open-services.net/ns/core#> PREFIX prov: <http://www.w3.org/ns/prov#> PREFIX jazz_process: <http://jazz.net/ns/process#> PREFIX jazz_process2: <http://jazz.net/xmlns/prod/jazz/process/1.0/> SELECT * WHERE { # Filter resource # Fetch properties possibly used in views OPTIONAL { ?resource dcterms:creator/foaf:mbox ?creator_mbox } OPTIONAL { ?resource rdf:type ?type } OPTIONAL { ?resource dcterms:title ?simpleTitle } OPTIONAL { ?resource dcterms:description ?description } OPTIONAL { ?resource dcterms:modified ?modified } OPTIONAL { ?resource dcterms:identifier ?identifier } OPTIONAL { ?resource oslc:shortId ?shortId } BIND ( if (bound(?shortId), ?shortId, ?identifier) as ?id2 ) BIND ( if (isNumeric(?id2), ?id2, xsd:integer(?id2)) as ?id ) OPTIONAL { ?resource oslc_config:mutable ?mutable } FILTER regex(str(?type),"#Baseline","i" ) BIND ( IF (bound(?simpleTitle), str(?simpleTitle), str(?resource)) as ?title) BIND ( IF (bound(?shortId), str(?shortId), "") as ?shortIdStr) BIND ( IF (bound(?mutable) && ?mutable, concat("Stream ", ?shortIdStr), concat("Baseline ", ?shortIdStr)) as ?shortTitle ) # order by (global/local), (stream/baseline) and then title BIND ( IF (bound(?mutable) && ?mutable, concat("_1_", ?title), concat("_2_", ?title)) as ?type_order ) BIND ( IF (bound(?shortId), concat("1_", ?type_order), concat("2_", ?type_order)) as ?order ) } </verbatim> <sticky></div></sticky>
This topic: Deployment
>
WebHome
>
DeploymentMonitoring
>
UsefulLQEQueries
History: r2 - 2021-04-01 - 13:20:10 -
TimFeeney
Copyright © by IBM and non-IBM contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our
Terms of Use.
Please read the following
disclaimer
.
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
.