Strabon

changeset 1001:d944f100abbc

insert GeoSPARQL class hierarchy at store time
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Apr 05 22:26:31 2013 +0300 (2013-04-05)
parents 84881daa5d6c
children 033b5611e0e4
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 22:18:02 2013 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 22:26:31 2013 +0300
     1.3 @@ -57,6 +57,7 @@
     1.4  	
     1.5  	@Override
     1.6  	public void startRDF() {
     1.7 +		insertGeoSPARQLClassHierarchy();
     1.8  		insertSimpleFeaturesClassHierarchy();
     1.9  	}
    1.10  	
    1.11 @@ -312,7 +313,28 @@
    1.12  		numTriples++;
    1.13  	}
    1.14  
    1.15 +	/**
    1.16 +	 * Materializes the RDF class hierarchy of Simple Features
    1.17 +	 */
    1.18  	protected void insertSimpleFeaturesClassHierarchy() {
    1.19 +		writeTriple(SimpleFeatures.Geometry, TYPE, RDFS.CLASS.stringValue());
    1.20 +		writeTriple(SimpleFeatures.Point, TYPE, RDFS.CLASS.stringValue());
    1.21 +		writeTriple(SimpleFeatures.Curve, TYPE, RDFS.CLASS.stringValue());
    1.22 +		writeTriple(SimpleFeatures.Surface, TYPE, RDFS.CLASS.stringValue());
    1.23 +		writeTriple(SimpleFeatures.GeometryCollection, TYPE, RDFS.CLASS.stringValue());
    1.24 +		writeTriple(SimpleFeatures.LineString, TYPE, RDFS.CLASS.stringValue());
    1.25 +		writeTriple(SimpleFeatures.Polygon, TYPE, RDFS.CLASS.stringValue());
    1.26 +		writeTriple(SimpleFeatures.PolyhedralSurface, TYPE, RDFS.CLASS.stringValue());
    1.27 +		writeTriple(SimpleFeatures.MultiSurface, TYPE, RDFS.CLASS.stringValue());
    1.28 +		writeTriple(SimpleFeatures.MultiCurve, TYPE, RDFS.CLASS.stringValue());
    1.29 +		writeTriple(SimpleFeatures.MultiPoint, TYPE, RDFS.CLASS.stringValue());
    1.30 +		writeTriple(SimpleFeatures.Line, TYPE, RDFS.CLASS.stringValue());
    1.31 +		writeTriple(SimpleFeatures.LinearRing, TYPE, RDFS.CLASS.stringValue());
    1.32 +		writeTriple(SimpleFeatures.Triangle, TYPE, RDFS.CLASS.stringValue());
    1.33 +		writeTriple(SimpleFeatures.TIN, TYPE, RDFS.CLASS.stringValue());
    1.34 +		writeTriple(SimpleFeatures.MultiPolygon, TYPE, RDFS.CLASS.stringValue());
    1.35 +		writeTriple(SimpleFeatures.MultiLineString, TYPE, RDFS.CLASS.stringValue());
    1.36 +		
    1.37  		// first level 
    1.38  		writeTriple(SimpleFeatures.Point, SUBCLASS, SimpleFeatures.Geometry);
    1.39  		writeTriple(SimpleFeatures.Curve, SUBCLASS, SimpleFeatures.Geometry);
    1.40 @@ -364,6 +386,20 @@
    1.41  		writeTriple(SimpleFeatures.MultiLineString, SUBCLASS, SimpleFeatures.Geometry);
    1.42  	}
    1.43  	
    1.44 +	/**
    1.45 +	 * Materializes the RDF class hierarchy of GeoSPARQL
    1.46 +	 */
    1.47 +	protected void insertGeoSPARQLClassHierarchy() {
    1.48 +		writeTriple(GeoSPARQL.SpatialObject, TYPE, RDFS.CLASS.stringValue());
    1.49 +		writeTriple(GeoSPARQL.Feature, TYPE, RDFS.CLASS.stringValue());
    1.50 +		writeTriple(GeoSPARQL.Geometry, TYPE, RDFS.CLASS.stringValue());
    1.51 +		
    1.52 +		
    1.53 +		writeTriple(GeoSPARQL.Feature, SUBCLASS, GeoSPARQL.SpatialObject);
    1.54 +		writeTriple(GeoSPARQL.Geometry, SUBCLASS, GeoSPARQL.SpatialObject);
    1.55 +		
    1.56 +	}
    1.57 +	
    1.58  	public static void main(String[] args) throws Exception {
    1.59  		NTriplesParser parser = new NTriplesParser();
    1.60  		parser.setVerifyData(true);