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

sttl.turtlehtml.template.start.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.

There is a newer version: 4.6.1
Show newest version
#
# 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