12
GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Embed Size (px)

Citation preview

Page 1: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

GEOSPARQL IN PARLIAMENT

Terra Cognita

Dave Kolas

November 12, 2012

Page 2: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Parliament

Parliament In continuous customer use for ~10 years

(Originally DAML-DB) Triple Store with SPARQL support Implemented as a persistence layer for

Jena/Sesame Includes spatial and temporal

indexing/processing Open source!

http://parliament.semwebcentral.org/

Page 3: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

3

Design

JosekiJoseki Spatial Index Processor

Spatial Index Processor

Parliament GraphParliament Graph

ModelModel

IndexingGraphIndexingGraph

Spatial Index(deegree)

Spatial Index(deegree)

Parliament (C++)Parliament (C++)

Part of Jena

Parliament Framework

External Storage

Temporal Index Processor

Temporal Index Processor

Temporal Index(BDB)

Temporal Index(BDB)

Page 4: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Parliament’s Indexing Strategy

Applications often require efficient statement insertion

Goal: Balanced insertion, query performance, and space required

Parliament stores triples using two components: Resource dictionary Statement table

Additional indices can be added for specific purposes and vocabularies Spatial Index Temporal Index

Page 5: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Parliament’s Spatial Index

First created before GeoSPARQL, used terms derived from GeoRSS

Now supports most of GeoSPARQL specification

Index is based on R tree in deegree library (deegree.org)

Approach: Explicit geometries, no qualitative

reasoning Optimization so far on triple patterns, not

functions

Page 6: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

GeoSPARQL Implementation

Parliament supports: Both GML and WKT literals, and can

interchange between them All three vocabularies for spatial relations

(simple features, rcc8, and Egenhofer) Triple-pattern spatial relations Filter functions for spatial relations and spatial

combinations A large number of coordinate reference

systems RDFS Reasoning

Page 7: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

GeoSPARQL Missing Pieces

The following features of GeoSPARQL are not currently implemented in Parliement: Feature-to-feature spatial relations via

query rewriting Optimization on FILTER functions Qualitative reasoning Standard properties for Geometry

dimension, spatialDimension, isEmpty, isSimple, hasSerialization

Function getSRID

Page 8: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Parliament’s Temporal Index Parallel to spatial index Terminology taken from OWL-Time (using

Allen relations for overlapping intervals, etc)

Uses Java version of Berkeley DB for persisting index

Page 9: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Build Process Improvements

Until very recently, GeoSPARQL support was on a branch, and required building for your desired platform

GeoSPARQL support has been merged into the trunk and prebuilt binaries are now available for Windows, Mac, and Linux

Parliament build structure has been improved again to require fewer dependencies

Page 10: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Examples

Data on geosparql.bbn.com Data sets:

USGS data in Atlanta, GA Rails, Rivers

Geonames data Administrative areas Points for buildings, such as schools

Page 11: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Example Query 1

Find All Schools within GeorgiaSELECT DISTINCT ?school

WHERE {

GRAPH <http://example.org/data> {

# get Georgia geometry

gu:_1705317

geo:hasGeometry ?ga_geo .

# get schools within Georgia

?school a gn:Feature ;

geo:hasGeometry ?school_geo ;

gn:featureCode gn:S.SCH .

?school_geo geo:sfWithin ?ga_geo .

}

}

Page 12: GEOSPARQL IN PARLIAMENT Terra Cognita Dave Kolas November 12, 2012

Example Query 2

Find Geonames features within 10k of the Nixon Grove School

SELECT ?x

WHERE {

GRAPH <http://www.geonames.org> {

<http://sws.geonames.org/4212826/> geo:hasGeometry ?geo1 .

?geo1 geo:asWKT ?wkt1 .

BIND (geof:buffer(?wkt1, 10000, units:metre) as ?buff) .

?x geo:hasGeometry ?geo2 .

?geo2 geo:asWKT ?wkt2 .

FILTER (geof:sfContains(?buff, ?wkt2))

}

}