sttl.turtlehtml.template.start.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.
#
# Turtle Pretty Printer
# Olivier Corby, Wimmics Inria I3S, 2013
#
template st:start {
if (st:get(st:number, true),
st:format("# %s%s", st:number(), st:nl()), "")
st:apply-templates(?x)
; separator = "\n\n"
}
where {
select distinct ?x where {
bind (st:focus() as ?x)
bind (st:get(st:uri) as ?uri)
bind (bound(?uri) as ?sort)
?x ?p ?y
filter (
isURI(?x)
|| not exists { ?z ?q ?x }
|| (isBlank(?x)
&& (exists { ?a ?q ?x . ?b ?r ?x . filter(?a != ?b) }
|| exists { ?x ?q ?x }
))
)
} order by if (?sort, ?x != ?uri, true) ?x
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy