# Window functions: the TripleTrail vocabulary at http://w3id.org/tripletrail/window#
# Written by ns/generate.py in the tripletrail-website repository; see https://tripletrail.eu/ns/window/
@prefix win: <http://w3id.org/tripletrail/window#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .

<http://w3id.org/tripletrail/window> a owl:Ontology ;
    rdfs:label "TripleTrail window functions"@en ;
    rdfs:comment "SQL window functions over the rows of a group graph pattern, in SERVICE <http://w3id.org/tripletrail/window>: rankings, running totals, lag and lead, partitioned and ordered as in SQL's OVER (PARTITION BY … ORDER BY …)."@en ;
    rdfs:seeAlso <https://tripletrail.eu/ns/window/> .

win:partitionBy a rdf:Property ;
    rdfs:label "partitionBy" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:orderBy a rdf:Property ;
    rdfs:label "orderBy" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:orderByDesc a rdf:Property ;
    rdfs:label "orderByDesc" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:rows a rdf:Property ;
    rdfs:label "rows" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:rowNumber a sd:Function ;
    rdfs:label "rowNumber" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:rank a sd:Function ;
    rdfs:label "rank" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:denseRank a sd:Function ;
    rdfs:label "denseRank" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:percentRank a sd:Function ;
    rdfs:label "percentRank" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:cumeDist a sd:Function ;
    rdfs:label "cumeDist" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:ntile a sd:Function ;
    rdfs:label "ntile" ;
    rdfs:comment "Buckets 1 to n, the first ones one row larger when the rows do not divide evenly."@en ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:firstValue a sd:Function ;
    rdfs:label "firstValue" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:lastValue a sd:Function ;
    rdfs:label "lastValue" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:sum a sd:Function ;
    rdfs:label "sum" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:avg a sd:Function ;
    rdfs:label "avg" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:min a sd:Function ;
    rdfs:label "min" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:max a sd:Function ;
    rdfs:label "max" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:count a sd:Function ;
    rdfs:label "count" ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:lag a sd:Function ;
    rdfs:label "lag" ;
    rdfs:comment "The value offset rows (1 by default) before or after in the partition, else the default (unbound by default)."@en ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
win:lead a sd:Function ;
    rdfs:label "lead" ;
    rdfs:comment "The value offset rows (1 by default) before or after in the partition, else the default (unbound by default)."@en ;
    rdfs:isDefinedBy <http://w3id.org/tripletrail/window> .
