This specification details a model for representing Intervals.
This document describes a simple Web vocabulary for representing ordered sets of values with optional lower and upper boundaries. The concept of an Interval used herein is generally identical to that used in mathematics to represent a totally ordered set of values that lie between a lower boundary limit and an upper boundary limit. Each Interval MAY be defined such that either or both of the boundary limits are included ("closed") or excluded ("open") from the actual set of values represented.
For instance, using standard mathematical notation, the range of
non-negative integer values between 0 and 10, including the 0 and
the 10 itself, can be represented as [0,10]
, while
the a range that excludes those boundaries can be represented as
(0,10)
.
Using the vocabulary defined here, the same value ranges can be represented within Linked Data applications respectively as:
{ "@context": "http://ns.jasnell.me/interval#", "@type": "ClosedInterval", "lower": 0, "upper": 10 }
and,
{ "@context": "http://ns.jasnell.me/interval#", "@type": "OpenInterval", "lower": 0, "upper": 10 }
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [[!RFC2119]].
{ "@context": "http://ns.jasnell.me/interval#", "@type": "ClosedInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } }
{ "@context": "http://ns.jasnell.me/interval#", "@type": "OpenInterval", "lower": 0, "upper": 10, "step": 1 }
Class | Description | Example | |
---|---|---|---|
Interval | URI: | http://ns.jasnell.me/interval#Interval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "ClosedInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval |
||
Notes: |
Represents an interval (or range) of values with optional upper
and lower bounds. The lower or upper bounds may each be "closed"
or "open". A "closed" (inclusive) bound indicates that the given
value is part of the interval while an "open" (exclusive) bound
does not include the value. The The value types of an Interval's |
||
Properties: |
upper |
lower |
step
|
||
OpenInterval | URI: | http://ns.jasnell.me/interval#OpenInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "OpenInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-open |
||
Notes: |
A subclass of |
||
Properties: |
upper |
lower |
step
|
||
ClosedInterval | URI: | http://ns.jasnell.me/interval#ClosedInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "ClosedInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-closed |
||
Notes: |
A subclass of |
||
Properties: |
upper |
lower |
step
|
||
OpenClosedInterval | URI: | http://ns.jasnell.me/interval#OpenClosedInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "OpenClosedInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-open-closed |
||
Notes: |
A subclass of |
||
Properties: |
upper |
lower |
step
|
||
ClosedOpenInterval | URI: | http://ns.jasnell.me/interval#ClosedOpenInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "ClosedOpenInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, "upper": { "@value": "2015-01-03T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-closed-open |
||
Notes: |
A subclass of |
||
Properties: |
upper |
lower |
step
|
||
LeftOpenInterval | URI: | http://ns.jasnell.me/interval#LeftOpenInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "LeftOpenInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-left-open |
||
Notes: |
A subclass of |
||
Properties: |
lower |
step
|
||
LeftClosedInterval | URI: | http://ns.jasnell.me/interval#LeftClosedInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "LeftClosedInterval", "lower": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-left-closed |
||
Notes: |
A subclass of |
||
Properties: |
lower |
step
|
||
RightOpenInterval | URI: | http://ns.jasnell.me/interval#RightOpenInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "RightOpenInterval", "upper": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-right-open |
||
Notes: |
A subclass of |
||
Properties: |
upper |
step
|
||
RightClosedInterval | URI: | http://ns.jasnell.me/interval#RightClosedInterval |
{ "@context": "http://ns.jasnell.me/interval#", "@type": "RightClosedInterval", "upper": { "@value": "2015-01-02T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } } |
Microformats Class: | h-interval-right-closed |
||
Notes: |
A subclass of |
||
Properties: |
upper |
step
|
||
EmptyInterval | URI: | http://ns.jasnell.me/interval#EmptyInterval |
|
Microformats Class: | h-interval-empty |
||
Notes: |
An instance of |
||
UnboundedInterval | URI: | http://ns.jasnell.me/interval#UnboundedInterval |
|
Microformats Class: | h-interval-unbounded |
||
Notes: |
An instance of |
Term | Description | |
---|---|---|
upper | URI: | http://ns.jasnell.me/interval#upper |
Microformats Class: | {prefix}-upper (e.g. dt-upper , p-upper , etc) |
|
Notes: |
Specifies the upper boundary of an |
|
Domain: | Interval |
|
Range: | any |
|
Functional: | True
| |
lower | URI: | http://ns.jasnell.me/interval#lower |
Microformats Class: | {prefix}-lower (e.g. dt-lower , p-lower , etc) |
|
Notes: |
Specifies the lower boundary of an |
|
Domain: | Interval |
|
Range: | any |
|
Functional: | True
| |
step | URI: | http://ns.jasnell.me/interval#step |
Microformats Class: | {prefix}-step (e.g. p-step , etc) |
|
Notes: |
By default, an The value of the |
|
Domain: | Interval |
|
Range: | any |
|
Functional: | True
|
The following table identifies the appropriate XML Schema data type values
for step
for a selected range of Interval boundary types.
Wherever a specific data type is identified, all derived types MAY also be
used.
upper/lower Boundary Type | step Type | |
---|---|---|
xsd:duration |
xsd:duration |
|
xsd:dateTime |
xsd:duration |
|
xsd:nonNegativeInteger |
Interpreted as number of seconds. | |
xsd:time |
xsd:duration |
|
xsd:nonNegativeInteger |
Interpreted as number of seconds. | |
xsd:date |
xsd:duration |
|
xsd:nonNegativeInteger |
Interpreted as number of seconds. | |
xsd:gYearMonth |
xsd:duration |
Limited to durations of year and month only |
xsd:nonNegativeInteger |
Interpreted as number of months. | |
xsd:gYear |
xsd:duration |
Limited to durations of year only |
xsd:nonNegativeInteger |
Interpreted as number of years. | |
xsd:gMonthYear |
xsd:duration |
Limited to durations of year and month only |
xsd:nonNegativeInteger |
Interpreted as number of months. | |
xsd:gDay |
xsd:duration |
Limited to durations of days only |
xsd:nonNegativeInteger |
Interpreted as number of days. | |
xsd:gMonth |
xsd:duration |
Limited to durations of months only |
xsd:nonNegativeInteger |
Interpreted as number of months. | |
xsd:float |
xsd:float >= 0 |
|
xsd:nonNegativeInteger |
||
xsd:double |
xsd:double >= 0 |
|
xsd:nonNegativeInteger |
||
xsd:decimal |
xsd:decimal >= 0 |
|
xsd:nonNegativeInteger |
@prefix : <http://ns.jasnell.me/interval#> . @prefix r: <http://ns.jasnell.me/interval#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://ns.jasnell.me/interval#> . <http://ns.jasnell.me/interval#> a owl:Ontology; rdfs:comment "A vocabulary for representing intervals"@en . :lower a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:comment "The lower bound of an interval"@en; rdfs:domain :Interval . :upper a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:comment "The upper bound of an interval"@en; rdfs:domain :Interval . :step a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:comment "Specifies the significant step between values in the interval."@en; rdfs:domain :Interval . :Interval a owl:Class ; rdfs:comment "Represents an interval of values with optional upper and lower bounds"@en . :OpenInterval a owl:Class ; rdfs:comment "An interval open at both ends"@en ; rdfs:subClassOf :Interval . :ClosedInterval a owl:Class ; rdfs:comment "An interval closed at both ends"@en ; rdfs:subClassOf :Interval . :OpenClosedInterval a owl:Class ; rdfs:comment "An interval open at the lower bound, closed at the upper "@en ; rdfs:subClassOf :Interval . :ClosedOpenInterval a owl:Class ; rdfs:comment "An interval open at the upper bound, closed at the lower "@en ; rdfs:subClassOf :Interval. :LeftOpenInterval a owl:Class ; rdfs:comment "An interval open on the lower bound, with no upper bound"@en ; rdfs:subClassOf :Interval, [ a owl:Restriction ; owl:onProperty :upper ; owl:cardinality "0"^^xsd:nonNegativeInteger . ] . :LeftClosedInterval a owl:Class ; rdfs:comment "An interval closed on the lower bound, with no upper bound"@en ; rdfs:subClassOf :Interval, [ a owl:Restriction ; owl:onProperty :upper ; owl:cardinality "0"^^xsd:nonNegativeInteger . ] . :RightOpenInterval a owl:Class ; rdfs:comment "An interval open on the upper bound, with no lower bound"@en ; rdfs:subClassOf :Interval, [ a owl:Restriction ; owl:onProperty :lower ; owl:cardinality "0"^^xsd:nonNegativeInteger . ] . :RightClosedInterval a owl:Class ; rdfs:comment "An interval closed on the upper bound, with no lower bound"@en ; rdfs:subClassOf :Interval, [ a owl:Restriction ; owl:onProperty :lower ; owl:cardinality "0"^^xsd:nonNegativeInteger . ] . :EmptyInterval a :Interval ; rdfs:comment "The empty interval" . :UnboundedInterval a :Interval ; rdfs:comment "An interval that is unbound at either end (contains all possible values)" . :PositiveIntegers a :LeftOpenInterval ; rdfs:comment "Represents all positive integers greater than zero" ; :lower "0"^^xsd:nonNegativeInteger ; :step "1"^^xsd:nonNegativeInteger . :NonNegativeIntegers a :LeftClosedInterval ; rdfs:comment "Represents all non-negative integers greater than or equal to zero" ; :lower "0"^^xsd:nonNegativeInteger ; :step "1"^^xsd:nonNegativeInteger . :NegativeIntegers a :RightClosedInterval ; rdfs:comment "Represents all negative integers" ; :upper "0"^^xsd:nonPositiveInteger ; :step "1"^^xsd:nonNegativeInteger . :PositiveFloats a :LeftOpenInterval ; rdfs:comment "Represents all positive floating point numbers greater than zero" ; :lower "0"^^xsd:float. :NonNegativeFloats a :LeftClosedInterval ; rdfs:comment "Represents all positive floating point numbers greater than or equal to zero" ; :lower "0"^^xsd:float . :NegativeFloats a :RightClosedInterval ; rdfs:comment "Represents all negative floating point numbers" ; :upper "0"^^xsd:float . :PositiveDoubles a :LeftOpenInterval ; rdfs:comment "Represents all positive double precision numbers greater than zero" ; :lower "0"^^xsd:double. :NonNegativeDoubles a :LeftClosedInterval ; rdfs:comment "Represents all positive double precision numbers greater than or equal to zero" ; :lower "0"^^xsd:double . :NegativeDoubles a :RightClosedInterval ; rdfs:comment "Represents all negative double precision numbers" ; :upper "0"^^xsd:double . :PositiveDecimals a :LeftOpenInterval ; rdfs:comment "Represents all positive xsd:decimal numbers greater than zero" ; :lower "0"^^xsd:decimal. :NonNegativeDecimals a :LeftClosedInterval ; rdfs:comment "Represents all positive xsd:decimal numbers greater than or equal to zero" ; :lower "0"^^xsd:decimal . :NegativeDecimals a :RightClosedInterval ; rdfs:comment "Represents all negative xsd:decimal numbers" ; :upper "0"^^xsd:decimal .