-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbpedia_musisian.g2g
24 lines (22 loc) · 986 Bytes
/
dbpedia_musisian.g2g
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
# Node mappings
(m:Musician {name:n, hometown:h})
?m a foaf:Person, dbo:MusicalArtist .
?m rdfs:label ?n . FILTER(lang(?n) = "en") .
OPTIONAL { ?m dbo:hometown/rdfs:label ?h. FILTER(lang(?h) = "en"). }
# Edge mappings
# (m1:Musician)-[:sameGroup {name:n, since:s}]->(m2:Musician)
(m1:Musician)-[:sameGroup {name:n, since:s}]-(m2:Musician)
?g a schema:MusicGroup .
?g dbo:bandMember ?m1 , ?m2 .
# { ?g dbo:bandMember ?m1 , ?m2. } UNION
# { ?g dbo:formerBandMember ?m1 , ?m2. }
FILTER(?m1 != ?m2)
OPTIONAL { ?g rdfs:label ?n. FILTER(lang(?n) = "en") }
OPTIONAL { ?g dbo:activeYearsStartYear ?s }
# OPTIONAL { ?g dbo:hometown/rdfs:label ?h. FILTER(lang(?h) = "en"). }