RDFGeom2d (RDF 2D Geometry Language)
This Version: 1.0
Current Version: 1.1
Revision 2[1]
Previous Revision: 1
Status: preliminary; comments welcome
June 2003
Chris Goad
cg@mapbureau.com
Table of contents
-
1. Introduction
2. Interpreted geometry
3. Classes representing general concepts
4. The container class
5. Subclasses of Transformation
6. Subclasses of Shape
1. Introduction
RDFGeom2d defines a set of RDF classes and properties for two-dimensional
geometry derived from the geometric part of
SVG.
More specifically, RDFGeom2d is a port of the
coordinate systems,
paths, and
basic shapes
sections of the SVG specification from "raw" XML to RDF. This allows geometric
entities to participate fully in the RDF world: assertions
can be made about geometric objects using vocabularies from the many disciplines
that involve geometry. The initial application is geography, where it is used in conjunction
with the RDFMap vocabulary.
A precedent for importing SVG concepts into RDF is the vocabulary
developed
by Jim Ley.
RDFGeom2d is compliant with the recommendations for
RSS 1.0 modules.
Example
Here is a RDFGeom2d file that contains just one line:
<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:geom2d="http://nurl.org/0/geom2d/1.0/"
>
<geom2d:Line rdf:nodeID="line001">
<geom2d:x1>-123.8327</geom2d:x1>
<geom2d:y1>46.1908</geom2d:y1>
<geom2d:x2>-123.833</geom2d:x2>
<geom2d:y2>46.1829</geom2d:y2>
</geom2d:Line>
</rdf:RDF>
Note that the namespace for RDFGeom2d is http://nurl.org/0/geom2d/1.0/.
"nurl" stands for "Not a URL". nurl.org serves
as a root for URIs that denote entities - like geographical properties and geometric points -
that are not web resources. Of course, in real life, the URI might (or might not) resolve to
a web page as well, but this does not affect the intended denotation of the URI when used
in RDF.
2. Interpreted geometry
The intent of RDFGeom2d is to support representation of interpreted geometry. That is,
an RDFGeom2d resource may serve to denote
a geometric entity in some particular context, such as the centerline of a road
in a geographic application, or a curve in a photographic image.
When interpretations are
assigned to RDFGeom2d resources, properties other than those
contained in the RDFGeom2d specification will apply. For example,
<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:geom2d="http://nurl.org/0/geom2d/1.0/"
xmlns:map="http://nurl.org/0/geography/map/1.0/"
>
<geom2d:Line rdf:nodeID="line001">
<map:isCenterLineOf
rdf:resource="http://example.org/geography/roads/US/Oregon/Astoria/tenth_street"/>
<map:srs resource=
"http://nurl.org/0/geography/SRSCatalog/wgs84"/>
</geom2d:Line>
</rdf:RDF>
asserts that line001 is the center line of Tenth Street in Astoria Oregon,
and that the line is given in WGS84 (latitude/longitude) coordinates.
This is a typical situation; most geometric data in computational applications
has an intended denotation outside of pure geometry.
As a
consequence of interpretation,
shapes have identity that goes beyond their geometrical content.
In pure geometry there is only one point with x coordinate 1 and y coordinate
2; by interpreting geometry, this rule of identity, but nothing else, is sacrified.
Here is the list of properties and classes making up RDFGeom2d. Note that
classes have uppercase names, and properties lowercase.
3. Classes representing general concepts
-
Class: Shape
-
Shape is the class of all 2d geometric forms.
Group, Path, Rect, Circle, Ellipse, Line, Polyline,
Polygon, Point and Box are subclasses of Shape.
-
Class: Transformation
-
Transformation is the class of all functions on
the plane.
Matrix, Translation, Rotation, Scale, SkewX, and SkewY are subclasses of Tranformation.
-
Property: transform domain=Shape; range=Transformation
-
Corresponding SVG attribute: transform.
If a Shape has a transform property, the Shape denotes the geometric form
obtained by applying the given transformation to its content.
4. The container class
-
Class: Group
-
Corresponding SVG element: g.
Group is a container class for Shapes.
A group must have
an elements property, and often has the transform property.
-
Property: elements; domain = Group range = an rdf:Seq of Shapes
-
5. Subclasses of Tranformation
-
Class: Matrix
-
Corresponds to the matrix transform definition in SVG.
A Matrix defines an affine transformation of the plane, given by properties a,b,c,d,e,f:
-
Property:a domain = Matrix; range = decimal
Property:b domain = Matrix; range = decimal
Property:c domain = Matrix; range = decimal
Property:d domain = Matrix; range = decimal
Property:e domain = Matrix; range = decimal
Property:f domain = Matrix; range = decimal
(decimal is the numerical data type defined by XML Schema dataypes)
-
Class: Translation
-
Corresponds to the translate transform definition in SVG.
-
Property:tx domain =Translation; range = decimal
-
Property:ty domain = Translation; range = decimal
- tx,ty specify the amount translation in x and y.
-
Class: Scale
-
Corresponds to the scale transform definition in SVG.
-
Property:sx domain = Scale; range = decimal
-
Property:sy domain = Scale; range = decimal
- sx,sy specify the scaling in x and y.
-
Class: Rotation
-
Corresponds to the rotate transform definition in SVG.
-
Class: SkewX
-
Corresponds to the skewX transform definition in SVG.
-
Class: SkewY
- Corresponds to the skewY transform definition in SVG.
-
Property:angle domain = union of Rotation, SkewX, and SkewY ; range = decimal
- angle specifies the angle in degrees of rotation, skew in x, or skew in y
when applied to Rotation, SkewX, SkewY, respectively.
6. Subclasses of Shape
-
Class: Path
-
Corresponding SVG element:path
A path must have the pathData property, which uses the
syntax defined in SVG to define a straight
or curved line.
-
Property: pathData domain = Path; range = string
-
Corresponding SVG attribute: the d attribute of paths.
For each of the basic shape classes defined below, the meanings of properties are identical to
those of the corresponding attributes in SVG.
-
Class: Rect
-
Corresponding SVG element: rect
-
Property: x range = decimal for the domain Rect
-
Corresponding SVG attribute: x
-
Property: y range = decimal for the domain Rect
-
Corresponding SVG attribute: y
-
Property: width range = decimal for the domain Rect
-
Corresponding SVG attribute: width
-
Property: height range = decimal for the domain Rect
-
Corresponding SVG attribute: height
-
Property: rx range = decimal for the domain Rect
-
Corresponding SVG attribute: rx
-
Property: ry range = decimal for the domain Rect
-
Corresponding SVG attribute: ry
-
Class: Circle
-
Corresponding SVG element: circle
-
Property: cx range = decimal for the domain Circle
-
Corresponding SVG attribute: cx
-
Property: cy range = decimal for the domain Circle
-
Corresponding SVG attribute: cy
-
Property: r range = decimal for the domain Circle
-
Corresponding SVG attribute: r
-
Class: Ellipse
-
Corresponding SVG element: ellipse
-
Property: cx range = decimal for the domain Ellipse
-
Corresponding SVG attribute: cx
-
Property: cy range = decimal for the domain Ellipse
-
Corresponding SVG attribute: cy
-
Property: rx range = decimal for the domain Ellipse
-
Corresponding SVG attribute: rx
-
Property: ry range = decimal for the domain Ellipse
-
Corresponding SVG attribute: ry
-
Class: Line
-
Corresponding SVG element: line
-
Property: x1 range = decimal for the domain Line
-
Corresponding SVG attribute: x1
-
Property: y1 range = decimal for the domain Line
-
Corresponding SVG attribute: y1
-
Property: x2 range = decimal for the domain Line
-
Corresponding SVG attribute: x2
-
Property: y2 range = decimal for the domain Line
-
Corresponding SVG attribute: y2
-
Class: Polyline
-
Corresponding SVG element: polyline
-
Property: points range = rdf:Seq containing values of type Point, for the domain Polyline
-
Corresponding SVG attribute: points
-
Polyline example
-
Class: Polygon
-
Corresponding SVG element: polygon
-
Property: points range = rdf:Seq containing values of type Point, for the domain Polygon
-
Corresponding SVG attribute: points
-
Property: fillRule; domain = Shape range = one of the strings "nonzero" or "evenodd"
-
Corresponding SVG attribute:
fill-rule
The fillRule property, if present, signifies that the shape to which it appies
denotes an area rather than a curve. The rule by which the area is determined
is the same as specified by SVG for the
fill-rule property.
-
Polygon example
-
Class: Point
-
Property: x; range = decimal for the domain Point
-
Property: y; range = decimal for the domain Point
- Class:Box
-
Box constitutes an alternate formulation of the SVG
rect element,
without the option of rounding corners.
- Property: xmin; range = decimal for the domain Box
- Property: xmax; range = decimal for the domain Box
- Property: ymin; range = decimal for the domain Box
- Property: ymax; range = decimal for the domain Box
-
When applied to a box, xmin,ymin (resp. xmax,ymax)
specify the minimum (resp. maximum) values of the coordinates of points within
the box.
Copyright © 2003,
Map Bureau. All rights reserved.