Strabon

changeset 690:de41d6c00d3b temporals

added temporal functions and operators as sesame extension functions.
author Konstantina
date Tue Nov 06 19:35:33 2012 +0200 (2012-11-06)
parents 516dec652431
children db4d98ff0273
files evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/construct/PeriodIntersectionFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/construct/PeriodMinusFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/construct/TemporalConstructFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/construct/periodUnionFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/AdjacentPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/AfterPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/BeforePeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/EqualsPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/NequalsPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/OverleftPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/OverrightPeriodFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/PeriodContainedByFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/PeriodContainsFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalConstants.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalRelationFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/periodOverlapsFunc.java evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/construct/PeriodIntersectionFunc.java	Tue Nov 06 19:35:33 2012 +0200
     1.3 @@ -0,0 +1,40 @@
     1.4 +/**
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * Copyright (C) 2012, Pyravlos Team
    1.10 + *
    1.11 + * http://www.strabon.di.uoa.gr/
    1.12 + */
    1.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct;
    1.14 +
    1.15 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants;
    1.16 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalRelationFunc;
    1.17 +
    1.18 +/**
    1.19 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    1.20 + *
    1.21 + */
    1.22 +public class PeriodIntersectionFunc  extends TemporalConstructFunc {
    1.23 +	
    1.24 +    
    1.25 +	@Override
    1.26 +	public String getURI() {
    1.27 +	
    1.28 +		return TemporalConstants.periodIntersection;
    1.29 +	}
    1.30 +
    1.31 +	//there is no operator assigned to this function
    1.32 +	@Override
    1.33 +	public String getOperator() {
    1.34 +		return null;
    1.35 +	}
    1.36 +
    1.37 +	
    1.38 +	@Override
    1.39 +	public String getPostgresFunction() {
    1.40 +		return "period_intersect";
    1.41 +	}
    1.42 +
    1.43 +}
    1.44 \ No newline at end of file
     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/temporal/stsparql/construct/PeriodMinusFunc.java	Tue Nov 06 19:35:33 2012 +0200
     2.3 @@ -0,0 +1,39 @@
     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) 2012, Pyravlos Team
    2.10 + *
    2.11 + * http://www.strabon.di.uoa.gr/
    2.12 + */
    2.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct;
    2.14 +
    2.15 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants;
    2.16 +
    2.17 +/**
    2.18 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    2.19 + *
    2.20 + */
    2.21 +public class PeriodMinusFunc extends TemporalConstructFunc {
    2.22 +	
    2.23 +    
    2.24 +	@Override
    2.25 +	public String getURI() {
    2.26 +	
    2.27 +		return TemporalConstants.minusPeriod;
    2.28 +	}
    2.29 +
    2.30 +	//there is no operator assigned to this function
    2.31 +	@Override
    2.32 +	public String getOperator() {
    2.33 +		return "-";
    2.34 +	}
    2.35 +
    2.36 +
    2.37 +	@Override
    2.38 +	public String getPostgresFunction() {
    2.39 +		return "minus";
    2.40 +	}
    2.41 +
    2.42 +}
    2.43 \ No newline at end of file
     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/temporal/stsparql/construct/TemporalConstructFunc.java	Tue Nov 06 19:35:33 2012 +0200
     3.3 @@ -0,0 +1,43 @@
     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) 2012, Pyravlos Team
    3.10 + *
    3.11 + * http://www.strabon.di.uoa.gr/
    3.12 + */
    3.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct;
    3.14 +
    3.15 +import org.openrdf.model.Value;
    3.16 +import org.openrdf.model.ValueFactory;
    3.17 +import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
    3.18 +import org.openrdf.query.algebra.evaluation.function.Function;
    3.19 +
    3.20 +/**
    3.21 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    3.22 + *
    3.23 + */
    3.24 +public abstract class TemporalConstructFunc implements Function {
    3.25 +	
    3.26 +
    3.27 +	public Value evaluate(ValueFactory valueFactory, Value... args)
    3.28 +			throws ValueExprEvaluationException {
    3.29 +
    3.30 +				return null;
    3.31 +			}
    3.32 +
    3.33 +		
    3.34 +	public abstract  String getURI();
    3.35 +	
    3.36 +	/*In Postgres Temporal it seems that an operator is assigned to every PERIOD function 
    3.37 +	 * I store this information in the declaration of each function so that i can use it in the mapping
    3.38 +	 * of stSPARQL queries to spatiotemporally extended SQL queries
    3.39 +	 * */
    3.40 +	public abstract  String getOperator();
    3.41 +	
    3.42 +	//This method returns the respective function of the Postgres Temporal extension
    3.43 +	public abstract  String getPostgresFunction();
    3.44 +
    3.45 +}
    3.46 +
     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/temporal/stsparql/construct/periodUnionFunc.java	Tue Nov 06 19:35:33 2012 +0200
     4.3 @@ -0,0 +1,38 @@
     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) 2012, Pyravlos Team
    4.10 + *
    4.11 + * http://www.strabon.di.uoa.gr/
    4.12 + */
    4.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct;
    4.14 +
    4.15 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants;
    4.16 +
    4.17 +/**
    4.18 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    4.19 + *
    4.20 + */
    4.21 +public class periodUnionFunc extends TemporalConstructFunc {
    4.22 +	
    4.23 +    
    4.24 +	@Override
    4.25 +	public String getURI() {
    4.26 +	
    4.27 +		return TemporalConstants.periodUnion;
    4.28 +	}
    4.29 +
    4.30 +	@Override
    4.31 +	public String getOperator() {
    4.32 +		return "+";
    4.33 +	}
    4.34 +
    4.35 +	
    4.36 +	@Override
    4.37 +	public String getPostgresFunction() {
    4.38 +		return "period_union";
    4.39 +	}
    4.40 +
    4.41 +}
    4.42 \ No newline at end of file
     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/temporal/stsparql/relation/AdjacentPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
     5.3 @@ -0,0 +1,37 @@
     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) 2012, Pyravlos Team
    5.10 + *
    5.11 + * http://www.strabon.di.uoa.gr/
    5.12 + */
    5.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
    5.14 +
    5.15 +/**
    5.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    5.17 + *
    5.18 + */
    5.19 +public class AdjacentPeriodFunc extends TemporalRelationFunc {
    5.20 +	
    5.21 +    
    5.22 +	@Override
    5.23 +	public String getURI() {
    5.24 +	
    5.25 +		return TemporalConstants.adjacentPeriod;
    5.26 +	}
    5.27 +
    5.28 +	//there is no operator assigned to this function
    5.29 +	@Override
    5.30 +	public String getOperator() {
    5.31 +		return null;
    5.32 +	}
    5.33 +
    5.34 +	
    5.35 +	@Override
    5.36 +	public String getPostgresFunction() {
    5.37 +		return "adjacent";
    5.38 +	}
    5.39 +
    5.40 +}
    5.41 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/AfterPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
     6.3 @@ -0,0 +1,40 @@
     6.4 +/**
     6.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     6.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     6.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     6.8 + *
     6.9 + * Copyright (C) 2012, Pyravlos Team
    6.10 + *
    6.11 + * http://www.strabon.di.uoa.gr/
    6.12 + */
    6.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
    6.14 +
    6.15 +/**
    6.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    6.17 + *
    6.18 + */
    6.19 +public class AfterPeriodFunc extends TemporalRelationFunc {
    6.20 +	
    6.21 +    
    6.22 +	@Override
    6.23 +	public String getURI() {
    6.24 +	
    6.25 +		return TemporalConstants.afterPeriod;
    6.26 +	}
    6.27 +
    6.28 +	
    6.29 +	@Override
    6.30 +	public String getOperator() {
    6.31 +		return ">>";
    6.32 +	}
    6.33 +
    6.34 +
    6.35 +
    6.36 +	@Override
    6.37 +	public String getPostgresFunction() {
    6.38 +		
    6.39 +		return "after";
    6.40 +	}
    6.41 +
    6.42 +
    6.43 +}
    6.44 \ No newline at end of file
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/BeforePeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
     7.3 @@ -0,0 +1,39 @@
     7.4 +/**
     7.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     7.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     7.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7.8 + *
     7.9 + * Copyright (C) 2012, Pyravlos Team
    7.10 + *
    7.11 + * http://www.strabon.di.uoa.gr/
    7.12 + */
    7.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
    7.14 +
    7.15 +/**
    7.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    7.17 + *
    7.18 + */
    7.19 +public class BeforePeriodFunc  extends TemporalRelationFunc {
    7.20 +	
    7.21 +    
    7.22 +	@Override
    7.23 +	public String getURI() {
    7.24 +	
    7.25 +		return TemporalConstants.beforePeriod;
    7.26 +	}
    7.27 +
    7.28 +	
    7.29 +	@Override
    7.30 +	public String getOperator() {
    7.31 +		return "<<";
    7.32 +	}
    7.33 +
    7.34 +
    7.35 +	
    7.36 +	@Override
    7.37 +	public String getPostgresFunction() {
    7.38 +		return "before";
    7.39 +	}
    7.40 +
    7.41 +
    7.42 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/EqualsPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
     8.3 @@ -0,0 +1,37 @@
     8.4 +/**
     8.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     8.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     8.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     8.8 + *
     8.9 + * Copyright (C) 2012, Pyravlos Team
    8.10 + *
    8.11 + * http://www.strabon.di.uoa.gr/
    8.12 + */
    8.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
    8.14 +
    8.15 +/**
    8.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    8.17 + *
    8.18 + */
    8.19 +public class EqualsPeriodFunc extends TemporalRelationFunc {
    8.20 +	
    8.21 +	@Override
    8.22 +	public String getURI() {
    8.23 +	
    8.24 +		return TemporalConstants.equalsPeriod;
    8.25 +	}
    8.26 +
    8.27 +	@Override
    8.28 +	public String getOperator() {
    8.29 +		return "=";
    8.30 +	}
    8.31 +
    8.32 +	
    8.33 +	@Override
    8.34 +	public String getPostgresFunction() {
    8.35 +		
    8.36 +		return "equals";
    8.37 +	}
    8.38 +
    8.39 +
    8.40 +}
    8.41 \ No newline at end of file
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/NequalsPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
     9.3 @@ -0,0 +1,38 @@
     9.4 +/**
     9.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     9.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     9.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     9.8 + *
     9.9 + * Copyright (C) 2012, Pyravlos Team
    9.10 + *
    9.11 + * http://www.strabon.di.uoa.gr/
    9.12 + */
    9.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
    9.14 +
    9.15 +/**
    9.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    9.17 + *
    9.18 + */
    9.19 +public class NequalsPeriodFunc extends  TemporalRelationFunc {
    9.20 +	    
    9.21 +	@Override
    9.22 +	public String getURI() {
    9.23 +	
    9.24 +		return TemporalConstants.nequalsPeriod;
    9.25 +	}
    9.26 +
    9.27 +	
    9.28 +	@Override
    9.29 +	public String getOperator() {
    9.30 +		return "!=";
    9.31 +	}
    9.32 +
    9.33 +
    9.34 +	
    9.35 +	@Override
    9.36 +	public String getPostgresFunction() {
    9.37 +		
    9.38 +		return "nequals";
    9.39 +	}
    9.40 +
    9.41 +}
    9.42 \ No newline at end of file
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/OverleftPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
    10.3 @@ -0,0 +1,40 @@
    10.4 +/**
    10.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    10.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    10.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    10.8 + *
    10.9 + * Copyright (C) 2012, Pyravlos Team
   10.10 + *
   10.11 + * http://www.strabon.di.uoa.gr/
   10.12 + */
   10.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   10.14 +
   10.15 +/**
   10.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   10.17 + *
   10.18 + */
   10.19 +public class OverleftPeriodFunc extends TemporalRelationFunc {
   10.20 +	
   10.21 +    
   10.22 +	@Override
   10.23 +	public String getURI() {
   10.24 +	
   10.25 +		return TemporalConstants.overleftPeriod;
   10.26 +	}
   10.27 +
   10.28 +	
   10.29 +	@Override
   10.30 +	public String getOperator() {
   10.31 +		return "&<";
   10.32 +	}
   10.33 +
   10.34 +
   10.35 +	
   10.36 +	@Override
   10.37 +	public String getPostgresFunction() {
   10.38 +
   10.39 +		return "overleft";
   10.40 +	}
   10.41 +
   10.42 +
   10.43 +}
   10.44 \ No newline at end of file
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/OverrightPeriodFunc.java	Tue Nov 06 19:35:33 2012 +0200
    11.3 @@ -0,0 +1,40 @@
    11.4 +/**
    11.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    11.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    11.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    11.8 + *
    11.9 + * Copyright (C) 2012, Pyravlos Team
   11.10 + *
   11.11 + * http://www.strabon.di.uoa.gr/
   11.12 + */
   11.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   11.14 +
   11.15 +/**
   11.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   11.17 + *
   11.18 + */
   11.19 +public class OverrightPeriodFunc extends TemporalRelationFunc {
   11.20 +	
   11.21 +    
   11.22 +	@Override
   11.23 +	public String getURI() {
   11.24 +	
   11.25 +		return TemporalConstants.overrightPeriod;
   11.26 +	}
   11.27 +
   11.28 +	
   11.29 +	@Override
   11.30 +	public String getOperator() {
   11.31 +		return "&>";
   11.32 +	}
   11.33 +
   11.34 +
   11.35 +	
   11.36 +	@Override
   11.37 +	public String getPostgresFunction() {
   11.38 +
   11.39 +		return "overright";
   11.40 +	}
   11.41 +
   11.42 +
   11.43 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/PeriodContainedByFunc.java	Tue Nov 06 19:35:33 2012 +0200
    12.3 @@ -0,0 +1,42 @@
    12.4 +/**
    12.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    12.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    12.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    12.8 + *
    12.9 + * Copyright (C) 2012, Pyravlos Team
   12.10 + *
   12.11 + * http://www.strabon.di.uoa.gr/
   12.12 + */
   12.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   12.14 +
   12.15 +/**
   12.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   12.17 + *
   12.18 + */
   12.19 +public class PeriodContainedByFunc extends TemporalRelationFunc {
   12.20 +	
   12.21 +	
   12.22 +
   12.23 +	public String getURI() {
   12.24 +		return TemporalConstants.containedByPeriod;
   12.25 +
   12.26 +	}
   12.27 +
   12.28 +
   12.29 +	@Override
   12.30 +	public String getOperator() {
   12.31 +		return "@";
   12.32 +	}
   12.33 +
   12.34 +
   12.35 +	/* (non-Javadoc)
   12.36 +	 * @see org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalRelationFunc#getPostgresFunction()
   12.37 +	 */
   12.38 +	@Override
   12.39 +	public String getPostgresFunction() {
   12.40 +		// TODO Auto-generated method stub
   12.41 +		return null;
   12.42 +	}
   12.43 +
   12.44 +
   12.45 +}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/PeriodContainsFunc.java	Tue Nov 06 19:35:33 2012 +0200
    13.3 @@ -0,0 +1,40 @@
    13.4 +/**
    13.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    13.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    13.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    13.8 + *
    13.9 + * Copyright (C) 2012, Pyravlos Team
   13.10 + *
   13.11 + * http://www.strabon.di.uoa.gr/
   13.12 + */
   13.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   13.14 +
   13.15 +
   13.16 +/**
   13.17 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   13.18 + *
   13.19 + */
   13.20 +public class PeriodContainsFunc extends TemporalRelationFunc {
   13.21 +	
   13.22 +    
   13.23 +	@Override
   13.24 +	public String getURI() {
   13.25 +	
   13.26 +		return TemporalConstants.periodContains;
   13.27 +	}
   13.28 +
   13.29 +	
   13.30 +	@Override
   13.31 +	public String getOperator() {
   13.32 +		return "~";
   13.33 +	}
   13.34 +
   13.35 +
   13.36 +	@Override
   13.37 +	public String getPostgresFunction() {
   13.38 +
   13.39 +		return "contains";
   13.40 +	}
   13.41 +
   13.42 +
   13.43 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalConstants.java	Tue Nov 06 19:35:33 2012 +0200
    14.3 @@ -0,0 +1,48 @@
    14.4 +/**
    14.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    14.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    14.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    14.8 + *
    14.9 + * Copyright (C) 2012, Pyravlos Team
   14.10 + *
   14.11 + * http://www.strabon.di.uoa.gr/
   14.12 + */
   14.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   14.14 +
   14.15 +import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants;
   14.16 +
   14.17 +/**
   14.18 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   14.19 + *
   14.20 + */
   14.21 +public class TemporalConstants extends GeoConstants {
   14.22 +	
   14.23 +	//Temporal Relationships
   14.24 +	public static final String periodContains= stRDF+ "PeriodContains";
   14.25 +
   14.26 +	public static final String containedByPeriod= stRDF+ "containedByPeriod";
   14.27 +
   14.28 +	public static final String periodOverlaps= stRDF+ "PeriodOverlaps";
   14.29 +
   14.30 +	public static final String equalsPeriod= stRDF+ "equalsPeriod";
   14.31 +
   14.32 +	public static final String nequalsPeriod= stRDF+ "nequalsPeriod";
   14.33 +
   14.34 +	public static final String adjacentPeriod= stRDF+ "adjacentPeriod";
   14.35 +
   14.36 +	public static final String beforePeriod= stRDF+ "beforePeriod";
   14.37 +
   14.38 +	public static final String afterPeriod=stRDF+ "afterPeriod";
   14.39 +
   14.40 +	public static final String overleftPeriod=stRDF+ "overleftPeriod";
   14.41 +
   14.42 +	public static final String overrightPeriod=stRDF+ "overrightPeriod";
   14.43 +
   14.44 +	public static final String meetsPeriod=stRDF+ "meetsPeriod";
   14.45 +	
   14.46 +	//Temporal Constructs
   14.47 +	public static final String periodIntersection=stRDF+ "periodIntersection";
   14.48 +	public static final String periodUnion=stRDF+ "periodUnion";
   14.49 +	public static final String minusPeriod=stRDF+ "minusPeriod";
   14.50 +
   14.51 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalRelationFunc.java	Tue Nov 06 19:35:33 2012 +0200
    15.3 @@ -0,0 +1,43 @@
    15.4 +/**
    15.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    15.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    15.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    15.8 + *
    15.9 + * Copyright (C) 2012, Pyravlos Team
   15.10 + *
   15.11 + * http://www.strabon.di.uoa.gr/
   15.12 + */
   15.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   15.14 +
   15.15 +import org.openrdf.model.Value;
   15.16 +import org.openrdf.model.ValueFactory;
   15.17 +import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
   15.18 +import org.openrdf.query.algebra.evaluation.function.Function;
   15.19 +
   15.20 +/**
   15.21 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   15.22 + * This class is the superclass of all Temporal Relation Functions that implement sesame's Function interface
   15.23 + *
   15.24 + */
   15.25 +public abstract class TemporalRelationFunc implements Function {
   15.26 +	
   15.27 +
   15.28 +	public Value evaluate(ValueFactory valueFactory, Value... args)
   15.29 +			throws ValueExprEvaluationException {
   15.30 +
   15.31 +				return null;
   15.32 +			}
   15.33 +
   15.34 +		
   15.35 +	public abstract  String getURI();
   15.36 +	
   15.37 +	/*In Postgres Temporal it seems that an operator is assigned to every PERIOD function 
   15.38 +	 * I store this information in the declaration of each function so that i can use it in the mapping
   15.39 +	 * of stSPARQL queries to spatiotemporally extended SQL queries
   15.40 +	 * */
   15.41 +	public abstract  String getOperator();
   15.42 +	//This method returns the respective function of the Postgres Temporal extension
   15.43 +	public abstract  String getPostgresFunction();
   15.44 +
   15.45 +}
   15.46 +
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/periodOverlapsFunc.java	Tue Nov 06 19:35:33 2012 +0200
    16.3 @@ -0,0 +1,38 @@
    16.4 +/**
    16.5 + * This Source Code Form is subject to the terms of the Mozilla Public
    16.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    16.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    16.8 + *
    16.9 + * Copyright (C) 2012, Pyravlos Team
   16.10 + *
   16.11 + * http://www.strabon.di.uoa.gr/
   16.12 + */
   16.13 +package org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation;
   16.14 +
   16.15 +/**
   16.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
   16.17 + *
   16.18 + */
   16.19 +public class periodOverlapsFunc extends TemporalRelationFunc {
   16.20 +	    
   16.21 +	@Override
   16.22 +	public String getURI(){
   16.23 +	
   16.24 +		return TemporalConstants.periodOverlaps;
   16.25 +	}
   16.26 +
   16.27 +	
   16.28 +	@Override
   16.29 +	public String getOperator() {
   16.30 +		return "&&";
   16.31 +	}
   16.32 +
   16.33 +
   16.34 +	@Override
   16.35 +	public String getPostgresFunction() {
   16.36 +		
   16.37 +		return "overlaps";
   16.38 +	}
   16.39 +
   16.40 +
   16.41 +}
   16.42 \ No newline at end of file
    17.1 --- a/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function	Tue Nov 06 01:13:57 2012 +0200
    17.2 +++ b/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function	Tue Nov 06 19:35:33 2012 +0200
    17.3 @@ -6,6 +6,24 @@
    17.4  org.openrdf.query.algebra.evaluation.function.BooleanCast
    17.5  org.openrdf.query.algebra.evaluation.function.DateTimeCast
    17.6  org.openrdf.query.algebra.evaluation.function.link.SimilarTermFunc
    17.7 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants.java
    17.8 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.TemporalConstructFunc.java
    17.9 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalRelationFunc.java
   17.10 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodIntersectionFunc.java
   17.11 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodMinusFunc.java
   17.12 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.periodUnionFunc.java
   17.13 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.AdjacentPeriodFunc.java
   17.14 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.relation/AfterPeriodFunc.java
   17.15 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.BeforePeriodFunc.java
   17.16 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.EqualsPeriodFunc.java
   17.17 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.NequalsPeriodFunc.java
   17.18 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.OverleftPeriodFunc.java
   17.19 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.OverrightPeriodFunc.java
   17.20 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.PeriodContainedByFunc.java
   17.21 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.PeriodContainsFunc.java
   17.22 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants.java
   17.23 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalRelationFunc.java
   17.24 +org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.periodOverlapsFunc.java
   17.25  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbIntersectsFunc
   17.26  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbContainsFunc
   17.27  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.mbb.MbbInsideFunc