Strabon
changeset 620:db08c38e1422
reverted previous changes to inside function: The previous version used _ST_Within which ingored indexes. This time the implementation is based on ST_Within.
Also, strdf:inside is now a spatial relation function while strdf:mbbInside is an operator, which is operated on the MBB.
The same applies to strdf:contains (spatial binary funtion without MBB) and strdf:mbbContains (operator on MBB)
These changes address partially to ticket #19
Also, strdf:inside is now a spatial relation function while strdf:mbbInside is an operator, which is operated on the MBB.
The same applies to strdf:contains (spatial binary funtion without MBB) and strdf:mbbContains (operator on MBB)
These changes address partially to ticket #19
line diff
1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/GeoConstants.java Wed Oct 03 17:53:53 2012 +0300 1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/GeoConstants.java Thu Oct 04 18:42:57 2012 +0300 1.3 @@ -75,6 +75,7 @@ 1.4 public static final String anyInteract = stRDF + "anyInteract"; 1.5 public static final String intersects = stRDF + "intersects"; 1.6 public static final String contains = stRDF + "contains"; 1.7 + public static final String within = stRDF + "within"; 1.8 public static final String coveredBy = stRDF + "coveredBy"; 1.9 public static final String covers = stRDF + "covers"; 1.10 public static final String disjoint = stRDF + "disjoint"; 1.11 @@ -90,7 +91,9 @@ 1.12 1.13 // Spatial Relationships utilizing mbb 1.14 public static final String mbbIntersects = stRDF + "mbbIntersects"; 1.15 + public static final String mbbContains = stRDF + "mbbContains"; 1.16 public static final String mbbEquals = stRDF + "mbbEquals"; 1.17 + public static final String mbbInside = stRDF + "mbbInside"; 1.18 1.19 // Spatial Constructs 1.20 public static final String union = stRDF + "union";
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/stsparql/relation/mbb/ContainsMBBFunc.java Thu Oct 04 18:42:57 2012 +0300 2.3 @@ -0,0 +1,26 @@ 2.4 +/** 2.5 + * This Source Code Form is subject to the terms of the Mozilla Public 2.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 2.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 2.8 + * 2.9 + * Copyright (C) 2010, 2011, 2012, Pyravlos Team 2.10 + * 2.11 + * http://www.strabon.di.uoa.gr/ 2.12 + */ 2.13 +package org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb; 2.14 + 2.15 +import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants; 2.16 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc; 2.17 + 2.18 +/** 2.19 + * 2.20 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 2.21 + */ 2.22 +public class ContainsMBBFunc extends SpatialRelationshipFunc { 2.23 + 2.24 + @Override 2.25 + public String getURI() { 2.26 + return GeoConstants.mbbContains; 2.27 + } 2.28 + 2.29 +}
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/stsparql/relation/mbb/MbbContainsFunc.java Thu Oct 04 18:42:57 2012 +0300 3.3 @@ -0,0 +1,26 @@ 3.4 +/** 3.5 + * This Source Code Form is subject to the terms of the Mozilla Public 3.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 3.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 3.8 + * 3.9 + * Copyright (C) 2010, 2011, 2012, Pyravlos Team 3.10 + * 3.11 + * http://www.strabon.di.uoa.gr/ 3.12 + */ 3.13 +package org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb; 3.14 + 3.15 +import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants; 3.16 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc; 3.17 + 3.18 +/** 3.19 + * 3.20 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 3.21 + */ 3.22 +public class MbbContainsFunc extends SpatialRelationshipFunc { 3.23 + 3.24 + @Override 3.25 + public String getURI() { 3.26 + return GeoConstants.mbbContains; 3.27 + } 3.28 + 3.29 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/stsparql/relation/mbb/MbbInsideFunc.java Thu Oct 04 18:42:57 2012 +0300 4.3 @@ -0,0 +1,26 @@ 4.4 +/** 4.5 + * This Source Code Form is subject to the terms of the Mozilla Public 4.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 4.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 4.8 + * 4.9 + * Copyright (C) 2010, 2011, 2012, Pyravlos Team 4.10 + * 4.11 + * http://www.strabon.di.uoa.gr/ 4.12 + */ 4.13 +package org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb; 4.14 + 4.15 +import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants; 4.16 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc; 4.17 + 4.18 +/** 4.19 + * 4.20 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 4.21 + */ 4.22 +public class MbbInsideFunc extends SpatialRelationshipFunc { 4.23 + 4.24 + @Override 4.25 + public String getURI() { 4.26 + return GeoConstants.mbbInside; 4.27 + } 4.28 + 4.29 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/stsparql/relation/mbb/WithinFunc.java Thu Oct 04 18:42:57 2012 +0300 5.3 @@ -0,0 +1,26 @@ 5.4 +/** 5.5 + * This Source Code Form is subject to the terms of the Mozilla Public 5.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 5.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5.8 + * 5.9 + * Copyright (C) 2010, 2011, 2012, Pyravlos Team 5.10 + * 5.11 + * http://www.strabon.di.uoa.gr/ 5.12 + */ 5.13 +package org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb; 5.14 + 5.15 +import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants; 5.16 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc; 5.17 + 5.18 +/** 5.19 + * 5.20 + * @author Manos Karpathiotakis <mk@di.uoa.gr> 5.21 + */ 5.22 +public class WithinFunc extends SpatialRelationshipFunc { 5.23 + 5.24 + @Override 5.25 + public String getURI() { 5.26 + return GeoConstants.within; 5.27 + } 5.28 + 5.29 +}
6.1 --- a/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function Wed Oct 03 17:53:53 2012 +0300 6.2 +++ b/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function Thu Oct 04 18:42:57 2012 +0300 6.3 @@ -7,6 +7,9 @@ 6.4 org.openrdf.query.algebra.evaluation.function.DateTimeCast 6.5 org.openrdf.query.algebra.evaluation.function.link.SimilarTermFunc 6.6 org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbIntersectsFunc 6.7 +org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbContainsFunc 6.8 +org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbWithinFunc 6.9 +org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbInsideFunc 6.10 org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbEqualsFunc 6.11 org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.IntersectsFunc 6.12 org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.AnyInteractFunc
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlContainsMBB.java Thu Oct 04 18:42:57 2012 +0300 7.3 @@ -0,0 +1,19 @@ 7.4 +/* 7.5 + * Copyright Aduna (http://www.aduna-software.com/) (c) 2008. 7.6 + * 7.7 + * Licensed under the Aduna BSD-style license. 7.8 + */ 7.9 +package org.openrdf.sail.generaldb.algebra; 7.10 + 7.11 + 7.12 +import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 7.13 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase; 7.14 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr; 7.15 + 7.16 +public class GeneralDBSqlContainsMBB extends GeneralDBSqlGeoSpatial{ 7.17 + 7.18 + public GeneralDBSqlContainsMBB(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 7.19 + super(left, right); 7.20 + } 7.21 + 7.22 +} 7.23 \ No newline at end of file
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlMbbInside.java Thu Oct 04 18:42:57 2012 +0300 8.3 @@ -0,0 +1,19 @@ 8.4 +/* 8.5 + * Copyright Aduna (http://www.aduna-software.com/) (c) 2008. 8.6 + * 8.7 + * Licensed under the Aduna BSD-style license. 8.8 + */ 8.9 +package org.openrdf.sail.generaldb.algebra; 8.10 + 8.11 + 8.12 +import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 8.13 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase; 8.14 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr; 8.15 + 8.16 +public class GeneralDBSqlMbbInside extends GeneralDBSqlGeoSpatial{ 8.17 + 8.18 + public GeneralDBSqlMbbInside(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 8.19 + super(left, right); 8.20 + } 8.21 + 8.22 +} 8.23 \ No newline at end of file
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlWithin.java Thu Oct 04 18:42:57 2012 +0300 9.3 @@ -0,0 +1,19 @@ 9.4 +/* 9.5 + * Copyright Aduna (http://www.aduna-software.com/) (c) 2008. 9.6 + * 9.7 + * Licensed under the Aduna BSD-style license. 9.8 + */ 9.9 +package org.openrdf.sail.generaldb.algebra; 9.10 + 9.11 + 9.12 +import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 9.13 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase; 9.14 +import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr; 9.15 + 9.16 +public class GeneralDBSqlWithin extends GeneralDBSqlGeoSpatial{ 9.17 + 9.18 + public GeneralDBSqlWithin(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 9.19 + super(left, right); 9.20 + } 9.21 + 9.22 +} 9.23 \ No newline at end of file
10.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java Wed Oct 03 17:53:53 2012 +0300 10.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java Thu Oct 04 18:42:57 2012 +0300 10.3 @@ -23,6 +23,7 @@ 10.4 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCompare; 10.5 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlConcat; 10.6 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains; 10.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContainsMBB; 10.8 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCoveredBy; 10.9 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCovers; 10.10 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint; 10.11 @@ -54,6 +55,7 @@ 10.12 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLowerCase; 10.13 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr; 10.14 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals; 10.15 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbInside; 10.16 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects; 10.17 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot; 10.18 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull; 10.19 @@ -293,6 +295,13 @@ 10.20 public static GeneralDBSqlExpr mbbIntersects(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 10.21 return new GeneralDBSqlMbbIntersects(left, right); 10.22 } 10.23 + public static GeneralDBSqlExpr mbbInside(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 10.24 + return new GeneralDBSqlMbbInside(left, right); 10.25 + } 10.26 + public static GeneralDBSqlExpr ContainsMBB(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 10.27 + return new GeneralDBSqlContainsMBB(left, right); 10.28 + } 10.29 + 10.30 10.31 public static GeneralDBSqlExpr mbbEqualsGeo(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 10.32 return new GeneralDBSqlMbbEquals(left, right);
11.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java Wed Oct 03 17:53:53 2012 +0300 11.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java Thu Oct 04 18:42:57 2012 +0300 11.3 @@ -5,87 +5,7 @@ 11.4 */ 11.5 package org.openrdf.sail.generaldb.algebra.factories; 11.6 11.7 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.above; 11.8 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.abs; 11.9 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.and; 11.10 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.anyInteract; 11.11 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.asGML; 11.12 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.asText; 11.13 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.below; 11.14 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.cmp; 11.15 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.concat; 11.16 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.contains; 11.17 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.coveredBy; 11.18 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.covers; 11.19 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.dimension; 11.20 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.disjoint; 11.21 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehContains; 11.22 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehCoveredBy; 11.23 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehCovers; 11.24 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehDisjoint; 11.25 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehEquals; 11.26 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehInside; 11.27 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehMeet; 11.28 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.ehOverlap; 11.29 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.eq; 11.30 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.eqComparingNull; 11.31 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.eqIfNotNull; 11.32 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.equalsGeo; 11.33 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoArea; 11.34 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoBoundary; 11.35 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoBuffer; 11.36 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoConvexHull; 11.37 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoDifference; 11.38 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoDistance; 11.39 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoEnvelope; 11.40 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoIntersection; 11.41 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoSymDifference; 11.42 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoTransform; 11.43 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoUnion; 11.44 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geometryType; 11.45 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.gt; 11.46 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.inside; 11.47 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.intersects; 11.48 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.isEmpty; 11.49 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.isNotNull; 11.50 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.isNull; 11.51 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.isSimple; 11.52 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.left; 11.53 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.like; 11.54 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.lowercase; 11.55 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.mbbEqualsGeo; 11.56 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.mbbIntersects; 11.57 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.neq; 11.58 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.not; 11.59 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.num; 11.60 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.or; 11.61 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.overlap; 11.62 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccDisconnected; 11.63 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccEquals; 11.64 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccExternallyConnected; 11.65 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccNonTangentialProperPart; 11.66 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccNonTangentialProperPartInverse; 11.67 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccPartiallyOverlapping; 11.68 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccTangentialProperPart; 11.69 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.rccTangentialProperPartInverse; 11.70 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.regex; 11.71 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.relate; 11.72 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.right; 11.73 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfContains; 11.74 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfCrosses; 11.75 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfDisjoint; 11.76 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfEquals; 11.77 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfIntersects; 11.78 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfOverlaps; 11.79 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfTouches; 11.80 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sfWithin; 11.81 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.simple; 11.82 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sqlNull; 11.83 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.srid; 11.84 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.str; 11.85 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sub; 11.86 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.touch; 11.87 -import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.unsupported; 11.88 +import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.*; 11.89 11.90 import org.openrdf.model.Literal; 11.91 import org.openrdf.model.Value; 11.92 @@ -1006,6 +926,14 @@ 11.93 { 11.94 return mbbIntersects(leftArg,rightArg); 11.95 } 11.96 + else if(function.getURI().equals(GeoConstants.mbbInside)) 11.97 + { 11.98 + return mbbInside(leftArg,rightArg); 11.99 + } 11.100 + else if(function.getURI().equals(GeoConstants.mbbContains)) 11.101 + { 11.102 + return ContainsMBB(leftArg,rightArg); 11.103 + } 11.104 else if(function.getURI().equals(GeoConstants.mbbEquals)) 11.105 { 11.106 return mbbEqualsGeo(leftArg,rightArg);
12.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java Wed Oct 03 17:53:53 2012 +0300 12.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java Thu Oct 04 18:42:57 2012 +0300 12.3 @@ -56,7 +56,9 @@ 12.4 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.OverlapFunc; 12.5 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.RightFunc; 12.6 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.TouchFunc; 12.7 +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbContainsFunc; 12.8 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbEqualsFunc; 12.9 +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbInsideFunc; 12.10 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbIntersectsFunc; 12.11 import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl; 12.12 import org.openrdf.query.algebra.evaluation.iterator.OrderIterator; 12.13 @@ -453,6 +455,20 @@ 12.14 Geometry rightConverted = JTSWrapper.getInstance().transform(rightGeom, sourceSRID, targetSRID); 12.15 funcResult = leftGeom.getEnvelope().intersects(rightConverted.getEnvelope()); 12.16 } 12.17 + else if(function instanceof MbbInsideFunc)//within function will do the job!!! 12.18 + { 12.19 + int targetSRID = leftGeom.getSRID(); 12.20 + int sourceSRID = rightGeom.getSRID(); 12.21 + Geometry rightConverted = JTSWrapper.getInstance().transform(rightGeom, sourceSRID, targetSRID); 12.22 + funcResult = leftGeom.getEnvelope().within(rightConverted.getEnvelope()); 12.23 + } 12.24 + else if(function instanceof MbbContainsFunc) 12.25 + { 12.26 + int targetSRID = leftGeom.getSRID(); 12.27 + int sourceSRID = rightGeom.getSRID(); 12.28 + Geometry rightConverted = JTSWrapper.getInstance().transform(rightGeom, sourceSRID, targetSRID); 12.29 + funcResult = leftGeom.getEnvelope().contains(rightConverted.getEnvelope()); 12.30 + } 12.31 else if(function instanceof MbbEqualsFunc) 12.32 { 12.33 int targetSRID = leftGeom.getSRID();
13.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBQueryBuilder.java Wed Oct 03 17:53:53 2012 +0300 13.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBQueryBuilder.java Thu Oct 04 18:42:57 2012 +0300 13.3 @@ -36,6 +36,7 @@ 13.4 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCompare; 13.5 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlConcat; 13.6 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains; 13.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContainsMBB; 13.8 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCoveredBy; 13.9 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCovers; 13.10 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint; 13.11 @@ -67,6 +68,7 @@ 13.12 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLowerCase; 13.13 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr; 13.14 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals; 13.15 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbInside; 13.16 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects; 13.17 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot; 13.18 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull; 13.19 @@ -577,6 +579,12 @@ 13.20 else if (expr instanceof GeneralDBSqlMbbIntersects) { 13.21 append((GeneralDBSqlMbbIntersects)expr, filter); 13.22 } 13.23 + else if (expr instanceof GeneralDBSqlMbbInside) { 13.24 + append((GeneralDBSqlMbbInside)expr, filter); 13.25 + } 13.26 + else if (expr instanceof GeneralDBSqlContainsMBB) { 13.27 + append((GeneralDBSqlContainsMBB)expr, filter); 13.28 + } 13.29 else if (expr instanceof GeneralDBSqlMbbEquals) { 13.30 append((GeneralDBSqlMbbEquals)expr, filter); 13.31 } 13.32 @@ -987,10 +995,14 @@ 13.33 throws UnsupportedRdbmsOperatorException; 13.34 protected abstract void append(GeneralDBSqlMbbIntersects expr, GeneralDBSqlExprBuilder filter) 13.35 throws UnsupportedRdbmsOperatorException; 13.36 + protected abstract void append(GeneralDBSqlMbbInside expr, GeneralDBSqlExprBuilder filter) 13.37 + throws UnsupportedRdbmsOperatorException; 13.38 + protected abstract void append(GeneralDBSqlContainsMBB expr, GeneralDBSqlExprBuilder filter) 13.39 + throws UnsupportedRdbmsOperatorException; 13.40 protected abstract void append(GeneralDBSqlMbbEquals expr, GeneralDBSqlExprBuilder filter) 13.41 throws UnsupportedRdbmsOperatorException; 13.42 13.43 - //GeoSPARQL - Spatial Relationship Functions 13.44 + //GeoSPARQL - Spatial Relationship Functions 13.45 //Simple Features 13.46 protected abstract void append(GeneralDBSqlSF_Contains expr, GeneralDBSqlExprBuilder filter) 13.47 throws UnsupportedRdbmsOperatorException;
14.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java Wed Oct 03 17:53:53 2012 +0300 14.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java Thu Oct 04 18:42:57 2012 +0300 14.3 @@ -20,6 +20,7 @@ 14.4 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlBelow; 14.5 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCase; 14.6 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains; 14.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContainsMBB; 14.8 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCoveredBy; 14.9 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCovers; 14.10 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint; 14.11 @@ -48,6 +49,7 @@ 14.12 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLeft; 14.13 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr; 14.14 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals; 14.15 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbInside; 14.16 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects; 14.17 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot; 14.18 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull; 14.19 @@ -2073,4 +2075,20 @@ 14.20 filter.closeBracket(); 14.21 } 14.22 14.23 + @Override 14.24 + protected void append(GeneralDBSqlContainsMBB expr, 14.25 + GeneralDBSqlExprBuilder filter) 14.26 + throws UnsupportedRdbmsOperatorException { 14.27 + // TODO Auto-generated method stub 14.28 + 14.29 + } 14.30 + 14.31 + @Override 14.32 + protected void append(GeneralDBSqlMbbInside expr, 14.33 + GeneralDBSqlExprBuilder filter) 14.34 + throws UnsupportedRdbmsOperatorException { 14.35 + // TODO Auto-generated method stub 14.36 + 14.37 + } 14.38 + 14.39 } 14.40 \ No newline at end of file
15.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Wed Oct 03 17:53:53 2012 +0300 15.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Thu Oct 04 18:42:57 2012 +0300 15.3 @@ -19,6 +19,7 @@ 15.4 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlBelow; 15.5 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCase; 15.6 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains; 15.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContainsMBB; 15.8 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCoveredBy; 15.9 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCovers; 15.10 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint; 15.11 @@ -47,6 +48,7 @@ 15.12 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLeft; 15.13 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr; 15.14 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals; 15.15 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbInside; 15.16 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects; 15.17 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot; 15.18 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull; 15.19 @@ -117,13 +119,13 @@ 15.20 */ 15.21 boolean nullLabel = false; 15.22 15.23 - public enum SpatialOperandsPostGIS { anyInteract, equals, contains, left, right, above, below; } 15.24 + public enum SpatialOperandsPostGIS { anyInteract, equals, contains, left, right, above, inside, below; } 15.25 public enum SpatialFunctionsPostGIS 15.26 { //stSPARQL++ 15.27 //Spatial Relationships 15.28 ST_Disjoint, 15.29 ST_Touches, 15.30 - ST_Covers, 15.31 + ST_Covers, 15.32 ST_CoveredBy, 15.33 ST_Overlaps, 15.34 ST_Intersects, 15.35 @@ -133,19 +135,6 @@ 15.36 ST_Contains, 15.37 15.38 15.39 - //without MBB 15.40 - _ST_Disjoint, 15.41 - _ST_Touches, 15.42 - _ST_Covers, 15.43 - _ST_CoveredBy, 15.44 - _ST_Overlaps, 15.45 - _ST_Intersects, 15.46 - _ST_Equals, 15.47 - _ST_Relate, 15.48 - _ST_Within, 15.49 - _ST_Contains, 15.50 - __ST_Covers, 15.51 - 15.52 //Spatial Constructs - Binary 15.53 ST_Union, 15.54 ST_Intersection, 15.55 @@ -379,9 +368,12 @@ 15.56 protected void append(GeneralDBSqlContains expr, GeneralDBSqlExprBuilder filter) 15.57 throws UnsupportedRdbmsOperatorException { 15.58 15.59 - appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.contains); 15.60 + appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Contains); 15.61 } 15.62 15.63 + 15.64 + 15.65 + 15.66 @Override 15.67 protected void append(GeneralDBSqlEqualsSpatial expr, GeneralDBSqlExprBuilder filter) 15.68 throws UnsupportedRdbmsOperatorException { 15.69 @@ -394,7 +386,7 @@ 15.70 throws UnsupportedRdbmsOperatorException { 15.71 15.72 //appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.inside); 15.73 - appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS._ST_Within); 15.74 + appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Within); 15.75 15.76 } 15.77 15.78 @@ -475,6 +467,20 @@ 15.79 } 15.80 15.81 @Override 15.82 + protected void append(GeneralDBSqlMbbInside expr, GeneralDBSqlExprBuilder filter) 15.83 + throws UnsupportedRdbmsOperatorException { 15.84 + appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.inside); 15.85 + } 15.86 + 15.87 + 15.88 + @Override 15.89 + protected void append(GeneralDBSqlContainsMBB expr, GeneralDBSqlExprBuilder filter) 15.90 + throws UnsupportedRdbmsOperatorException { 15.91 + appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.contains); 15.92 + } 15.93 + 15.94 + 15.95 + @Override 15.96 protected void append(GeneralDBSqlMbbEquals expr, GeneralDBSqlExprBuilder filter) 15.97 throws UnsupportedRdbmsOperatorException { 15.98 appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.equals); 15.99 @@ -1061,7 +1067,7 @@ 15.100 case anyInteract: filter.intersectsMBB(); break; 15.101 case equals: filter.equalsMBB(); break; 15.102 case contains: filter.containsMBB(); break; 15.103 - //case inside: filter.insideMBB(); break; 15.104 + case inside: filter.insideMBB(); break; 15.105 case left: filter.leftMBB(); break; 15.106 case right: filter.rightMBB(); break; 15.107 case above: filter.aboveMBB(); break; 15.108 @@ -1337,20 +1343,12 @@ 15.109 case ST_Touches: filter.appendFunction("ST_Touches"); break; 15.110 case ST_Disjoint: filter.appendFunction("ST_Disjoint"); break; 15.111 case ST_Covers: filter.appendFunction("ST_Covers"); break; 15.112 + case ST_Contains: filter.appendFunction("ST_Contains"); break; 15.113 case ST_CoveredBy: filter.appendFunction("ST_CoveredBy"); break; 15.114 case ST_Overlaps: filter.appendFunction("ST_Overlaps"); break; 15.115 case ST_Intersects: filter.appendFunction("ST_Intersects"); break; 15.116 case ST_Equals: filter.appendFunction("ST_Equals"); break; 15.117 case ST_Within: filter.appendFunction("ST_Within"); break; 15.118 - //and now the alternative funcs of the above without the mbb" 15.119 - case _ST_Touches: filter.appendFunction("_ST_Touches"); break; 15.120 - case _ST_Disjoint: filter.appendFunction("_ST_Disjoint"); break; 15.121 - case _ST_Covers: filter.appendFunction("_ST_Covers"); break; 15.122 - case _ST_CoveredBy: filter.appendFunction("_ST_CoveredBy"); break; 15.123 - case _ST_Overlaps: filter.appendFunction("_ST_Overlaps"); break; 15.124 - case _ST_Intersects: filter.appendFunction("_ST_Intersects"); break; 15.125 - case _ST_Equals: filter.appendFunction("_ST_Equals"); break; 15.126 - case _ST_Within: filter.appendFunction("_ST_Within"); break; 15.127 15.128 } 15.129