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

template.navlab.rul Maven / Gradle / Ivy













prefix o:    
prefix ft:  

template st:descresource(?r) {
format {
  ft:resource.html
  str(?p)
  st:call-template(st:triple, ?r, ?p, ?v)
  }
}
where { 
    ?r ?p ?v
}
]]>







template st:mapmap(?amap) {
    st:call-template(st:maplist, ft:mapper.html, ?list, ?text)        
} 
where {
    values ?amap {undef}
    bind (coalesce(st:call-template(st:link), "link undef") as ?text)

    {select ?amap (aggregate(distinct xt:list(?location, ?lat, ?lon)) as ?list)
    where {
        values ?amap {undef}
        values (?location ?lon ?lat) { unnest(?amap) }
    }}
    
    filter (xt:size(?list) > 0)
}


]]>







template st:mapper {
    st:call-template(st:mapmap, xt:mappings())        
} 
where { 
    # display url as is in map, see map2.rq
    bind (st:set(st:maplod, st:url) as ?tmp)
    bind (st:set(st:mapsize, coalesce(funcall(function(){ ?mapsize }), "maplarge")) as ?s)
    bind (st:set(st:mapzoom, coalesce(funcall(function(){ ?mapzoom }), 6)) as ?z)    
}

]]>






template st:icon(?label, ?ic) {
  format {
    ft:img.html   
    str(?label) str(?ic)
  }
}
where {}
]]>





%1$s
" str(?url) } } where { values ?url { unnest(st:get(st:link)) } } ]]>
prefix w: prefix r: prefix p: template st:selecttry { if (bound(?t), st:call-template(st:select), st:call-template(st:default)) } where { optional { ?x a ?t } } limit 1 ]]> prefix w: prefix r: prefix p: prefix ft: template st:frame(?label, ?icon, ?body) { format { ft:frame.html str(?label) if (?icon = "", "", st:call-template(st:icon, ?label, ?icon) ) str(?body) } } where { } ]]> prefix w: prefix r: prefix p: template st:default { "" str(?uri) "" } where { bind(st:get(st:uri) as ?uri) } ]]> prefix o: template st:profile { } where {} # # Get the ?q = st:person st:param property from profile.ttl # Return properties to be displayed # st:get(st:definition) return the profile.ttl RDF graph # function us:definition(?q){ st:set(st:currentProperty, ?q) ; let (?m = select ?p ?title ?titleen where { bind (st:get(st:currentProperty) as ?q) bind (st:get(st:definition) as ?def) graph ?def { [] ?q ?list ?list rdf:rest*/rdf:first (?p ?title ?titleen) } }) { ?m } } # # Default properties to be displayed for Person # function us:person(){ let (?m = select * where { values (?p ?title ?titleen) { (p:dateDeNaissance "Naissance" "Birth") (p:dateDeDécès "Décès" "Death") (o:predecessor "Prédécesseur" "Predecessor") (o:successor "Successeur" "Successor") (o:father "Père" "Father") (o:mother "Mère" "Mother") (o:spouse "Conjoints" "Spouse") (o:child "Enfants" "Children") (o:residence "Résidence" "Residence") (o:memberOf "Membre" "Member") (o:bandMember "Membre" "Member") (o:starring "Acteur" "Actor") (o:director "Metteur en scène" "Director") (rdfs:comment "Résumé" "Abstract") (o:wikiPageRedirects "Voir aussi" "See Also") (o:wikipedia "Wikipedia" "Wikipedia") (o:dbpedia "DBpedia" "DBpedia") } }) { ?m } } ]]> template st:maplist(?format, ?list, ?text) { format { ?format str(?lat) str(?lon) coalesce(st:get(st:mapzoom), 4) coalesce(st:get(st:mapicon1), "/img/smarker.png") st:call-template(st:map2, ?rest) coalesce(st:get(st:mapsize), "mapmedium") ?text } } where { bind (xt:get(?list, 0) as ?fst) bind (xt:get(?fst, 1) as ?lat) bind (xt:get(?fst, 2) as ?lon) bind (let ((?a | ?rst) = ?list) { ?rst } as ?rest) } ]]> template st:desctriple(?n, ?r, ?p, ?title, ?temp) { format { ft:triple.html str(?title) st:call-template(?temp, ?r, ?p) } } where {} ]]> prefix w: prefix r: prefix p: template st:title(?r, ?l, ?i) { "
" "

" str(?l) "

" """

""" coalesce(str(?b), "") if (bound(?b) && bound(?d), " -- " , "") coalesce(str(?d), "") """

