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

query.dbpedia.rq 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, Shacl. STTL. LDScript.

The newest version!
#
# Recursive query on top of DBpedia
#
prefix p:    
prefix o:    
prefix r:    

select (1 + kg:number() as ?n) ?suc where {
  bind (unnest(us:search(r:Auguste, 1, 20)) as ?suc)
}


function us:search(?x, ?n, ?max){
  let (?s = us:dbpedia(?x)){
    if (?n = ?max) {xt:list(?s)}
    else if (?s = xt:stop){xt:list()}
    else {xt:cons(?s, us:search(?s, ?n + 1, ?max))}
  }
}

function us:dbpedia(?x){
  let (?ms = service  {
             ?x p:successeur  ?y})
    {
      if (xt:size(?ms) = 0){ xt:stop }
	else {let ((?y) = ?ms) {?y}}
    }
}

function xt:service(?u, ?q, ?ms){
  xt:display(?ms)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy