You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2015/09/28 08:38:36 UTC

[3/9] marmotta git commit: MARMOTTA-584: moved all geosparql functions to a new package

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfIntersectsFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfIntersectsFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfIntersectsFunction.java
new file mode 100644
index 0000000..0775762
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfIntersectsFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing a intersection between two geometries. Should be
+ * implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS.
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:sfIntersects(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class SfIntersectsFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.SF_INTERSECTS.toString())) {
+            FunctionRegistry.getInstance().add(new SfIntersectsFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.SF_INTERSECTS.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:sfIntersects(?wkt, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:sfIntersects(?wkt, geof:buffer(?wkt2, 50, units:meter))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("st_Intersects(%s , %s ) ", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("Intersects function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.BOOL;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfOverlapsFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfOverlapsFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfOverlapsFunction.java
new file mode 100644
index 0000000..8016fb8
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfOverlapsFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing a overlaps between geometries. Should be
+ * implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:sfOverlaps(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class SfOverlapsFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.SF_OVERLAPS.toString())) {
+            FunctionRegistry.getInstance().add(new SfOverlapsFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.SF_OVERLAPS.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:sfOverlaps(?wkt, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:sfOverlaps(?wkt, geof:buffer(?wkt2, 50, units:meter))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("st_Overlaps(%s , %s )", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("Overlaps function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.BOOL;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfTouchesFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfTouchesFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfTouchesFunction.java
new file mode 100644
index 0000000..e309502
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfTouchesFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing touches analyzer between two geometries. Should
+ * be implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:sfTouches(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class SfTouchesFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.SF_TOUCHES.toString())) {
+            FunctionRegistry.getInstance().add(new SfTouchesFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.SF_TOUCHES.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:sfTouches(?wkt, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:sfTouches(?wkt, geof:buffer(?wkt2, 50, units:meter))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("st_Touches(%s , %s )", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("Touches function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.BOOL;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfWithinFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfWithinFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfWithinFunction.java
new file mode 100644
index 0000000..9f027f1
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SfWithinFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing a within between two geometries. Should be
+ * implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:sfWithin(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class SfWithinFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.SF_WITHIN.toString())) {
+            FunctionRegistry.getInstance().add(new SfWithinFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.SF_WITHIN.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:sfWithin(?wkt, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:sfWithin(?wkt, geof:buffer(?wkt2, 5, units:degree))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("st_Within(%s,%s)", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("Within function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.BOOL;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SymDifferenceFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SymDifferenceFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SymDifferenceFunction.java
new file mode 100644
index 0000000..8b0aa12
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/SymDifferenceFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing a symDifference of a geometry. Should be
+ * implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:symDifference(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class SymDifferenceFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.SYM_DIFFERENCE.toString())) {
+            FunctionRegistry.getInstance().add(new SymDifferenceFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.SYM_DIFFERENCE.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:symDifference(?wkt, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:symDifference(?wkt, geof:buffer(?wkt2, 50, units:meter))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("ST_AsText(ST_SymDifference(%s , %s )) ", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("SymDifference function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/UnionFunction.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/UnionFunction.java b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/UnionFunction.java
new file mode 100644
index 0000000..ea709db
--- /dev/null
+++ b/libraries/kiwi/kiwi-geosparql/src/main/java/org/apache/marmotta/kiwi/sparql/geosparql/functions/UnionFunction.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.kiwi.sparql.geosparql.functions;
+
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sparql.builder.ValueType;
+import org.apache.marmotta.kiwi.sparql.function.NativeFunction;
+import org.apache.marmotta.kiwi.vocabulary.FN_GEOSPARQL;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
+import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
+
+/**
+ * A SPARQL function for doing a union between two geometries. Should be
+ * implemented directly in the database, as the in-memory implementation is
+ * non-functional. Only support by postgres - POSTGIS
+ * <p/>
+ * The function can be called either as:
+ * <ul>
+ *      <li>geof:union(?geometryA, ?geometryB) </li>
+ * </ul>
+ * Its necesary enable postgis in your database with the next command "CREATE
+ * EXTENSION postgis;" Note that for performance reasons it might be preferrable
+ * to create a geometry index for your database. Please consult your database
+ * documentation on how to do this.
+ *
+ * @author Xavier Sumba (xavier.sumba93@ucuenca.ec))
+ */
+public class UnionFunction implements NativeFunction {
+
+    // auto-register for SPARQL environment
+    static {
+        if (!FunctionRegistry.getInstance().has(FN_GEOSPARQL.UNION.toString())) {
+            FunctionRegistry.getInstance().add(new UnionFunction());
+        }
+    }
+
+    @Override
+    public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException {
+        throw new UnsupportedOperationException("cannot evaluate in-memory, needs to be supported by the database");
+    }
+
+    @Override
+    public String getURI() {
+        return FN_GEOSPARQL.UNION.toString();
+    }
+
+    /**
+     * Return true if this function has available native support for the given
+     * dialect
+     *
+     * @param dialect
+     * @return
+     */
+    @Override
+    public boolean isSupported(KiWiDialect dialect) {
+        return dialect instanceof PostgreSQLDialect;
+    }
+
+    /**
+     * Return a string representing how this GeoSPARQL function is translated
+     * into SQL ( Postgis Function ) in the given dialect
+     *
+     * @param dialect
+     * @param args
+     * @return
+     */
+    @Override
+    public String getNative(KiWiDialect dialect, String... args) {
+        if (dialect instanceof PostgreSQLDialect) {
+            if (args.length == 2) {
+                String geom1 = args[0];
+                String geom2 = args[1];
+                String SRID_default = "4326";
+                /*
+                 * The following condition is required to read WKT  inserted directly into args[0] or args[1] and create a geometries with SRID
+                 * POINT, MULTIPOINT, LINESTRING ... and MULTIPOLYGON conditions: 
+                 *   example: geof:union(?geom1, "POLYGON(( -7 43, -2 43, -2 38, -7 38, -7 43))"^^geo:wktLiteral))
+                 * st_AsText condition: It is to use the geometry that is the result of another function geosparql.
+                 *   example: geof:union(?geom1, geof:buffer(?geom2, 50, units:meter))
+                 */
+                if (args[0].contains("POINT") || args[0].contains("MULTIPOINT") || args[0].contains("LINESTRING") || args[0].contains("MULTILINESTRING") || args[0].contains("POLYGON") || args[0].contains("MULTIPOLYGON") || args[0].contains("ST_AsText")) {
+                    geom1 = String.format("ST_GeomFromText(%s,%s)", args[0], SRID_default);
+                }
+                if (args[1].contains("POINT") || args[1].contains("MULTIPOINT") || args[1].contains("LINESTRING") || args[1].contains("MULTILINESTRING") || args[1].contains("POLYGON") || args[1].contains("MULTIPOLYGON") || args[1].contains("ST_AsText")) {
+                    geom2 = String.format("ST_GeomFromText(%s,%s)", args[1], SRID_default);
+                }
+                return String.format("ST_AsText(ST_Union(%s , %s ) )", geom1, geom2);
+            }
+        }
+        throw new UnsupportedOperationException("union function not supported by dialect " + dialect);
+    }
+
+    /**
+     * Get the return type of the function. This is needed for SQL type casting
+     * inside KiWi.
+     *
+     * @return
+     */
+    @Override
+    public ValueType getReturnType() {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Get the argument type of the function for the arg'th argument (starting
+     * to count at 0). This is needed for SQL type casting inside KiWi.
+     *
+     * @param arg
+     * @return
+     */
+    @Override
+    public ValueType getArgumentType(int arg) {
+        return ValueType.GEOMETRY;
+    }
+
+    /**
+     * Return the minimum number of arguments this function requires.
+     *
+     * @return
+     */
+    @Override
+    public int getMinArgs() {
+        return 2;
+    }
+
+    /**
+     * Return the maximum number of arguments this function can take
+     *
+     * @return
+     */
+    @Override
+    public int getMaxArgs() {
+        return 2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction b/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction
index 6e7bd78..e5e1b86 100644
--- a/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction
+++ b/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.apache.marmotta.kiwi.sparql.function.NativeFunction
@@ -15,41 +15,41 @@
 # limitations under the License.
 #
 
-org.apache.marmotta.kiwi.sparql.geosparql.SfIntersectsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfWithinFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfTouchesFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfContainsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfCrossesFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfDisjointFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfEqualsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfOverlapsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfIntersectsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfWithinFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfTouchesFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfContainsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfCrossesFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfDisjointFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfEqualsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfOverlapsFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8DCFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8ECFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8EQFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8NTPPFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8NTPPiFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8POFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8TPPFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8TPPiFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8DCFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8ECFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8EQFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8NTPPFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8NTPPiFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8POFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8TPPFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8TPPiFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.EhContainsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhCoveredByFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhDisjointFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhEqualsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhInsideFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhMeetFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhOverlapFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhCoversFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhContainsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhCoveredByFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhDisjointFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhEqualsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhInsideFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhMeetFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhOverlapFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhCoversFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.BufferFunction
-org.apache.marmotta.kiwi.sparql.geosparql.ConvexHullFunction
-org.apache.marmotta.kiwi.sparql.geosparql.IntersectionFunction
-org.apache.marmotta.kiwi.sparql.geosparql.DistanceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.DifferenceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SymDifferenceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EnvelopeFunction
-org.apache.marmotta.kiwi.sparql.geosparql.BoundaryFunction
-org.apache.marmotta.kiwi.sparql.geosparql.UnionFunction
-org.apache.marmotta.kiwi.sparql.geosparql.RelateFunction
-org.apache.marmotta.kiwi.sparql.geosparql.GetSRIDFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.BufferFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.ConvexHullFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.IntersectionFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.DistanceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.DifferenceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SymDifferenceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EnvelopeFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.BoundaryFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.UnionFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.RelateFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.GetSRIDFunction

http://git-wip-us.apache.org/repos/asf/marmotta/blob/df172223/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function b/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
index 6e7bd78..e5e1b86 100644
--- a/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
+++ b/libraries/kiwi/kiwi-geosparql/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
@@ -15,41 +15,41 @@
 # limitations under the License.
 #
 
-org.apache.marmotta.kiwi.sparql.geosparql.SfIntersectsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfWithinFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfTouchesFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfContainsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfCrossesFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfDisjointFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfEqualsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SfOverlapsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfIntersectsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfWithinFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfTouchesFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfContainsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfCrossesFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfDisjointFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfEqualsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SfOverlapsFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8DCFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8ECFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8EQFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8NTPPFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8NTPPiFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8POFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8TPPFunction
-org.apache.marmotta.kiwi.sparql.geosparql.Rcc8TPPiFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8DCFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8ECFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8EQFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8NTPPFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8NTPPiFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8POFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8TPPFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.Rcc8TPPiFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.EhContainsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhCoveredByFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhDisjointFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhEqualsFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhInsideFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhMeetFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhOverlapFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EhCoversFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhContainsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhCoveredByFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhDisjointFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhEqualsFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhInsideFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhMeetFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhOverlapFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EhCoversFunction
 
-org.apache.marmotta.kiwi.sparql.geosparql.BufferFunction
-org.apache.marmotta.kiwi.sparql.geosparql.ConvexHullFunction
-org.apache.marmotta.kiwi.sparql.geosparql.IntersectionFunction
-org.apache.marmotta.kiwi.sparql.geosparql.DistanceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.DifferenceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.SymDifferenceFunction
-org.apache.marmotta.kiwi.sparql.geosparql.EnvelopeFunction
-org.apache.marmotta.kiwi.sparql.geosparql.BoundaryFunction
-org.apache.marmotta.kiwi.sparql.geosparql.UnionFunction
-org.apache.marmotta.kiwi.sparql.geosparql.RelateFunction
-org.apache.marmotta.kiwi.sparql.geosparql.GetSRIDFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.BufferFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.ConvexHullFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.IntersectionFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.DistanceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.DifferenceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.SymDifferenceFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.EnvelopeFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.BoundaryFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.UnionFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.RelateFunction
+org.apache.marmotta.kiwi.sparql.geosparql.functions.GetSRIDFunction