forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bi-9.sparql
32 lines (30 loc) · 1.17 KB
/
bi-9.sparql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX sn: <http://www.ldbc.eu/ldbc_socialnet/1.0/data/>
PREFIX snvoc: <http://www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
PREFIX sntag: <http://www.ldbc.eu/ldbc_socialnet/1.0/tag/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT ?forumId (COUNT(DISTINCT ?post1) AS ?count1) (COUNT(DISTINCT ?post2) AS ?count2)
WHERE
{
BIND ($tagClass1 AS ?tagClassName1)
BIND ($tagClass2 AS ?tagClassName2)
?tag1 a ?tagClass1 .
?tagClass1 rdfs:label ?tagClassName1 .
?tag2 a ?tagClass2 .
?tagClass2 rdfs:label ?tagClassName2 .
?post1 a snvoc:Post .
?post1 snvoc:hasTag ?tag1 .
?post2 a snvoc:Post .
?post2 snvoc:hasTag ?tag2 .
?forumId snvoc:containerOf ?post1 .
?forumId snvoc:containerOf ?post2 .
?forumId snvoc:hasMember/snvoc:hasPerson ?person .
}
GROUP BY ?forumId
HAVING (?count1 > 0 && ?count2 > 0 && COUNT(DISTINCT ?person) > $threshold)
ORDER BY DESC(ABS(?count2 - ?count1)) ?forumId
LIMIT 100