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

query.produce2.rq Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
#
# xt:produce() emulate Producer: return copy of query edge as target edge
#
select * where {
  {?x foaf:name ?n ;
  foaf:knows 
  optional { ?x foaf:knows  }}
  union { ?x foaf:name 'Jim' }
  filter exists { ?x foaf:knows  }
}

function xt:produce(?q) {
  kg:display(?q) ;
  let ((?s, ?p, ?o) = ?q){
    if (?q = foaf:knows){
      xt:list(xt:triple(?s, ?p, ?o))
    }
    else {
      xt:list(?q)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy