All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webapp.data.query.dbpedia.frdbpedia.old Maven / Gradle / Ivy

Go to download

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 debug  {
  ?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 .
  
  
}
where {

bind (st:get(st:uri) as ?r)

service  {

  ?r rdfs:label ?label . filter(lang(?label) = 'fr')    
  optional {  ?r rdfs:comment ?com . filter(lang(?com) = 'fr') }
 
  optional { ?r ?pp ?vv . 
    filter(((?pp = p:dateDeNaissance || ?pp = p:dateDeDécès) && isLiteral(?vv)) 
         || ?pp = o:thumbnail  
#        || ?pp = o:activeYearsEndYear || ?pp = o:activeYearsStartYear
        ) 
  }
  
  optional { ?r ?plat ?lat filter(?plat = p:latitude  || ?plat = geo:lat)
             ?r ?plon ?lon filter(?plon = p:longitude || ?plon = geo:long) }
  optional {
    ?r ?q ?s 
    
    filter(
       ?q = o:spouse || ?q = o:child
    || ?q = p:mère   || ?q = o:mother
    || ?q = p:père   || ?q = o:father
    || ?q = p:successeur   || ?q = o:successor 
    || ?q = p:prédécesseur || ?q = o:predecessor
    || ?q = o:residence 
    
    || ?q = p:sud || ?q = p:nord || ?q = p:est || ?q = p:ouest
    || ?q = p:sudEst  || ?q = p:sudOuest
    || ?q = p:nordEst || ?q = p:nordOuest 
    
    || ?q = o:wikiPageRedirects
    ) 

    optional { 
        ?s o:wikiPageRedirects ?rs        
    }
    
   
    
    filter isURI(?s) . ?s rdfs:label ?ls . filter(lang(?ls) = 'fr') 
    
    ?q rdfs:label ?lq 
    filter(langMatches(lang(?lq), "fr") || langMatches(lang(?lq), "en"))         

  }
	     
}

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), o:Place, foaf:Person) as ?class)     
      
bind (concat(w:, (substr(?r, strlen(r:) + 1))) as ?pr) 

  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy