forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interactive-complex-2.sparql
48 lines (47 loc) · 1.44 KB
/
interactive-complex-2.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
(?frId AS ?personId)
(?first AS ?personFirstName)
(?last AS ?personLastName)
?messageId
(?content AS ?messageContent)
(?creationDate AS ?messageCreationDate)
WHERE
{
VALUES (?type) {(snvoc:Comment) (snvoc:Post)}
{
SELECT DISTINCT
?fr
WHERE {
?rootPerson a snvoc:Person .
?fr a snvoc:Person .
?rootPerson snvoc:id $personId .
?rootPerson ((snvoc:knows/snvoc:hasPerson)|^(snvoc:knows/snvoc:hasPerson)) ?fr
}
}
?message snvoc:hasCreator ?fr .
?message a ?type
{
{
?message snvoc:content ?content
} UNION {
?message snvoc:imageFile ?content
}
} .
?message snvoc:creationDate ?creationDate .
?message snvoc:id ?messageId .
FILTER (?creationDate <= $maxDate) .
?fr snvoc:firstName ?first .
?fr snvoc:lastName ?last .
?fr snvoc:id ?frId .
}
ORDER BY DESC(?creationDate) ?message
LIMIT 20