Strabon

changeset 1003:53ff1f55fa01

moved GeoSPARQL geometry properties from GeoConstants to GeoSPARQL
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Apr 05 22:47:32 2013 +0300 (2013-04-05)
parents 033b5611e0e4
children 8fb408631e75
files constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java constants/src/main/java/eu/earthobservatory/vocabulary/GeoSPARQL.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java
line diff
     1.1 --- a/constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java	Fri Apr 05 22:33:57 2013 +0300
     1.2 +++ b/constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java	Fri Apr 05 22:47:32 2013 +0300
     1.3 @@ -82,49 +82,6 @@
     1.4  	public static final String GML_OGC					= "http://www.opengis.net/gml";
     1.5  	
     1.6  	
     1.7 -	
     1.8 -	
     1.9 -	/**																		*
    1.10 -	 *  						URIs										*
    1.11 -	 * 																		*/
    1.12 -	
    1.13 -	/**																*
    1.14 -	 *  GeoSPARQL	Version 1.0.1	Document#  11-052r4 			*
    1.15 -	 *	http://schemas.opengis.net/geosparql/geosparql-1_0_1.zip	*/
    1.16 -
    1.17 -	/** The following GeoSPARQL classes and properties are       
    1.18 -	 *  commented out because they are not currently used.			
    1.19 - 	 */
    1.20 -	
    1.21 -	/**
    1.22 -	 * The URIs for GeoSPARQL classes
    1.23 -	 */
    1.24 -/*	public static final String SpatialObject			=  GEO + "SpatialObject";
    1.25 -	public static final String Geometry				    =  GEO + "Geometry";
    1.26 -	public static final String Feauture					=  GEO + "Feature";
    1.27 -*/	
    1.28 -		
    1.29 -	/**
    1.30 -	 * The URIs for GeoSPARQL properties
    1.31 -	 */
    1.32 -	public static final String GEOhasGeometry			=  GeoSPARQL.hasGeometry;
    1.33 -	public static final String GEOdefaultGeometry		=  GeoSPARQL.hasDefaultGeometry;
    1.34 -	public static final String GEOdimension				=  GEO + "dimension";
    1.35 -	public static final String GEOcoordinateDimension	=  GEO + "coordinateDimension";
    1.36 -	public static final String GEOspatialDimension	    =  GEO + "spatialDimension";
    1.37 -	public static final String GEOisEmpty				=  GEO + "isEmpty";
    1.38 -	public static final String GEOisSimple				=  GEO + "isSimple";
    1.39 -	public static final String GEOhasSerialization		=  GEO + "hasSerialization";
    1.40 -	public static final String GEOasWKT					=  GEO + "asWKT";
    1.41 -	public static final String GEOasGML					=  GEO + "asGML";
    1.42 -
    1.43 -	
    1.44 -	
    1.45 -	/**																		*
    1.46 -	 *  						URIs for datatypes							*
    1.47 -	 * 																		*/
    1.48 -	
    1.49 -	
    1.50  	/**
    1.51  	 * The URI for the datatype SemiLinearPointSet
    1.52  	 * (linear constraint-based representation of geometries)
     2.1 --- a/constants/src/main/java/eu/earthobservatory/vocabulary/GeoSPARQL.java	Fri Apr 05 22:33:57 2013 +0300
     2.2 +++ b/constants/src/main/java/eu/earthobservatory/vocabulary/GeoSPARQL.java	Fri Apr 05 22:47:32 2013 +0300
     2.3 @@ -10,6 +10,7 @@
     2.4  package eu.earthobservatory.vocabulary;
     2.5  
     2.6  
     2.7 +
     2.8  /**
     2.9   * GeoSPARQL vocabulary, version 1.0.1, Document  11-052r4
    2.10   * <a>http://schemas.opengis.net/geosparql/geosparql-1_0_1.zip</a>
    2.11 @@ -18,25 +19,39 @@
    2.12   */
    2.13  public class GeoSPARQL {
    2.14  	
    2.15 +	/**
    2.16 +	 * Namespaces
    2.17 +	 */
    2.18  	public static final String ONTOLOGY_NAMESPACE 	= "http://www.opengis.net/ont/geosparql#";
    2.19  	public static final String FUNCTION_NAMESPACE 	= "http://www.opengis.net/def/function/geosparql/";
    2.20  	public static final String RULE_NAMESPACE 		= "http://www.opengis.net/def/rule/geosparql/";
    2.21  	
    2.22 +	/**
    2.23 +	 * Prefixes
    2.24 +	 */
    2.25  	public static final String GEO  = ONTOLOGY_NAMESPACE;
    2.26  	public static final String GEOF = FUNCTION_NAMESPACE;
    2.27  	public static final String GEOR = RULE_NAMESPACE;
    2.28  	
    2.29  	/**
    2.30 -	 *  Defined Classes
    2.31 +	 *  Geometry classes
    2.32  	 */
    2.33  	public static final String SpatialObject 		= GEO + "SpatialObject";
    2.34  	public static final String Feature 				= GEO + "Feature";
    2.35  	public static final String Geometry				= GEO + "Geometry";
    2.36  	
    2.37  	/**
    2.38 -	 * Defined geometry properties
    2.39 +	 * Geometry properties
    2.40  	 */
    2.41  	public static final String hasGeometry 			= GEO + "hasGeometry";
    2.42  	public static final String hasDefaultGeometry	= GEO + "hasDefaultGeometry";
    2.43 +	public static final String dimension			= GEO + "dimension";
    2.44 +	public static final String coordinateDimension	= GEO + "coordinateDimension";
    2.45 +	public static final String spatialDimension		= GEO + "spatialDimension";
    2.46 +	public static final String isEmpty				= GEO + "isEmpty";
    2.47 +	public static final String isSimple				= GEO + "isSimple";
    2.48 +	public static final String hasSerialization		= GEO + "hasSerialization";
    2.49 +	public static final String asWKT				= GEO + "asWKT";
    2.50 +	public static final String asGML				= GEO + "asGML";
    2.51  
    2.52  }
     3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 22:33:57 2013 +0300
     3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 22:47:32 2013 +0300
     3.3 @@ -30,8 +30,9 @@
     3.4  	
     3.5  	//private static final Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.generaldb.GeosparqlRDFHandlerBase.class);
     3.6  	
     3.7 -	private static String TYPE = RDF.TYPE.stringValue();
     3.8 -	private static String SUBCLASS = RDFS.SUBCLASSOF.stringValue();
     3.9 +	private static String TYPE 		= RDF.TYPE.stringValue();
    3.10 +	private static String CLASS 	= RDFS.CLASS.stringValue();
    3.11 +	private static String SUBCLASS 	= RDFS.SUBCLASSOF.stringValue();
    3.12  
    3.13  	private StringBuffer triples = new StringBuffer(1024);
    3.14  	
    3.15 @@ -68,9 +69,9 @@
    3.16  		 * from
    3.17  		 * 		subj {any topological property from the Topology Vocabulary Extension} obj
    3.18  		 */
    3.19 -		if( pred.startsWith(GeoConstants.GEO+"sf") ||
    3.20 -			pred.startsWith(GeoConstants.GEO+"eh") || 
    3.21 -			pred.startsWith(GeoConstants.GEO+"rcc8"))
    3.22 +		if( pred.startsWith(GeoSPARQL.GEO+"sf") ||
    3.23 +			pred.startsWith(GeoSPARQL.GEO+"eh") || 
    3.24 +			pred.startsWith(GeoSPARQL.GEO+"rcc8"))
    3.25  		{
    3.26  			writeTriple(subj, TYPE, GeoSPARQL.SpatialObject);
    3.27  			writeTriple(obj, TYPE, GeoSPARQL.SpatialObject);
    3.28 @@ -290,10 +291,10 @@
    3.29  		 * from
    3.30  		 * 		subj {any spatial property defined in Req. 9, 14, and 18} obj
    3.31  		 */
    3.32 -		} else if ( GeoConstants.GEOspatialDimension.equals(pred)    || GeoConstants.GEOdimension.equals(pred)  		||
    3.33 -					GeoConstants.GEOcoordinateDimension.equals(pred) || GeoConstants.GEOisEmpty.equals(pred) 			||
    3.34 -					GeoConstants.GEOisSimple.equals(pred) 		     || GeoConstants.GEOhasSerialization.equals(pred)   ||
    3.35 -					GeoConstants.GEOasWKT.equals(pred)	 || GeoConstants.GEOasGML.equals(pred)) {
    3.36 +		} else if ( GeoSPARQL.spatialDimension.equals(pred)    || GeoSPARQL.dimension.equals(pred)  		||
    3.37 +					GeoSPARQL.coordinateDimension.equals(pred) || GeoSPARQL.isEmpty.equals(pred) 			||
    3.38 +					GeoSPARQL.isSimple.equals(pred) 		   || GeoSPARQL.hasSerialization.equals(pred)   ||
    3.39 +					GeoSPARQL.asWKT.equals(pred)	 		   || GeoSPARQL.asGML.equals(pred)) {
    3.40  			
    3.41  			writeTriple(subj, TYPE, GeoSPARQL.Geometry);
    3.42  			writeTriple(subj, TYPE, GeoSPARQL.SpatialObject);
    3.43 @@ -311,23 +312,23 @@
    3.44  	 * Materializes the RDF class hierarchy of Simple Features
    3.45  	 */
    3.46  	protected void insertSimpleFeaturesClassHierarchy() {
    3.47 -		writeTriple(SimpleFeatures.Geometry, TYPE, RDFS.CLASS.stringValue());
    3.48 -		writeTriple(SimpleFeatures.Point, TYPE, RDFS.CLASS.stringValue());
    3.49 -		writeTriple(SimpleFeatures.Curve, TYPE, RDFS.CLASS.stringValue());
    3.50 -		writeTriple(SimpleFeatures.Surface, TYPE, RDFS.CLASS.stringValue());
    3.51 -		writeTriple(SimpleFeatures.GeometryCollection, TYPE, RDFS.CLASS.stringValue());
    3.52 -		writeTriple(SimpleFeatures.LineString, TYPE, RDFS.CLASS.stringValue());
    3.53 -		writeTriple(SimpleFeatures.Polygon, TYPE, RDFS.CLASS.stringValue());
    3.54 -		writeTriple(SimpleFeatures.PolyhedralSurface, TYPE, RDFS.CLASS.stringValue());
    3.55 -		writeTriple(SimpleFeatures.MultiSurface, TYPE, RDFS.CLASS.stringValue());
    3.56 -		writeTriple(SimpleFeatures.MultiCurve, TYPE, RDFS.CLASS.stringValue());
    3.57 -		writeTriple(SimpleFeatures.MultiPoint, TYPE, RDFS.CLASS.stringValue());
    3.58 -		writeTriple(SimpleFeatures.Line, TYPE, RDFS.CLASS.stringValue());
    3.59 -		writeTriple(SimpleFeatures.LinearRing, TYPE, RDFS.CLASS.stringValue());
    3.60 -		writeTriple(SimpleFeatures.Triangle, TYPE, RDFS.CLASS.stringValue());
    3.61 -		writeTriple(SimpleFeatures.TIN, TYPE, RDFS.CLASS.stringValue());
    3.62 -		writeTriple(SimpleFeatures.MultiPolygon, TYPE, RDFS.CLASS.stringValue());
    3.63 -		writeTriple(SimpleFeatures.MultiLineString, TYPE, RDFS.CLASS.stringValue());
    3.64 +		writeTriple(SimpleFeatures.Geometry, TYPE, CLASS);
    3.65 +		writeTriple(SimpleFeatures.Point, TYPE, CLASS);
    3.66 +		writeTriple(SimpleFeatures.Curve, TYPE, CLASS);
    3.67 +		writeTriple(SimpleFeatures.Surface, TYPE, CLASS);
    3.68 +		writeTriple(SimpleFeatures.GeometryCollection, TYPE, CLASS);
    3.69 +		writeTriple(SimpleFeatures.LineString, TYPE, CLASS);
    3.70 +		writeTriple(SimpleFeatures.Polygon, TYPE, CLASS);
    3.71 +		writeTriple(SimpleFeatures.PolyhedralSurface, TYPE, CLASS);
    3.72 +		writeTriple(SimpleFeatures.MultiSurface, TYPE, CLASS);
    3.73 +		writeTriple(SimpleFeatures.MultiCurve, TYPE, CLASS);
    3.74 +		writeTriple(SimpleFeatures.MultiPoint, TYPE, CLASS);
    3.75 +		writeTriple(SimpleFeatures.Line, TYPE, CLASS);
    3.76 +		writeTriple(SimpleFeatures.LinearRing, TYPE, CLASS);
    3.77 +		writeTriple(SimpleFeatures.Triangle, TYPE, CLASS);
    3.78 +		writeTriple(SimpleFeatures.TIN, TYPE, CLASS);
    3.79 +		writeTriple(SimpleFeatures.MultiPolygon, TYPE, CLASS);
    3.80 +		writeTriple(SimpleFeatures.MultiLineString, TYPE, CLASS);
    3.81  		
    3.82  		// first level 
    3.83  		writeTriple(SimpleFeatures.Point, SUBCLASS, SimpleFeatures.Geometry);
    3.84 @@ -384,9 +385,9 @@
    3.85  	 * Materializes the RDF class hierarchy of GeoSPARQL
    3.86  	 */
    3.87  	protected void insertGeoSPARQLClassHierarchy() {
    3.88 -		writeTriple(GeoSPARQL.SpatialObject, TYPE, RDFS.CLASS.stringValue());
    3.89 -		writeTriple(GeoSPARQL.Feature, TYPE, RDFS.CLASS.stringValue());
    3.90 -		writeTriple(GeoSPARQL.Geometry, TYPE, RDFS.CLASS.stringValue());
    3.91 +		writeTriple(GeoSPARQL.SpatialObject, TYPE, CLASS);
    3.92 +		writeTriple(GeoSPARQL.Feature, TYPE, CLASS);
    3.93 +		writeTriple(GeoSPARQL.Geometry, TYPE, CLASS);
    3.94  		
    3.95  		
    3.96  		writeTriple(GeoSPARQL.Feature, SUBCLASS, GeoSPARQL.SpatialObject);