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

sttl.rdfxml.profile.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
prefix ft: 
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))
      }     
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy