forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteractive-short-2.sparql
40 lines (38 loc) · 1.43 KB
/
interactive-short-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
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
?messageId
?messageContent
?messageCreationDate
?originalPostId
?originalPostAuthorId
?originalPostAuthorFirstName
?originalPostAuthorLastName
WHERE {
BIND( $personId AS ?personId )
?person a snvoc:Person .
?person snvoc:id ?personId .
?message snvoc:hasCreator ?person .
?message snvoc:content|snvoc:imageFile ?messageContent .
?message snvoc:creationDate ?messageCreationDate .
?message snvoc:id ?messageId .
OPTIONAL {
?message snvoc:replyOf* ?originalPostInner .
?originalPostInner a snvoc:Post .
} .
BIND( COALESCE(?originalPostInner, ?message) AS ?originalPost ) .
?originalPost snvoc:id ?originalPostId .
?originalPost snvoc:hasCreator ?creator .
?creator snvoc:firstName ?originalPostAuthorFirstName .
?creator snvoc:lastName ?originalPostAuthorLastName .
?creator snvoc:id ?originalPostAuthorId .
}
ORDER BY DESC(?messageCreationDate) DESC(?messageId)
LIMIT 10