forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bi-24.sparql
32 lines (29 loc) · 1.18 KB
/
bi-24.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
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 (COUNT(DISTINCT ?message) AS ?messageCount) (COUNT(DISTINCT ?like) AS ?likeCount) ?year ?month ?continentName
WHERE
{
VALUES (?type) {(snvoc:Post) (snvoc:Comment)}
?message a ?type .
?message snvoc:isLocatedIn/snvoc:isPartOf/foaf:name ?continentName .
?message snvoc:hasTag ?tag .
?tag a/rdfs:label $tagClass .
OPTIONAL {
?person a snvoc:Person .
?person snvoc:likes ?like .
?like (snvoc:hasPost|snvoc:hasComment) ?message
}
?message snvoc:creationDate ?messageCreationDate .
BIND(YEAR(?messageCreationDate) AS ?year)
BIND(MONTH(?messageCreationDate) AS ?month)
}
GROUP BY ?year ?month ?continentName
ORDER BY ?year ?month DESC(?continentName)
LIMIT 100