SPARQL query - DNG project Names
Hello forum, I'm trying to determine how I might list the DNG Project Names (not just a URL) in the SPARQL Query below in addition to all of the other columns. I've tried to find the answer by reviewing many of the SPARQL references and I can't seem to make sense of it.
PREFIX dc: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rm: <http://www.ibm.com/xmlns/rdm/rdf/> PREFIX rmTypes: <http://www.ibm.com/xmlns/rdm/types/> PREFIX rrmReview: <http://www.ibm.com/xmlns/rrm/reviews/1.0/> PREFIX nav: <http://com.ibm.rdm/navigation#> PREFIX jfs: <http://jazz.net/xmlns/foundation/1.0/> PREFIX owl: <http://www.w3.org/2002/07/owl#> SELECT DISTINCT ?context ( count(?artifact) as ?artifactCount ) ( count(?binding) as ?bindingCount ) ( count (?link) as ?linkCount ) WHERE { {?artifact rdf:type rm:Artifact . OPTIONAL{?artifact rm:boundArtifact ?boundArt .} FILTER (!BOUND(?boundArt)) . ?artifact jfs:resourceContext ?context } UNION {?binding rdf:type rm:Artifact . ?binding rm:boundArtifact ?boundArt . ?binding jfs:resourceContext ?context } UNION { ?link rdf:type rm:Link . ?link jfs:resourceContext ?context } } GROUP BY ?context ORDER BY DESC (?artifactCount )</pre>
One answer
Comments
Thanks Rosa - is there any other way to get the same kind of data? Maybe through a JRS query?
There are a few things to consider:
- when you query DNG, you also pick up artifacts from archived projects, as well as artifacts that might no longer be part of any active configuration (they were deleted)
- JRS only stores versions coming from active configurations (there might be the odd case where an archived configuration left resources behind in JRS, but it is not the norm); JRS does not include any baseline data from projects without configuration mgmt enabled; therefore, querying JRS might not yield the results you are looking for if you are trying to obtain DNG metrics
- best bet to obtain the project name is a GET on the project URL (and you can use the response to also filter out archived projects)
Comments
Rohini Kumar
Jun 19 '18, 1:40 a.m.Can you please let me know what should you want exactly