""" "
" } where { } ]]>
prefix w: prefix r: prefix p: template st:select { st:apply-templates(?x) } where { { ?x a foaf:Person } union { ?x a o:Place } union { ?x a o:Resource } filter(?x = coalesce(st:get(st:uri), ?x)) } limit 1 ]]> prefix w: prefix r: prefix p: template st:substart(?x) { st:call-template(st:head, st:head) st:apply-templates(?x) st:call-template(st:tail, st:tail) } where { } ]]> prefix o: prefix w: prefix r: prefix p: prefix ft: template st:display(?r, ?l) { format { ft:link.html st:pplink(?r) str(coalesce(?l, ?pr)) } } where { bind ( if (strstarts(?r, r:), concat(w:, (substr(?r, strlen(r:) + 1))), ?r) as ?pr) } ]]> template st:gmap(?r, ?lat, ?lon, ?list) { format { ft:gmap.html str(?lat) str(?lon) coalesce(st:get(st:mapzoom), 7) coalesce(st:get(st:mapicon1), "/img/bmarker.png") st:call-template(st:gmap2, ?list) "" # deprecated arg coalesce(st:get(st:mapsize), "mapmedium") } } where { } ]]> prefix o: template st:glocate { st:call-template(st:omap, ?in, ?lat, ?lon, aggregate(?elem)) } where { ?in a o:Place optional { ?in o:place [ p:longitude ?lon ; p:latitude ?lat] } optional { ?in p:longitude ?lon ; p:latitude ?lat } # search all other Place resources optional { select (xt:list(?res, ?lat, ?lon) as ?elem) ?res where { bind (st:get(st:dataset) as ?g) graph ?g { ?res p:longitude ?lon ; p:latitude ?lat } } } filter(! bound(?res) || ?in != ?res) } ]]> template st:map2(?list) { format { ft:map2.html st:number() str(?lat) str(?lon) coalesce(st:get(st:mapicon2), "/img/smarker.png") #coalesce(st:plink(?r), str(?r)) # see mapper.rq for st:maplod coalesce(if (st:get(st:maplod, st:url), ?r, st:plink(?r)), str(?r)) } } where { values (?r ?lat ?lon) { unnest(?list) } } ]]> 0) } ]]> template st:graph { st:call-template-with(st:d3, st:frame) } where { } ]]> template st:omap(?r, ?lat, ?lon, ?list) { st:call-template(st:maplist, ft:map.html, xt:cons(xt:list(?r, ?lat, ?lon), ?list), "") } where { } ]]> prefix w: prefix r: prefix p: template st:page { st:call-template(st:selecttry) } where { } ]]> template st:map { st:call-template(st:maplist, ft:map.html, ?list, "") } where { bind (st:get(st:location) as ?list) filter (bound(?list) && xt:size(?list) > 0) } ]]> prefix o: template st:descperson(?r) { st:call-template(st:desctriple, st:number(), ?r, ?p, ?tt, if (?href, st:href, st:property)) } where { bind (unnest(us:person()) as (?p, ?title, ?titleen)) bind (if (?p in (o:wikipedia, o:dbpedia), true, false) as ?href) filter ( ?href || exists { ?r ?p ?v } ) bind (if (st:get(st:lang, "en"), ?titleen, ?title) as ?tt) } # # Properties to be displayed for Person (see profile.rq) # function us:define(){ let (?m = us:definition(st:person)){ if (xt:size(?m) = 0) { us:person() } else { ?m } } } ]]> " } where { } ]]> template st:gmap2(?list) { format { ft:gmap2.html st:number() str(?lat) str(?lon) coalesce(st:get(st:mapicon2), "/img/smarker.png") st:plink(?r) } } where { values (?r ?lat ?lon) { unnest(?list) } } ]]> template st:href(?r, ?p) { format { ft:link.html str(?v) str(?v) } } where { ?r ?p ?v } ]]> prefix o: prefix r: template st:descplace(?r) { st:call-template(st:desctriple, st:number(), ?r, ?p, ?tt, if (?href, st:href, st:property)) } where { values (?p ?title ?titleen) { (rdfs:comment "Résumé" "Abstract") (p:nord "Nord" "North") (p:nordEst "Nord Est" "North East") (p:est "Est" "East") (p:sudEst "Sud Est" "South East") (p:sud "Sud" "South") (p:sudOuest "Sud Ouest" "South West") (p:ouest "Ouest" "West") (p:nordOuest "Nord Ouest" "North West") (p:latitude "Latitude" "Latitude") (p:longitude "Longitude" "Longitude") (o:wikipedia "Wikipedia" "Wikipedia") (o:dbpedia "DBpedia" "DBpedia") } bind (if (?p in (o:wikipedia, o:dbpedia), true, false) as ?href) filter (if (?p in (o:wikipedia, o:dbpedia), strstarts(?r, r:), true)) filter ( ?href || exists { ?r ?p ?v } ) bind (if (st:get(st:lang, "en"), ?titleen, ?title) as ?tt) } ]]> prefix w: prefix r: prefix p: template { st:call-template(st:frame, ?label, coalesce(?ic, ""), st:call-template(st:descresource, ?in)) } where { ?in a o:Resource ?in rdfs:label ?label filter(lang(?label) = 'fr') optional { ?in o:thumbnail ?ic } } ]]> prefix w: prefix r: prefix p: template { st:call-template(st:frame, ?label, coalesce(?ic, ""), st:call-template(st:descplace, ?in)) st:call-template(st:glocate, ?in) } where { ?in a o:Place minus { ?in a o:Resource } ?in rdfs:label ?label optional { ?in o:thumbnail ?ic } } ]]> prefix w: prefix r: prefix p: template { st:call-template(st:frame, ?label, coalesce(?ic, ""), st:call-template(st:descperson, ?in)) } where { ?in a foaf:Person minus { ?in a o:Resource } ?in rdfs:label ?label optional { ?in o:thumbnail ?ic } } ]]>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy