It's all about the answers!

Ask a question

What does DNG SPARQL pre-count option do?


David Morehouse (113) | asked Jul 02 '19, 10:23 a.m.
edited Jul 09 '19, 10:48 a.m.

  The DNG Sparql Debug Page has a checkbox for "pre-count". 

The pre-count selection is also mentioned on these Jazz Wiki Pages: 
1. https://jazz.net/wiki/bin/view/Deployment/RationalRequirementsComposerProjectSizing 
2. https://jazz.net/wiki/bin/view/Deployment/CalculatingYourRequirementsMetrics 

I have noticed in the past that the pre-count option makes the query take much longer (from 3 to 5 minutes to over an hour) and most of the time is part of the pre-count process. Here is an example: 

With pre-count: 
Pre-count Execution Time: 3777 s 
Query Execution Time: 1 iterations, 194 s, 194 s avg 

Without pre-count: 
Query Execution Time: 1 iterations, 142 s, 142 s avg 

Both query results were the same. 

I couldn't find pre-count mentioned on the Apache Jena site or elsewhere any mention of what "pre-count" does in relation to SPARQL? Is this a specific thing to IBM products? to the DNG Debug Page? 

------------------------------------------------------------------------------------------------------------------------------------------------------ 

Update, gathered some timing data of how long it takes to run when pre-count is selected and when it isn't selected.

------------------------------------------------------------------------
|Run   |          No Pre Count           |            Pre Count        |
------------------------------------------------------------------------
|      |Pre-Count    |Query    |Total    |Pre-Count    |Query    |Total|
------------------------------------------------------------------------
|1     |0.00         |27.60    |27.60    |24.16        |26.75    |50.91|
|2     |0.00         |26.13    |26.13    |23.46        |26.54    |50.00|
|3     |0.00         |24.91    |24.91    |23.64        |25.97    |49.61|
|4     |0.00         |25.55    |25.55    |22.72        |25.00    |47.72|
|5     |0.00         |26.03    |26.03    |22.77        |25.93    |48.70|
------------------------------------------------------------------------

</pre>
This is the SPARQL query used (from&nbsp;<a href="https://jazz.net/wiki/bin/view/Deployment/CalculatingYourRequirementsMetrics">https://jazz.net/wiki/bin/view/Deployment/CalculatingYourRequirementsMetrics</a>)
<br>
<br>
<pre>

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 ASC (?context )


Be the first one to answer this question!


Register or 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.