-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlist_people.rq
31 lines (28 loc) · 1.08 KB
/
list_people.rq
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
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX schema: <http://schema.org/>
SELECT distinct ?person
?last_name ?first_name
?birth_date ?birth_place
#?attendee_role ?event_attendee_name
#?same_person
#?count1 ?count2 ?rank
WHERE {
{ select distinct (min(?o) as ?person) (count(distinct ?o) as ?count1) (count(distinct ?role) as ?count2) {
?s a schema:Person ;
schema:familyName ?_lastname ;
owl:sameAs? ?o .
?o ^schema:attendee/schema:roleName ?role
} group by ?s having (count(distinct ?o) > 1) }
?person a schema:Person ;
schema:familyName ?last_name ;
schema:givenName ?first_name .
OPTIONAL {?person schema:birthPlace [rdfs:label ?birth_place] .}
OPTIONAL {?person schema:birthDate ?birth_date_ .}
#optional {?person schema:attendee ?event_attendee_name . }
#optional {?person schema:roleName ?attendee_role . }
BIND(xsd:date(?birth_date_) as ?birth_date) .
BIND(?count1 * ?count2 as ?rank)
}
ORDER BY desc(?rank) desc(?count2) desc(?count1)