query.extension.rq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of corese-core Show documentation
Show all versions of corese-core Show documentation
Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1
Query and Update.
@public package {
# Specify focus node of transformation
# default is st:get(st:uri) as usual
# no focus :
# st:param [ st:focus false ]
# focus on st:get(st:elem)
# st:param [ st:focus st:elem ]
function st:focus(){
st:get(coalesce(st:get(st:focus), st:uri))
}
function xt:turtle() {
st:apply-templates-with(st:turtle)
}
function xt:turtle(?x) {
if (isLiteral(?x) && datatype(?x) = dt:graph){
xt:focus(?x, st:apply-templates-with(st:turtle))
}
else {
st:apply-templates-with(st:turtle, ?x)
}
}
function xt:rdfxml() {
st:apply-templates-with(st:rdfxml)
}
function xt:json() {
st:apply-templates-with(st:json)
}
function xt:json(?x) {
st:apply-templates-with(st:json, ?x)
}
function xt:owl() {
st:apply-templates-with(st:owl)
}
function xt:owl(?x) {
st:apply-templates-with(st:owl, ?x)
}
function xt:spin() {
st:apply-templates-with(st:spin)
}
function xt:spin(?x) {
st:apply-templates-with(st:spin, ?x)
}
function st:list(?t) {
let (?l = st:call-template-with(st:list, st:list, ?t)){
if (! isLiteral(?l) || datatype(?l) != dt:list){
xt:list(?l) }
else { ?l }
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy