Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft to include styles for features #418

Draft
wants to merge 15 commits into
base: geosparql-1.3
Choose a base branch
from
2 changes: 2 additions & 0 deletions spec/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ include::sections/11-geometry_extension.adoc[]

include::sections/12-geometry_topology_extension.adoc[]

include::sections/12a-style_extension.adoc[]

include::sections/13-rdfs_entailment_extension.adoc[]

include::sections/14-query_rewrite_extension.adoc[]
Expand Down
165 changes: 165 additions & 0 deletions spec/sections/12a-style_extension.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
[#geometry_style_extension]
== Geometry Style Extension

This section establishes the introduction of geometry styles into the GeoSPARQL standard.

Geometries are visualized differently under different circumstances and in different map visualization contexts, as defined by legal or preferential, e.g. community-driven efforts.

A geometry style is hereby defined as a set of instructions representing the geometry in a given context.

This extension contains and represents the essential elements of the OGC Styled layer and OGC Symbology Encoding standar description standard without implementing the rules for their application.
The latter might be implemented as SHACL or reasoning rules and, for now, fall out of the scope of GeoSPARQL.

==== Class: geo:Style

The class http://www.opengis.net/ont/geosparql#Style[`geo:Style`] depicts the abstract representation of the style of a geospatial feature and is defined by the following:

```turtle
geo:Style
a rdfs:Class, owl:Class ;
rdfs:isDefinedBy geo: ;
skos:prefLabel "Style"@en ;
skos:definition "A representation of a way to style a geospatial feature on e.g. a map representation."@en ;
skos:note "A Feature Style expresses one or many style representations which can be used to display a spatial object in a suitable rendering."@en ;
.
```

[#req_geostyle_style-class]
|===
| *Req {counter:req}* Implementations shall allow the RDFS class <<Class: geo:Style, `geo:Style`>> to be used in SPARQL graph patterns.
|http://www.opengis.net/spec/geosparql/1.0/req/core/style-class[`http://www.opengis.net/spec/geosparql/1.0/req/core/style-class`]
|===

==== Class: geo:StyleIcon

The class http://www.opengis.net/ont/geosparql#StyleIcon[`geo:StyleIcon`] depicts the abstract representation of the image used by a style of a geospatial feature and is defined by the following:

```turtle
geo:StyleIcon
a rdfs:Class, owl:Class ;
rdfs:isDefinedBy geo: ;
skos:prefLabel "StyleIcon"@en ;
skos:definition "A representation of an image which is used in representations of a geo:Style ."@en ;
.
```

[#req_geostyle_styleicon-class]
|===
| *Req {counter:req}* Implementations shall allow the RDFS class <<Class: geo:StyleIcon, `geo:StyleIcon`>> to be used in SPARQL graph patterns.
|http://www.opengis.net/spec/geosparql/1.0/req/core/styleicon-class[`http://www.opengis.net/spec/geosparql/1.0/req/core/styleicon-class`]
|===

==== Property: geo:hasStyle

The property http://www.opengis.net/ont/geosparql#hasStyle[`geo:hasStyle`] links a <<Class: geo:SpatialObject, `geo:SpatialObject`>> to a <<Class: geo:Style, `geo:Style`>> representation.

```turtle
ex:mystyle rdf:type geo:Style .
ex:myfeature rdf:type geo:Feature .
ex:myfeature_geom rdf:type sf:Point .
ex:myfeature geo:hasGeometry ex:myfeature_geom .
ex:myfeature geo:hasStyle geo:mystyle .
.
```

[#req_geostyle_hasstyle-property]
|===
| *Req {counter:req}* Implementations shall allow the property <<Property: geo:hasStyle, `geo:hasStyle`>> to be used in SPARQL graph patterns.
|http://www.opengis.net/spec/geosparql/1.0/req/geostyle/hastyle-property[`http://www.opengis.net/spec/geosparql/1.0/req/geostyle/hasstyle-property`]
|===

==== Property: geo:hasIcon

The property http://www.opengis.net/ont/geosparql#hasIcon[`geo:hasIcon`] links a <<Class: geo:Style, `geo:Style`>> to a <<Class: geo:StyleIcon, `geo:StyleIcon`>> representation.

```turtle
ex:mystyle rdf:type geo:Style.
ex:myfeature rdf:type geo:Feature .
ex:myfeature_geom rdf:type sf:Point .
ex:myfeature geo:hasGeometry ex:myfeature_geom .
ex:myfeature geo:hasStyle geo:mystyle .
geo:mystyle geo:hasIcon geo:mystyle_icon .
geo:mystyle_icon geo:markerIcon "<svg>....</svg>"^^geo:svgLiteral .
```

[#req_geostyle_hasstyle-property]
|===
| *Req {counter:req}* Implementations shall allow the property <<Property: geo:hasIcon, `geo:hasIcon`>> to be used in SPARQL graph patterns.
|http://www.opengis.net/spec/geosparql/1.0/req/geostyle/hastyle-property[`http://www.opengis.net/spec/geosparql/1.0/req/geostyle/hasstyle-property`]
|===

==== Property: geo:markerIcon

The property http://www.opengis.net/ont/geosparql#markerIcon[`geo:markerIcon`] links a <<Class: geo:Style, `geo:Style`>> to a representation of an icon which can be used on map representation as a marker or along or within a geometry. The value of this property may either be an SVG representation in a geo:svgLiteral or a link to an image representation, represented as an xsd:anyURI.

```turtle
ex:mystyle rdf:type geo:Style .
ex:mystyle geo:hasIcon ex:mystyle_icon .
ex:mystyle_icon geo:markerIcon "<svg>...</svg>"^^geo:svgLiteral .
ex:mystyle_icon geo:markerIcon "http://......jpg"^^xsd:anyURI .
```

==== Property: geo:rotation

The property http://www.opengis.net/ont/geosparql#rotation[`geo:rotation`] defines the rotation of a StyleIcon instance in degrees, as an xsd:double literal.

```turtle
ex:mystyle rdf:type geo:Style .
ex:mystyle geo:hasIcon ex:mystyle_icon .
ex:mystyle_icon geo:rotation "170.0"^^xsd:double .
```

==== Property: geo:asGeoCSS

The property http://www.opengis.net/ont/geosparql#asGeoCSS[`geo:asGeoCSS`] links a <<Class: geo:Style, `geo:Style`>> to a serialization of the style in CSS rendered in a geo:geocssLiteral.

```turtle
ex:mystyle rdf:type geo:Style .
ex:mystyle geo:asGeoCSS "stroke:black,fill:red,stroke-width:3,fill-opacity:0.6"^^geo:geocssLiteral
.
```

[#req_geostyle_iconcss-property]
|===
| *Req {counter:req}* Implementations shall allow the properties <<Property: geo:markerIcon, `geo:markerIcon`>> and <<Property: geo:asGeoCSS, `geo:asGeoCSS`>> to be used in SPARQL graph patterns.
|http://www.opengis.net/spec/geosparql/1.0/req/geostyle/iconcss-property[`http://www.opengis.net/spec/geosparql/1.0/req/geostyle/iconcss-property`]
|===

==== Datatype: geo:geocssLiteral

The literal http://www.opengis.net/ont/geosparql#geocssLiteral[`geo:geocssLiteral`] encodes a subset of CSS statements that apply to geometry representations.
The subset of CSS expressions limited to the statements which apply to SVG representations.
In particular, these are the following attributes and the special marker attribute which indicates a marker shape as Well-Known Name (see Symbology Encoding standard)

```css
fill: color
stroke: color
stroke-width: number
fill-opacity: number
opacity: number
dashArray: array of numbers
markertype: square | circle | triangle | star | cross | x
```
This allows for the modification of all visible parts of a geometry on a map, as defined in the OGC Styled layer descriptor standard.

[#req_geostyle_geocss-literal]
|===
| *Req {counter:req}* All RDFS Literals of type <<RDFSDatatype: geo:geocssLiteral, `geo:geocssLiteral`>> shall consist of a set of definitions of cascading stylesheets which are meant to modify the given geometry while displayed in a viewer application.
|http://www.opengis.net/spec/geosparql/1.0/req/geostyle/geocss-literal[`http://www.opengis.net/spec/geosparql/1.0/req/geostyle/geocss-literals`]
|===

==== Datatype: geo:svgLiteral

The literal http://www.opengis.net/ont/geosparql#svgLiteral[`geo:svgLiteral`] encodes an SVG representation in plain text.

```svg
ex:mystyle geo:markerIcon "<svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"50\" cy=\"50\" r=\"50\"/></svg>"^^geo:svgLiteral .
```
[#req_geostyle_svg-literal]
|===
| *Req {counter:req}* All RDFS Literals of type <<RDFSDatatype: geo:svgLiteral, `geo:svgLiteral`>> shall consist of a Scalable Vector Graphics expression (SVG), which may be used to visualize geometries on a given map representation.
|http://www.opengis.net/spec/geosparql/1.0/req/geostyle/svg-literal[`http://www.opengis.net/spec/geosparql/1.0/req/geostyle/svg-literals`]
|===