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

sttl.turtle.value.rq Maven / Gradle / Ivy

#
# Turtle Pretty Printer
# Olivier Corby, Wimmics Inria I3S, 2013
#
template st:value {
             
   format {
    "%s %s"
	if (?p = rdf:type, "a", st:turtle(?p))  	       
	if (?refer, st:turtle(?y), if (isURI(?y) && ?y = rdf:nil, "()", st:process(?y)))
   }   
             
   ; separator = concat(" ;", st:nl()) 
}
where {
  triple(?in ?p ?y |?l|)
  filter (! isURI(?in) || ?l = 0)
  
  bind (
    isBlank(?y) && not exists { ?y rdf:first ?e }
    && (
    st:get(st:reference, true)
    || (st:get(st:allgraph, true) && exists { ?x ?q ?y . filter(?in != ?x) } )
    || exists { ?y ?q ?y } 
    || ?in = ?y
    ) 
  as ?refer)      
}
order by if (?p = rdf:type, 0, 1) ?p ?y




© 2015 - 2025 Weber Informatics LLC | Privacy Policy