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

template.calendar.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.

The newest version!











%s" 
    str(?date) day(?date)
  }
  
}
where {
   
}
]]>












prefix ft: 
prefix ut: 
template st:content(?year) {
  format {
    ft:content.html
    
    str(?dd)
    str(?dd)
    group {
    
	format {
	  ut:href.html
	  
	  st:plink(?x, st:dbpedia)
	  str(?title)
	}
	
	; separator = "
" } } } where { {select distinct ?x ?date where { ?x ?p ?date filter (datatype(?date) in (xsd:date, xsd:dateTime)) }} filter (year(?date) = ?year) bind (cal:date(year(?date), month(?date), day(?date)) as ?dd) ?x rdfs:label ?l bind (if (bound(?l), ?l, ?x) as ?title) } group by ?date order by ?date ]]>
template st:main(?year) { st:call-template(st:head, ?year) format { ft:main.html st:call-template(st:calendar, ?year) } } where { } ]]> " "" group { "" str(?label) st:call-template(st:main, ?year) "" } "" "" st:call-template(st:tail) } where { # profile.ttl graph bind (st:get(st:definition) as ?g) # access to the profile.ttl graph graph ?g { st:calendartest st:param [ st:list/rdf:rest*/rdf:first (?label ?year) ] } } ]]> template st:agenda { format { """
      \n%s\n
      Mo Tu We Th Fr Sa Su \n
      %s
  
""" cal:month(?m) group { if (?n = 1, xt:space(cal:num(?jour) - 1), "") if (?n < 10, " ", "") ?n " " if (?jour = "Sunday", "\n", "") ; separator = "" } } ; separator = "\n" } where { bind (unnest(xt:iota(12)) as ?m) bind (unnest(xt:iota(cal:days(?y, ?m))) as ?n) bind (xsd:date(concat(?y, "-", ?m, "-", ?n)) as ?day) bind (xt:day(?day) as ?jour) } group by ?m order by ?m values ?y { 2015 } function xt:space(?n) { if (?n = 0, "", concat(" " , xt:space(?n - 1))) } ]]>
template st:tail { format { ft:tail.html now() } } where {} ]]> prefix ft: template st:monthtab(?y, ?m) { format { ft:month.html cal:month(?m) st:call-template(st:title) xt:td(?first - 1) group { format { ft:day.html st:call-template(st:date, ?date) } if (?day = "Sunday", st:format(ft:sunday.html), "") ; separator = "" } if (?first + ?days - 1 <= 35 , st:format(ft:last.html), "") } } where { bind (cal:days(?y, ?m) as ?days) bind (cal:num(xt:day(cal:date(?y, ?m, 1))) as ?first) bind (unnest(xt:iota(?days)) as ?n) bind (cal:date(?y, ?m, ?n) as ?date) bind (xt:day(?date) as ?day) } ]]> template st:profile { } where {} function xt:space(?n) { if (?n = 0, "", concat(" " , xt:space(?n - 1))) } function xt:td(?n) { if (?n = 0, "", concat("" , xt:td(?n - 1))) } function xt:pretty(?n) { if (?n < 10, concat(" ", ?n), ?n) } function us:display(?y) { if (st:get(st:date, st:romain), xt:romain(?y), ?y) } ]]> template st:calendar(?year) { format { ft:calendar.html st:call-template(st:enum, ?year, 1, 3) st:call-template(st:enum, ?year, 4, 6) st:call-template(st:enum, ?year, 7, 9) st:call-template(st:enum, ?year, 10, 12) } } where { } ]]> template st:title { format { ft:title.html str(?t) } ; separator = "" } where { values ?t { "Mo" "Tu" "We" "Th" "Fr" "Sa" "Su" } } ]]> %s """ group { format { """

%s

%s
""" ?year st:call-template(st:calendar, ?year) } } } } where { bind (unnest(xt:iota(?fst, ?rst)) as ?year) } ]]>
template st:enum(?year, ?f, ?l) { format { ft:enum1.html group { format { ft:enum2.html st:call-template(st:monthtab, ?year, ?month) } } } } where { bind (unnest(xt:iota(?f, ?l)) as ?month) } ]]> template st:head(?year) { format { ft:head.html st:plink(concat(?uri, (?year - 1))) us:display(?year - 1) us:display(?year) st:plink(concat(?uri, (?year + 1))) us:display(?year + 1) } } where { bind ("http://ns.inria.fr/sparql-template/y" as ?uri) } ]]> template st:month(?y, ?m) { format { """

%s

    Mo Tu We Th Fr Sa Su \n    
    %s    
    %s
    # additional space when last day is sunday (because \n alone fails)
    %s    
    
""" cal:month(?m) group { if (?n = 1, xt:space(?first - 1), "") xt:pretty(?n) #st:call-template(st:date, ?date) " " if (?jour = "Sunday", "\n", "") ; separator = "" } if (?first + ?days - 1 < 35 , "\n ", "") if (?first + ?days - 1 = 35 && ?last = 7, " ", "") } ; separator = "\n" } where { bind (cal:days(?y, ?m) as ?days) bind (cal:num(xt:day(xsd:date(concat(?y, "-", ?m, "-", 1)))) as ?first) bind (cal:num(xt:day(xsd:date(concat(?y, "-", ?m, "-", ?days)))) as ?last) bind (unnest(xt:iota(?days)) as ?n) bind (xsd:date(concat(?y, "-", ?m, "-", ?n)) as ?date) bind (xt:day(?date) as ?jour) } ]]>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy