Strabon

changeset 983:f3fa13082d55

tidy up GeosparqlRDFHandlerBase to reference GeoConstants. Updated GeoSPARQL URIs. Removed derivation of property geo:hasGeometry from property geo:hasDefaultGeometry (is not a requirement of GeoSPARQL). Derive "object type SpatialObject" when seeing "subject hasDefaultGeometry object". Put inferences for geo:hasDefaultGeometry as an "else if" part to the inferences from geo:hasGeometry so as not to infer the same triples when both properties are present
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Apr 05 15:37:14 2013 +0300 (2013-04-05)
parents 2171270604e1
children ec3e8a847277
files constants/src/main/java/eu/earthobservatory/constants/GeoConstants.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 13:09:04 2013 +0300
     1.2 +++ b/constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java	Fri Apr 05 15:37:14 2013 +0300
     1.3 @@ -71,6 +71,8 @@
     1.4  	 * GML should be only "http://www.opengis.net/gml" and nothing else. In every other case,
     1.5  	 * an exception is thrown by the GML parser.
     1.6  	 * 
     1.7 +	 * UPDATE: The most recent value for the GML namespace by OGC is 
     1.8 +	 * "http://www.opengis.net/ont/gml#".
     1.9  	 * 
    1.10  	 * @see {@link org.openrdf.query.algebra.evaluation.util.JTSWrapper.GMLReader}, {@link GMLReader}
    1.11  	 */
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 13:09:04 2013 +0300
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Fri Apr 05 15:37:14 2013 +0300
     2.3 @@ -10,42 +10,52 @@
     2.4  package eu.earthobservatory.runtime.generaldb;
     2.5  
     2.6  import java.io.StringReader;
     2.7 +import java.util.Arrays;
     2.8  import java.util.List;
     2.9 -import java.util.Arrays;
    2.10  
    2.11  import org.openrdf.model.Statement;
    2.12  import org.openrdf.rio.helpers.RDFHandlerBase;
    2.13  import org.openrdf.rio.ntriples.NTriplesParser;
    2.14  
    2.15 +import eu.earthobservatory.constants.GeoConstants;
    2.16 +
    2.17  public class GeosparqlRDFHandlerBase extends RDFHandlerBase {
    2.18  	
    2.19 -	public static String geonamespace = "http://www.opengis.net/ont/geosparql#";
    2.20 -	public static String gml="http://www.opengis.net/def/geometryType/OGC-GML/3.2/";
    2.21 -	public static String sf="http://www.opengis.net/def/geometryType/OGC-SF/1.0/";
    2.22 -	public static String type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
    2.23 -	public static String SpatialObject= geonamespace + "SpatialObject";
    2.24 -	public static String Feature = geonamespace + "Feature";
    2.25 -	public static String Geometry= geonamespace + "Geometry";
    2.26 -	public static String hasGeometry = geonamespace + "hasGeometry";
    2.27 -	public static String defaultGeometry = geonamespace + "defaultGeometry";
    2.28 -	public static String dimension=   geonamespace + "dimension";
    2.29 -	public static String coordinateDimension=   geonamespace + "coordinateDimension";
    2.30 -	public static String spatialdimension=   geonamespace + "spatialdimension";
    2.31 -	public static String isEmpty=   geonamespace + "isEmpty";
    2.32 -	public static String isSimple=   geonamespace + "isSimple";
    2.33 -	public static String is3D=   geonamespace + "is3D";
    2.34 -	public static String asWKT=   geonamespace + "asWKT";
    2.35 -	public static String asGML=   geonamespace + "asGML";
    2.36 +	public static String GEO 		= GeoConstants.GEO;
    2.37 +	public static String GML 		= GeoConstants.GML_OGC;
    2.38 +	public static String SF	 		= GeoConstants.SF;
    2.39 +	public static String RDF_TYPE 	= "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
    2.40 +	
    2.41 +	public static String SpatialObject 			= GEO + "SpatialObject";
    2.42 +	public static String Feature 				= GEO + "Feature";
    2.43 +	public static String Geometry				= GEO + "Geometry";
    2.44 +	public static String hasGeometry 			= GEO + "hasGeometry";
    2.45 +	public static String hasDefaultGeometry		= GEO + "hasDefaultGeometry";
    2.46 +	
    2.47 +	public static String dimension				= GEO + "dimension";
    2.48 +	public static String coordinateDimension	= GEO + "coordinateDimension";
    2.49 +	public static String spatialdimension		= GEO + "spatialDimension";
    2.50 +	public static String isEmpty				= GEO + "isEmpty";
    2.51 +	public static String isSimple				= GEO + "isSimple";
    2.52 +	
    2.53 +	public static String hasSerialization		= GEO + "hasSerialization";
    2.54 +	public static String asWKT					= GEO + "asWKT";
    2.55 +	public static String asGML					= GEO + "asGML";
    2.56 +	
    2.57  	public static List <String> ogc_sf= Arrays.asList("Geometry", "Point", "Curve", "Surface", "GeometryCollection", "LineString", "Polygon", "MultiSurface", "MultiCurve",
    2.58  			            "MultiPoint", "Line", "LinearRing", "MultiPolygon","MultiLineString");
    2.59 +	
    2.60  	public static List <String> GM_Objects= Arrays.asList("GM_Complex", "GM_Agreggate", "GM_Primitive", "GM_Composite", "GM_MultiPrimitive",
    2.61  			"GM_Point", "GM_OrientablePrimitive","GM_OrientableCurve","GM_OrientableSurface", "GM_Curve","GM_Surface","GM_Solid",
    2.62  			 "GM_CompositeCurve", "GM_CompositeSurface", "GM_CompositeSolid", "GM_Multipoint", "GM_MultiCurve", "GM_MultiSurface", "GM_MultiSolid");
    2.63 -	public static List <String> geometryDomainList = Arrays.asList(dimension, coordinateDimension, spatialdimension,isEmpty, isSimple, is3D,asWKT, asGML);
    2.64 -	public static String WKTLiteral=   geonamespace + "WKTLiteral";
    2.65 -	public static String GMLLiteral=   geonamespace + "GMLLiteral";
    2.66 -	public static List <String> rcc8 = Arrays.asList(geonamespace+"rcc8eq",geonamespace+"rcc8dc",geonamespace+"rcc8ec",geonamespace+"rcc8po",
    2.67 -			geonamespace+"rcc8tppi", geonamespace+"rcc8tpp",geonamespace+ "rcc8ntpp", geonamespace+"rcc8ntpp");
    2.68 +	
    2.69 +	public static List <String> geometryDomainList = Arrays.asList(dimension, coordinateDimension, spatialdimension,isEmpty, isSimple, asWKT, asGML);
    2.70 +	
    2.71 +	public static String WKTLiteral	= GeoConstants.WKTLITERAL;
    2.72 +	public static String GMLLiteral	= GeoConstants.GMLLITERAL;
    2.73 +	
    2.74 +	public static List <String> rcc8 = Arrays.asList(GEO+"rcc8eq",GEO+"rcc8dc",GEO+"rcc8ec",GEO+"rcc8po",
    2.75 +			GEO+"rcc8tppi", GEO+"rcc8tpp",GEO+ "rcc8ntpp", GEO+"rcc8ntpp");
    2.76  	
    2.77  	//loose check: tha elegxw an arxizei apo eh- i apo sf- i apo rcc8- (den einai ola tou rcc8)
    2.78  	
    2.79 @@ -59,7 +69,7 @@
    2.80  	public StringBuffer getTriples()
    2.81  	{
    2.82  		return triples;
    2.83 -	};
    2.84 +	}
    2.85  	
    2.86  	public List <String> getrcc8()
    2.87  	{
    2.88 @@ -71,237 +81,241 @@
    2.89  		return geometryDomainList;
    2.90  	}
    2.91  	
    2.92 -	public void startRDF() { triples.append("\n");}; 
    2.93 +	@Override
    2.94 +	public void startRDF() { 
    2.95 +		triples.append("\n");
    2.96 +	}
    2.97  
    2.98 -	public void endRDF() {};
    2.99 -	
   2.100  	public int getNumberOfTriples() {
   2.101  		return ntriples;
   2.102  	}
   2.103  	
   2.104 +	@Override
   2.105  	public void handleStatement(Statement st)
   2.106  	{
   2.107  		String subject = st.getSubject().toString();
   2.108  		String predicate = st.getPredicate().toString();
   2.109  		String object = st.getObject().toString();
   2.110  		
   2.111 -		if(predicate.startsWith("http://www.opengis.net/ont/geosparql#sf")||predicate.startsWith(geonamespace+"eh")|| 
   2.112 +		if(predicate.startsWith("http://www.opengis.net/ont/geosparql#sf")||predicate.startsWith(GEO+"eh")|| 
   2.113  				rcc8.contains(predicate))
   2.114  		{
   2.115 -			String triple = "<"+subject+ "> <"+ type +"> <"+ SpatialObject+ "> .\n" +
   2.116 -					"<"+object+ "> <"+ type +"> <"+ SpatialObject+ "> .\n" ;
   2.117 +			String triple = "<"+subject+ "> <"+ RDF_TYPE +"> <"+ SpatialObject+ "> .\n" +
   2.118 +					"<"+object+ "> <"+ RDF_TYPE +"> <"+ SpatialObject+ "> .\n" ;
   2.119  			triples.append(triple);
   2.120  			ntriples++;
   2.121  		}
   2.122 -		if(predicate.equals(type)&&(object.equals(Feature) || object.equals(Geometry) ))
   2.123 +		if(predicate.equals(RDF_TYPE)&&(object.equals(Feature) || object.equals(Geometry) ))
   2.124  		{
   2.125 -			String triple = "<"+subject+ "> <"+ type +"> <"+ SpatialObject+ "> .\n";
   2.126 +			String triple = "<"+subject+ "> <"+ RDF_TYPE +"> <"+ SpatialObject+ "> .\n";
   2.127  			triples.append(triple);
   2.128  			ntriples++;
   2.129  		}
   2.130 +		
   2.131  		if(predicate.equals(hasGeometry))
   2.132  		{
   2.133 -			String triple = "<"+subject+ "> <"+ type +"> <"+ Feature+ "> .\n" +
   2.134 -					"<"+object+ "> <"+ type +"> <"+ Geometry+ "> .\n" +
   2.135 -					"<"+	subject+ "> <"+ type +"> <"+ SpatialObject + "> .\n" +
   2.136 -					"<"+	object+ "> <"+ type +"> <"+ SpatialObject + "> .\n";
   2.137 +			String triple = "<"+subject+ "> <"+ RDF_TYPE +"> <"+ Feature+ "> .\n" +
   2.138 +					"<"+object+ "> <"+ RDF_TYPE +"> <"+ Geometry+ "> .\n" +
   2.139 +					"<"+	subject+ "> <"+ RDF_TYPE +"> <"+ SpatialObject + "> .\n" +
   2.140 +					"<"+	object+ "> <"+ RDF_TYPE +"> <"+ SpatialObject + "> .\n";
   2.141  			triples.append(triple);
   2.142  			ntriples++;
   2.143  		}
   2.144 -		if(predicate.equals(defaultGeometry))
   2.145 +		else if(predicate.equals(hasDefaultGeometry))
   2.146  		{
   2.147 -			String triple = "<"+subject+ "> <"+ type +"> <"+ Feature+ "> .\n" +
   2.148 -					"<"+object+ "> <"+ type +"> <"+ Geometry+ "> .\n" +
   2.149 -					"<"+	subject+ "> <"+ type +"> <"+ SpatialObject + "> .\n"+
   2.150 -			"<"+	subject+ "> <"+ hasGeometry +"> <"+ object + "> .\n";
   2.151 +			String triple = "<"+subject+ "> <"+ RDF_TYPE +"> <"+ Feature+ "> .\n" +
   2.152 +					"<"+object+ "> <"+ RDF_TYPE +"> <"+ Geometry+ "> .\n" +
   2.153 +					"<"+	subject+ "> <"+ RDF_TYPE +"> <"+ SpatialObject + "> .\n" +
   2.154 +					"<"+	object+ "> <"+ RDF_TYPE +"> <"+ SpatialObject + "> .\n";
   2.155  			triples.append(triple);
   2.156  			ntriples++;
   2.157  		}
   2.158 +		
   2.159  		if(geometryDomainList.contains(predicate))
   2.160  		{
   2.161 -			String triple = "<"+subject+ "> <"+ type +"> <"+ Geometry+ "> .\n" +
   2.162 -					"<"+subject+ "> <"+ type +"> <"+ SpatialObject+ "> .\n";
   2.163 +			String triple = "<"+subject+ "> <"+ RDF_TYPE +"> <"+ Geometry+ "> .\n" +
   2.164 +					"<"+subject+ "> <"+ RDF_TYPE +"> <"+ SpatialObject+ "> .\n";
   2.165  			triples.append(triple);
   2.166  			ntriples++;
   2.167  		}
   2.168 -		if (predicate.equals(type)) {
   2.169 -			if (object.equals(gml + "GM_Complex")
   2.170 -					|| object.equals(gml + "GM_Aggregate")
   2.171 -					|| object.equals(gml + "GM_Primitive")) {
   2.172 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.173 +		if (predicate.equals(RDF_TYPE)) {
   2.174 +			if (object.equals(GML + "GM_Complex")
   2.175 +					|| object.equals(GML + "GM_Aggregate")
   2.176 +					|| object.equals(GML + "GM_Primitive")) {
   2.177 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.178  						+ "GM_Object" + "> .\n";
   2.179  				triples.append(triple);
   2.180  				ntriples++;
   2.181  			}
   2.182 -			if (object.equals(gml + "GM_Composite")) {
   2.183 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.184 -						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + type
   2.185 -						+ "> <" + gml + "GM_Object" + "> .\n";
   2.186 +			if (object.equals(GML + "GM_Composite")) {
   2.187 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.188 +						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.189 +						+ "> <" + GML + "GM_Object" + "> .\n";
   2.190  				triples.append(triple);
   2.191  				ntriples++;
   2.192  
   2.193  			}
   2.194 -			if (object.equals(gml + "GM_MultiPrimitive")) {
   2.195 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.196 +			if (object.equals(GML + "GM_MultiPrimitive")) {
   2.197 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.198  						+ "GM_Aggregate" + "> .\n" + "<" + subject + "> <"
   2.199 -						+ type + "> <" + gml + "GM_Object" + "> .\n";
   2.200 +						+ RDF_TYPE + "> <" + GML + "GM_Object" + "> .\n";
   2.201  				triples.append(triple);
   2.202  				ntriples++;
   2.203  
   2.204  			}
   2.205 -			if (object.equals(gml + "GM_Point")
   2.206 -					|| object.equals(gml + "GM_OrientablePrimitive")
   2.207 -					|| object.equals(gml + "GM_Solid")) {
   2.208 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.209 +			if (object.equals(GML + "GM_Point")
   2.210 +					|| object.equals(GML + "GM_OrientablePrimitive")
   2.211 +					|| object.equals(GML + "GM_Solid")) {
   2.212 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.213  						+ "GM_Primitive" + "> .\n" + "<" + subject + "> <"
   2.214 -						+ type + "> <" + gml + "GM_Object" + "> .\n";
   2.215 +						+ RDF_TYPE + "> <" + GML + "GM_Object" + "> .\n";
   2.216  				triples.append(triple);
   2.217  				ntriples++;
   2.218  
   2.219  			}
   2.220 -			if (object.equals(gml + "GM_OrientableCurve")
   2.221 -					|| object.equals(gml + "GM_OrientableSurface")) {
   2.222 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.223 +			if (object.equals(GML + "GM_OrientableCurve")
   2.224 +					|| object.equals(GML + "GM_OrientableSurface")) {
   2.225 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.226  						+ "GM_OrientablePrimitive" + "> .\n" + "<" + subject
   2.227 -						+ "> <" + type + "> <" + gml + "GM_Primitive" + "> .\n"
   2.228 -						+ "<" + subject + "> <" + type + "> <" + gml
   2.229 +						+ "> <" + RDF_TYPE + "> <" + GML + "GM_Primitive" + "> .\n"
   2.230 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.231  						+ "GM_Object" + "> .\n";
   2.232  				triples.append(triple);
   2.233  				ntriples++;
   2.234  
   2.235  			}
   2.236 -			if (object.equals(gml + "GM_Curve")) {
   2.237 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.238 +			if (object.equals(GML + "GM_Curve")) {
   2.239 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.240  						+ "GM_Aggregate" + "> .\n"
   2.241 -						+ "<" + subject + "> <" + type +"> <" + gml + "GM_OrientableCurve" + "> .\n"
   2.242 -						+ "<" + subject + "> <" + type + "> <" + gml + "GM_OrientablePrimitive" + "> .\n"
   2.243 -						+ "<" + subject + "> <" + type + "> <" + gml + "GM_Primitive" + "> .\n"
   2.244 -						+ "<" + subject + "> <" + type + "> <" + gml+ "GM_Object" + "> .\n";
   2.245 +						+ "<" + subject + "> <" + RDF_TYPE +"> <" + GML + "GM_OrientableCurve" + "> .\n"
   2.246 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML + "GM_OrientablePrimitive" + "> .\n"
   2.247 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Primitive" + "> .\n"
   2.248 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML+ "GM_Object" + "> .\n";
   2.249  				triples.append(triple);
   2.250  				ntriples++;
   2.251  
   2.252  			}
   2.253 -			if (object.equals(gml + "GM_Surface")) {
   2.254 -				String triple = "<" + subject + "> <" + type + "> <" + gml+ "GM_Aggregate" + "> .\n"
   2.255 -						+ "<" + subject + "> <" + type + "> <" + gml + "GM_OrientableSurface" + "> .\n"
   2.256 -						+ "<" + subject + "> <" + type + "> <" + gml + "GM_OrientablePrimitive" + "> .\n"
   2.257 -						+ "<" + subject + "> <" + type + "> <" + gml + "GM_Primitive" + "> .\n"
   2.258 -						+ "<" + subject + "> <" + type + "> <" + gml
   2.259 +			if (object.equals(GML + "GM_Surface")) {
   2.260 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML+ "GM_Aggregate" + "> .\n"
   2.261 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML + "GM_OrientableSurface" + "> .\n"
   2.262 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML + "GM_OrientablePrimitive" + "> .\n"
   2.263 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Primitive" + "> .\n"
   2.264 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.265  						+ "GM_Object" + "> .\n";
   2.266  				triples.append(triple);
   2.267  				ntriples++;
   2.268  
   2.269  			}
   2.270 -			if (object.equals(gml + "GM_CompositeCurve")) {
   2.271 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.272 +			if (object.equals(GML + "GM_CompositeCurve")) {
   2.273 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.274  						+ "GM_Aggregate" + "> .\n" + "<" + subject + "> <"
   2.275 -						+ type + "> <" + gml + "GM_OrientableCurve" + "> .\n"
   2.276 -						+ "<" + subject + "> <" + type + "> <" + gml
   2.277 +						+ RDF_TYPE + "> <" + GML + "GM_OrientableCurve" + "> .\n"
   2.278 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.279  						+ "GM_OrientablePrimitive" + "> .\n" + "<" + subject
   2.280 -						+ "> <" + type + "> <" + gml + "GM_Primitive" + "> .\n"
   2.281 -						+ "<" + subject + "> <" + type + "> <" + gml
   2.282 -						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + type
   2.283 -						+ "> <" + gml + "GM_Composite" + "> .\n" + "<"
   2.284 -						+ subject + "> <" + type + "> <" + gml + "GM_Object"
   2.285 +						+ "> <" + RDF_TYPE + "> <" + GML + "GM_Primitive" + "> .\n"
   2.286 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.287 +						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.288 +						+ "> <" + GML + "GM_Composite" + "> .\n" + "<"
   2.289 +						+ subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Object"
   2.290  						+ "> .\n";
   2.291  				triples.append(triple);
   2.292  				ntriples++;
   2.293  
   2.294  			}
   2.295 -			if (object.equals(gml + "GM_CompositeSurface")) {
   2.296 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.297 +			if (object.equals(GML + "GM_CompositeSurface")) {
   2.298 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.299  						+ "GM_OrientableSurface" + "> .\n" +
   2.300  
   2.301 -						"<" + subject + "> <" + type + "> <" + gml
   2.302 +						"<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.303  						+ "GM_OrientablePrimitive" + "> .\n" + "<" + subject
   2.304 -						+ "> <" + type + "> <" + gml + "GM_Primitive" + "> .\n"
   2.305 -						+ "<" + subject + "> <" + type + "> <" + gml
   2.306 -						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + type
   2.307 -						+ "> <" + gml + "GM_Composite" + "> .\n" + "<"
   2.308 -						+ subject + "> <" + type + "> <" + gml + "GM_Object"
   2.309 +						+ "> <" + RDF_TYPE + "> <" + GML + "GM_Primitive" + "> .\n"
   2.310 +						+ "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.311 +						+ "GM_Complex" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.312 +						+ "> <" + GML + "GM_Composite" + "> .\n" + "<"
   2.313 +						+ subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Object"
   2.314  						+ "> .\n";
   2.315  				triples.append(triple);
   2.316  				ntriples++;
   2.317  
   2.318  			}
   2.319 -			if (object.equals(gml + "GM_CompositeSolid")) {
   2.320 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.321 -						+ "GM_Solid" + "> .\n" + "<" + subject + "> <" + type
   2.322 -						+ "> <" + gml + "GM_Primitive" + "> .\n" + "<"
   2.323 -						+ subject + "> <" + type + "> <" + gml + "GM_Complex"
   2.324 -						+ "> .\n" + "<" + subject + "> <" + type + "> <" + gml
   2.325 +			if (object.equals(GML + "GM_CompositeSolid")) {
   2.326 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.327 +						+ "GM_Solid" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.328 +						+ "> <" + GML + "GM_Primitive" + "> .\n" + "<"
   2.329 +						+ subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Complex"
   2.330 +						+ "> .\n" + "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.331  						+ "GM_Composite" + "> .\n" + "<" + subject + "> <"
   2.332 -						+ type + "> <" + gml + "GM_Object" + "> .\n";
   2.333 +						+ RDF_TYPE + "> <" + GML + "GM_Object" + "> .\n";
   2.334  				triples.append(triple);
   2.335  				ntriples++;
   2.336  
   2.337  			}
   2.338 -			if (object.equals(gml + "GM_MultiPoint")
   2.339 -					|| object.equals(gml + "GM_MultiCurve")
   2.340 -					|| object.equals(gml + "GM_MultiSurface")
   2.341 -					|| object.equals(gml + "GM_MultiSolid")) {
   2.342 -				String triple = "<" + subject + "> <" + type + "> <" + gml
   2.343 +			if (object.equals(GML + "GM_MultiPoint")
   2.344 +					|| object.equals(GML + "GM_MultiCurve")
   2.345 +					|| object.equals(GML + "GM_MultiSurface")
   2.346 +					|| object.equals(GML + "GM_MultiSolid")) {
   2.347 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + GML
   2.348  						+ "GM_MultiPrimitive" + "> .\n" + "<" + subject + "> <"
   2.349 -						+ type + "> <" + gml + "GM_Aggregate" + "> .\n" + "<"
   2.350 -						+ subject + "> <" + type + "> <" + gml + "GM_Object"
   2.351 +						+ RDF_TYPE + "> <" + GML + "GM_Aggregate" + "> .\n" + "<"
   2.352 +						+ subject + "> <" + RDF_TYPE + "> <" + GML + "GM_Object"
   2.353  						+ "> .\n";
   2.354  				triples.append(triple);
   2.355  				ntriples++;
   2.356  
   2.357  			}
   2.358 -			if (object.equals(sf + "Point") || object.equals(sf + "Curve")
   2.359 -					|| object.equals(sf + "Surface")
   2.360 -					|| object.equals(sf + "GeometryCollection")) {
   2.361 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.362 +			if (object.equals(SF + "Point") || object.equals(SF + "Curve")
   2.363 +					|| object.equals(SF + "Surface")
   2.364 +					|| object.equals(SF + "GeometryCollection")) {
   2.365 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.366  						+ "Geometry" + "> .\n";
   2.367  				triples.append(triple);
   2.368  				ntriples++;
   2.369  			}
   2.370 -			if (object.equals(sf + "LineString")) {
   2.371 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.372 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.373 -						+ "> <" + sf + "Curve" + "> .\n";
   2.374 +			if (object.equals(SF + "LineString")) {
   2.375 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.376 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.377 +						+ "> <" + SF + "Curve" + "> .\n";
   2.378  				triples.append(triple);
   2.379  				ntriples++;
   2.380  			}
   2.381 -			if (object.equals(sf + "Line") || object.equals(sf + "LinearRing")) {
   2.382 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.383 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.384 -						+ "> <" + sf + "Curve" + "> .\n" + "<" + subject
   2.385 -						+ "> <" + type + "> <" + sf + "LineString" + "> .\n";
   2.386 +			if (object.equals(SF + "Line") || object.equals(SF + "LinearRing")) {
   2.387 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.388 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.389 +						+ "> <" + SF + "Curve" + "> .\n" + "<" + subject
   2.390 +						+ "> <" + RDF_TYPE + "> <" + SF + "LineString" + "> .\n";
   2.391  				triples.append(triple);
   2.392  				ntriples++;
   2.393  			}
   2.394 -			if (object.equals(sf + "Polygon")) {
   2.395 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.396 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.397 -						+ "> <" + sf + "Surface" + "> .\n";
   2.398 +			if (object.equals(SF + "Polygon")) {
   2.399 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.400 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.401 +						+ "> <" + SF + "Surface" + "> .\n";
   2.402  				triples.append(triple);
   2.403  				ntriples++;
   2.404  			}
   2.405 -			if (object.equals(sf + "MultiSurface")
   2.406 -					|| object.equals(sf + "MultiCurve")
   2.407 -					|| object.equals(sf + "MultiPoint")) {
   2.408 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.409 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.410 -						+ "> <" + sf + "GeometryCollection" + "> .\n";
   2.411 +			if (object.equals(SF + "MultiSurface")
   2.412 +					|| object.equals(SF + "MultiCurve")
   2.413 +					|| object.equals(SF + "MultiPoint")) {
   2.414 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.415 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.416 +						+ "> <" + SF + "GeometryCollection" + "> .\n";
   2.417  				triples.append(triple);
   2.418  				ntriples++;
   2.419  			}
   2.420 -			if (object.equals(sf + "MultiPolygon")) {
   2.421 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.422 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.423 -						+ "> <" + sf + "MultiSurface" + "> .\n" + "<" + subject
   2.424 -						+ "> <" + type + "> <" + sf + "GeometryCollection"
   2.425 +			if (object.equals(SF + "MultiPolygon")) {
   2.426 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.427 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.428 +						+ "> <" + SF + "MultiSurface" + "> .\n" + "<" + subject
   2.429 +						+ "> <" + RDF_TYPE + "> <" + SF + "GeometryCollection"
   2.430  						+ "> .\n";
   2.431  				triples.append(triple);
   2.432  				ntriples++;
   2.433  			}
   2.434 -			if (object.equals(sf + "MultiLineString")) {
   2.435 -				String triple = "<" + subject + "> <" + type + "> <" + sf
   2.436 -						+ "Geometry" + "> .\n" + "<" + subject + "> <" + type
   2.437 -						+ "> <" + sf + "MultiCurve" + "> .\n" + "<" + subject
   2.438 -						+ "> <" + type + "> <" + sf + "GeometryCollection"
   2.439 +			if (object.equals(SF + "MultiLineString")) {
   2.440 +				String triple = "<" + subject + "> <" + RDF_TYPE + "> <" + SF
   2.441 +						+ "Geometry" + "> .\n" + "<" + subject + "> <" + RDF_TYPE
   2.442 +						+ "> <" + SF + "MultiCurve" + "> .\n" + "<" + subject
   2.443 +						+ "> <" + RDF_TYPE + "> <" + SF + "GeometryCollection"
   2.444  						+ "> .\n";
   2.445  				triples.append(triple);
   2.446  				ntriples++;
   2.447 @@ -314,14 +328,15 @@
   2.448  		NTriplesParser parser = new NTriplesParser();
   2.449  		parser.setVerifyData(true);
   2.450  
   2.451 -		String text = 
   2.452 +		/*String text = 
   2.453  				"<http://example.org/rcc8Obj1> <http://www.opengis.net/ont/geosparql#rcc8eq> <http://example.org/rcc8Obj2> . " +
   2.454  				"<http://example.org/simpleGeometry1> <http://www.opengis.net/ont/geosparql#isEmpty> _:nai . \n"+
   2.455  		"<http://example.org/ForestArea1> <http://www.opengis.net/ont/geosparql#defaultGeometry> _:b2 . \n"+
   2.456  		"<http://example.org/SpatialObject1> <http://www.opengis.net/ont/geosparql#ehIntersects> <http://example.org/SpatialObject2> . \n";
   2.457 +		*/
   2.458          
   2.459 -		String gmltext= "<http://example.org/GM_MultiSolid> <"+type+"> <"+gml+"GM_Object> .\n"; 
   2.460 -		String sftext= "<http://example.org/Line> <"+type+"> <"+sf+"Geometry> .\n"; 
   2.461 +		String gmltext= "<http://example.org/GM_MultiSolid> <"+RDF_TYPE+"> <"+GML+"GM_Object> .\n"; 
   2.462 +		//String sftext= "<http://example.org/Line> <"+type+"> <"+sf+"Geometry> .\n"; 
   2.463  		
   2.464  		StringReader reader = new StringReader(gmltext);
   2.465