
webapp.data.query.dbpedia.frdbpediaen.rq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of corese-server Show documentation
Show all versions of corese-server Show documentation
Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1
Query and Update.
The newest version!
#
# SPARQL Query
# Extract a subgraph from dbpedia, to be processed by HTML Transformation st:navlab
#
# Olivier Corby - Wimmics INRIA I3S - 2014
#
prefix foaf:
prefix o:
prefix w:
prefix r:
prefix p:
prefix geo:
construct {
?r a ?class .
?r rdfs:label ?label ; rdfs:comment ?com .
?r o:wikipedia ?pr ; o:dbpedia ?r
?r ?qq ?ts . ?ts rdfs:label ?ls . ?qq rdfs:label ?lq .
?r ?pp ?vv .
?r p:latitude ?lat ; p:longitude ?lon .
?r o:place [ p:latitude ?plat ; p:longitude ?plon ] .
}
where {
bind (st:get(st:uri) as ?r)
service {
?r rdfs:label ?label . filter (langMatches(lang(?label), 'en'))
optional { ?r rdfs:comment ?com . filter (langMatches(lang(?com) , 'en')) }
optional {
?r p:dateDeNaissance | p:dateDeDécès | o:thumbnail ?vv
?r ?pp ?vv .
filter (?pp = o:thumbnail || isLiteral(?vv))
}
optional { ?r p:latitude|geo:lat ?lat
?r p:longitude|geo:long ?lon }
optional {
?r o:place ?pl
?pl p:latitude|geo:lat ?plat
?pl p:longitude|geo:long ?plon
}
optional {
?r o:spouse |o:child
|p:mère |o:mother
|p:père |o:father
|p:successeur |o:successor
|p:prédécesseur |o:predecessor
|o:residence
|p:sud |p:nord |p:est |p:ouest
|p:sudEst |p:sudOuest
|p:nordEst |p:nordOuest
|o:wikiPageRedirects ?s
?r ?q ?s
filter isURI(?s) . ?s rdfs:label ?ls .
filter (langMatches(lang(?ls), 'en') )
?q rdfs:label ?lq
filter (langMatches(lang(?lq), "en") || langMatches(lang(?lq), "fr"))
optional {
?s o:wikiPageRedirects ?rs
}
}
}
bind (coalesce(?rs, ?s) as ?ts)
bind (if (?q = p:successeur, o:successor,
if (?q = p:prédécesseur, o:predecessor,
if (?q = p:mère, o:mother,
if (?q = p:père, o:father,
?q))))
as ?qq)
bind (if (bound(?lat) || bound(?plat), o:Place, foaf:Person) as ?class)
bind (concat(w:, (substr(?r, strlen(r:) + 1))) as ?pr)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy