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

template.sparql.rul Maven / Gradle / Ivy







template st:tableconsuri {

 format {
        ft:triple.html
        
        st:number()
        st:call-template(st:show,    ?x)
        st:display(?x) 
        st:display(?p) 
        st:display(?y) 
        st:call-template(st:show,    ?y)
    }
}
where {
  bind (st:focus() as ?uri)
  ?x ?p ?y
  filter (?uri in (?x, ?p, ?y))
}
order by ?x ?p ?y


]]>





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












template st:d3selectviewer {
    format {
        d3:frameselect.html
        ?id
        coalesce(xt:json(st:get(st:mappings)), "{ error: 'error when reading st:mappings'}")
    }
}
where {
    bind (substr(replace(rand(), "\\.", ""), 0, 5) as ?id)
}
]]>


















prefix ft: 

template st:pageask {
format {
  ft:ask.html
  ?b
}
}
where {
  ?r rs:boolean ?b
}
]]>






template st:query(?q) {

format {

  ft:query.html
  
  st:get(st:service)
  if (bound(?prof), st:format(ft:option.html, ?prof), "")
  str(?q)
  }
}
where {
  bind (st:get(st:profile) as ?prof)

}
]]>












prefix ft: 
template st:variable {
 
    format {
      ft:variable.html 
      str(?v)
    } 
    ; separator = " "
 
}
where {
  ?x rs:resultVariable ?v
}
order by ?v
]]>






template st:pageselect {
    #st:call-template(st:d3selectviewer)
    format {
        ft:select.html
        st:call-template(st:variable)
        st:call-template(st:table)
    }
}
where {
}

]]>






template st:pagecons {
   format {
    ft:construct.html
    st:call-template(st:tablecons)
    st:apply-templates-with(st:d3)
   }
}
where {
}


]]>






template st:show(?x) {
    format { ft:img.html  str(?l) }
}
where {
  bind (st:get(st:dataset) as ?g)
  graph ?g { 
    { ?x st:icon ?l }  
    union { ?x a ?t . ?t st:icon ?l }  
  }
}
limit 1
]]>





























{ "Test" } 
  st:call-template(st:page)
      
}
where {
   bind (st:set(st:profile, coalesce(st:get(st:profile), st:sparql)) as ?p)
}
]]>













template st:page {
   
  st:call-template(?page)
      
}
where {
  bind (
    if (exists { ?x a rs:ResultSet }, 
      if (exists { ?x rs:boolean ?b }, st:pageask, st:pageselect),
      st:pagecons
    )
    as ?page
  )
}
]]>






template st:tableconsall {
format {
        ft:triple.html
        
        st:number()
        st:call-template(st:show,    ?x)
        st:display(?x) 
        st:display(?p) 
        st:display(?y) 
        st:call-template(st:show,    ?y)
    }
}
where {
    select * where {
        ?x ?p ?y
    }
    order by ?x ?p ?y
    limit 50000
}


]]>






template st:tableconslimit {
format {
        ft:triple.html
        
        st:number()
        st:call-template(st:show,    ?x)
        st:display(?x) 
        st:display(?p) 
        st:display(?y) 
        st:call-template(st:show,    ?y)
    }
}
where {
    select * where {
        ?x ?p ?y
    }
    order by ?x ?p ?y
    limit 100
}


]]>






prefix ft: 
template st:table {
    format {
        ft:table.html  
        st:number()
        st:apply-templates(?s)
    }
}
where {
  ?x rs:solution ?s 
  ?s rs:index ?i  
}
order by ?i
limit 50000
]]>






























prefix ft: 
template  {

format { 
    ft:value.html     
    coalesce(st:display(?val), " ")
}  
; separator = " "

}
where {
  ?x rs:solution ?in
  ?x rs:resultVariable ?var 
  
  optional {
    ?in rs:binding [ rs:variable ?var ; rs:value ?val ]
  }
  
}
order by ?var
]]>








© 2015 - 2025 Weber Informatics LLC | Privacy Policy