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

template.rdfxml.rul 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













template st:resourcetype(?in, ?t) {
format {
    us:format(if (?bnode, ft:tagbn.html, ft:tag.html))
    
    st:turtle(?t, true)
    st:linkuri(?in)
    box { st:call-template(st:property, ?in, ?t) }
}
}
where {
   bind (isBlank(?in) as ?bnode)
}

]]>





%s"    str(?uri) str(?title)
   }
}
where {
}
]]>













template st:start(?in) {
format {
  us:format(ft:head.html)  
  ibox { st:call-template(st:prefix) }
  str(?body)  
}
}
where {
   bind(
    if (bound(?in), st:call-template(st:main, ?in), st:call-template(st:main)) 
   as ?body )
}
]]>





RDF/XML
    
%s
""" us:clean(st:call-template(st:start)) } } where { bind (st:set(st:html, true) as ?b) } ]]>
template st:listtriple(?x, ?p, ?y) { format { us:format(ft:property.html) st:turtle(?p, true) box { st:call-template(st:listrec, ?y) } } } where { } ]]> template st:resourceref(?in) { format { us:format(if (?bnode, ft:resourcerefbn.html, ft:resourceref.html)) st:linkuri(?in) } } where { bind (isBlank(?in) as ?bnode) } ]]> template st:collection(?x, ?p, ?y) { format { us:format(ft:collection.html) st:turtle(?p, true) box { st:call-template(st:list, ?y) } } } where { } ]]> %s
""" us:clean(st:call-template(st:start, ?in)) } } where { bind (st:set(st:html, true) as ?b) bind (st:set(st:focus, false) as ?foc) } ]]> prefix ht: template st:profile {} where {} function st:literal(?x){ if (st:get(st:html, true), ?x, #st:format("%s", ?x), ?x) } function us:clean(?x) { ?x } function st:clean(?x) { replace(replace(?x, "&", "&"), "<", "<") } function st:html(?x){ if (st:get(st:html, true), st:clean(?x), ?x) } function us:format(?name){ if (st:get(st:html, true), uri(replace(?name, "rdfxml", "rdfxmlhtml")), ?name) } function st:linkuri(?x){ if (isURI(?x) && st:get(st:html, true) && st:get(st:hyperlink, true), st:display(?x), str(?x)) } # LOD URI hypertext link generated as is # set by profile.ttl : st:param [ st:lod (URI) ] # function st:lod(?x){ coalesce(mapany(rq:strstarts, ?x, st:get(st:lod)), false) } function us:prepare(?uri){ ?uri # coalesce(funcall(st:get(st:prepare), ?uri), ?uri) } # display resource uri function st:display(?x){ let (?profile = coalesce(st:get(st:profile), st:null)){ if (?profile = st:null){ str(?x) } else if (st:lod(?x) || coalesce(st:getprofile(?x) = st:lod, false) ){ st:call-template(st:link, str(?x), str(?x)) } else { st:call-template(st:link, coalesce(st:pplink(us:prepare(?x)), us:prepare(?x)), str(?x)) } } } ]]> template st:resource(?in) { format { us:format(if (?bnode, ft:descriptionbn.html, ft:description.html)) st:linkuri(?in) box { st:call-template(st:property, ?in) } } } where { bind (isBlank(?in) as ?bnode) } ]]> template st:listrec(?y) { format { us:format(ft:desc.html) box { st:call-template(st:triple, ?y, rdf:first, ?f) st:nl() if (?r = rdf:nil, st:apply-templates(?y, rdf:rest, ?r), st:call-template(st:listrecrest, ?r)) } } } where { ?y rdf:first ?f ; rdf:rest ?r } ]]> template st:listrecrest(?y) { format { us:format(ft:property.html) st:turtle(rdf:rest) box { st:call-template(st:listrec, ?y) } } } where { } ]]> template (?x, ?p, ?y) { format { us:format(ft:propertydt.html) st:turtle(?p, true) if (strstarts(datatype(?y), xsd:), replace(datatype(?y), xsd:, st:html("&xsd;")), datatype(?y)) st:literal(str(?y)) } } where { ?x ?p ?z # must distinguish 12 and 012 filter sameTerm(?z, ?y) filter (isLiteral(?z) && datatype(?z) != rdf:langString && datatype(?z) != xsd:string) } ]]> template (?x, ?p, ?y) { format { us:format(ft:property.html) st:turtle(?p, true) st:literal(str(?y)) } } where { ?x ?p ?y filter (isLiteral(?y) && datatype(?y) = xsd:string) } ]]> template (?x, ?p, ?y) { format { us:format(ft:propertylang.html) st:turtle(?p, true) lang(?y) st:literal(str(?y)) } } where { ?x ?p ?y filter (isLiteral(?y) && datatype(?y) = rdf:langString) } ]]> template (?x, ?p, ?y) { format { us:format(ft:resource.html) st:turtle(?p, true) st:linkuri(?y) } } where { ?x ?p ?y filter isURI(?y) } ]]> template (?x, ?p, ?y) { format { us:format(ft:property.html) st:turtle(?p, true) box { if (st:visited(?y), st:call-template(st:resourceref, ?y), st:call-template(st:blank, ?x, ?p, ?y)) } } } where { ?x ?p ?y filter isBlank(?y) } ]]>



© 2015 - 2025 Weber Informatics LLC | Privacy Policy