Fix SPARQL implementation BI Q14: introduce constraint for 'Post' type
@@ -8,7 +8,7 @@ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
-SELECT ?personId ?personFirstName ?personLastName (COUNT(?post) AS ?threadCount) (COUNT(?reply) + COUNT(DISTINCT ?post) AS ?messageCount)
+SELECT ?personId ?personFirstName ?personLastName (COUNT(?post) AS ?threadCount) (COUNT(?reply) AS ?messageCount)
WHERE
{
VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
@@ -19,8 +19,8 @@ WHERE
?post snvoc:creationDate ?postCreationDate .
?reply a ?type .
?reply snvoc:replyOf* ?post .
+ ?post a snvoc:Post .
?reply snvoc:creationDate ?replyCreationDate .
- ?personId snvoc:id ?personIdId .
FILTER (($startDate <= ?postCreationDate && ?postCreationDate <= $endDate) &&
($startDate <= ?replyCreationDate && ?replyCreationDate <= $endDate))
