Strabon

changeset 1184:c17783a59b73 sqlite

made sqlite compile with the newest version of Strabon
author Dimitris Bilidas <grad0903@di.uoa.gr>
date Tue Jun 04 18:40:38 2013 +0300 (2013-06-04)
parents a92a8a80aae8
children f7051f450747
files postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java runtime/src/main/java/eu/earthobservatory/runtime/sqlite/StoreOp.java runtime/src/test/java/eu/earthobservatory/runtime/sqlite/TemplateTests.java sqlite/src/main/java/org/openrdf/sail/sqlite/SqliteSqlTable.java sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteEvaluation.java sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteQueryBuilder.java sqlite/src/main/java/org/openrdf/sail/sqlite/iteration/SqliteBindingIteration.java
line diff
     1.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Tue Jun 04 18:06:42 2013 +0300
     1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Tue Jun 04 18:40:38 2013 +0300
     1.3 @@ -708,7 +708,8 @@
     1.4  	@Override
     1.5  	protected void append(GeneralDBSqlGeoBuffer expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
     1.6  	{
     1.7 -		appendBuffer(expr, filter, SpatialFunctionsPostGIS.ST_Buffer);
     1.8 +		//appendBuffer(expr, filter, SpatialFunctionsPostGIS.ST_Buffer);
     1.9 +		throw new UnsupportedRdbmsOperatorException("ST_Buffer is not yet supported on sqlite.");
    1.10  	}
    1.11  
    1.12  	//XXX Different Behavior
    1.13 @@ -785,7 +786,8 @@
    1.14  	@Override
    1.15  	protected void append(GeneralDBSqlGeoDistance expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
    1.16  	{
    1.17 -		appendDistance(expr, filter, SpatialFunctionsPostGIS.ST_Distance);
    1.18 +		throw new UnsupportedRdbmsOperatorException("ST_Distance is not yet supported on sqlite.");
    1.19 +		//appendDistance(expr, filter, SpatialFunctionsPostGIS.ST_Distance);
    1.20  	}
    1.21  
    1.22  	@Override
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/sqlite/StoreOp.java	Tue Jun 04 18:06:42 2013 +0300
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/sqlite/StoreOp.java	Tue Jun 04 18:40:38 2013 +0300
     2.3 @@ -56,10 +56,10 @@
     2.4  		try {
     2.5  			strabon = new Strabon(db, libspatial, regex, false);
     2.6  			if (graph == null) {
     2.7 -				strabon.storeInRepo(src, format);
     2.8 +				strabon.storeInRepo(src, format, false);
     2.9  				
    2.10  			} else {
    2.11 -				strabon.storeInRepo(src, null, graph, format);
    2.12 +				strabon.storeInRepo(src, null, graph, format, false);
    2.13  			}
    2.14  			
    2.15  		} catch (Exception e) {
     3.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/sqlite/TemplateTests.java	Tue Jun 04 18:06:42 2013 +0300
     3.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/sqlite/TemplateTests.java	Tue Jun 04 18:40:38 2013 +0300
     3.3 @@ -112,7 +112,7 @@
     3.4  	protected static void loadTestData(String inputfile, Strabon strabon)
     3.5  		throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault
     3.6  	{
     3.7 -		strabon.storeInRepo(inputfile, "NTRIPLES");
     3.8 +		strabon.storeInRepo(inputfile, "NTRIPLES", false);
     3.9  	}
    3.10  
    3.11  	
     4.1 --- a/sqlite/src/main/java/org/openrdf/sail/sqlite/SqliteSqlTable.java	Tue Jun 04 18:06:42 2013 +0300
     4.2 +++ b/sqlite/src/main/java/org/openrdf/sail/sqlite/SqliteSqlTable.java	Tue Jun 04 18:40:38 2013 +0300
     4.3 @@ -2,11 +2,12 @@
     4.4  
     4.5  import java.sql.SQLException;
     4.6  
     4.7 -import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants;
     4.8  import org.openrdf.sail.generaldb.GeneralDBSqlTable;
     4.9  import org.slf4j.Logger;
    4.10  import org.slf4j.LoggerFactory;
    4.11  
    4.12 +import eu.earthobservatory.constants.GeoConstants;
    4.13 +
    4.14  /**
    4.15   * Converts table names to lower-case and include the analyse optimisation.
    4.16   * 
     5.1 --- a/sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteEvaluation.java	Tue Jun 04 18:06:42 2013 +0300
     5.2 +++ b/sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteEvaluation.java	Tue Jun 04 18:40:38 2013 +0300
     5.3 @@ -1,3 +1,12 @@
     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) 2013, Pyravlos Team
    5.10 + * 
    5.11 + * http://www.strabon.di.uoa.gr/
    5.12 + */
    5.13  package org.openrdf.sail.sqlite.evaluation;
    5.14  
    5.15  import info.aduna.iteration.CloseableIteration;
    5.16 @@ -5,7 +14,6 @@
    5.17  import java.sql.Connection;
    5.18  import java.sql.PreparedStatement;
    5.19  import java.sql.SQLException;
    5.20 -import java.sql.Statement;
    5.21  import java.util.ArrayList;
    5.22  import java.util.Collection;
    5.23  import java.util.List;
    5.24 @@ -20,28 +28,29 @@
    5.25  import org.openrdf.sail.generaldb.evaluation.GeneralDBEvaluation;
    5.26  import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory;
    5.27  import org.openrdf.sail.generaldb.iteration.GeneralDBBindingIteration;
    5.28 -import org.openrdf.sail.sqlite.iteration.SqliteBindingIteration;
    5.29 +import org.openrdf.sail.generaldb.schema.IdSequence;
    5.30  import org.openrdf.sail.rdbms.exceptions.RdbmsException;
    5.31  import org.openrdf.sail.rdbms.exceptions.RdbmsQueryEvaluationException;
    5.32  import org.openrdf.sail.rdbms.exceptions.UnsupportedRdbmsOperatorException;
    5.33 -import org.openrdf.sail.generaldb.schema.IdSequence;
    5.34 +import org.openrdf.sail.sqlite.iteration.SqliteBindingIteration;
    5.35 +import org.slf4j.Logger;
    5.36  import org.slf4j.LoggerFactory;
    5.37  
    5.38  /**
    5.39   * Extends the default strategy by accepting {@link GeneralDBSelectQuery} and evaluating
    5.40   * them on a database.
    5.41   * 
    5.42 - * @author James Leigh
    5.43 + * @author Dimitris Bilidas <grad0903@di.uoa.gr>
    5.44   * 
    5.45   */
    5.46  public class SqliteEvaluation extends GeneralDBEvaluation {
    5.47  
    5.48 -
    5.49 +	private static final Logger logger = LoggerFactory.getLogger(org.openrdf.sail.sqlite.evaluation.SqliteEvaluation.class);
    5.50 +	
    5.51  	public SqliteEvaluation(GeneralDBQueryBuilderFactory factory, GeneralDBTripleRepository triples, Dataset dataset,
    5.52  			IdSequence ids)
    5.53  	{
    5.54  		super(factory, triples, dataset, ids);
    5.55 -		logger = LoggerFactory.getLogger(SqliteEvaluation.class);
    5.56  		this.factory = factory;
    5.57  	}
    5.58  
     6.1 --- a/sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteQueryBuilder.java	Tue Jun 04 18:06:42 2013 +0300
     6.2 +++ b/sqlite/src/main/java/org/openrdf/sail/sqlite/evaluation/SqliteQueryBuilder.java	Tue Jun 04 18:40:38 2013 +0300
     6.3 @@ -1,10 +1,14 @@
     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) 2013, Pyravlos Team
    6.10 + * 
    6.11 + * http://www.strabon.di.uoa.gr/
    6.12 + */
    6.13  package org.openrdf.sail.sqlite.evaluation;
    6.14  
    6.15 -/*
    6.16 - * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
    6.17 - *
    6.18 - * Licensed under the Aduna BSD-style license.
    6.19 - */
    6.20  import java.util.ArrayList;
    6.21  import java.util.List;
    6.22  
    6.23 @@ -55,6 +59,8 @@
    6.24  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlOverlaps;
    6.25  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRelate;
    6.26  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRight;
    6.27 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_Centroid;
    6.28 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_MakeLine;
    6.29  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlSpatialConstructBinary;
    6.30  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlSpatialConstructUnary;
    6.31  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlSpatialMetricBinary;
    6.32 @@ -686,10 +692,16 @@
    6.33  
    6.34  	@Override
    6.35  	protected void append(GeneralDBSqlGeoBuffer expr, GeneralDBSqlExprBuilder filter)
    6.36 -			throws UnsupportedRdbmsOperatorException
    6.37 -			{
    6.38 -		appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Buffer);
    6.39 -			}
    6.40 +	throws UnsupportedRdbmsOperatorException
    6.41 +	{
    6.42 +		appendBuffer(expr, filter, SpatialFunctionsPostGIS.ST_Buffer);
    6.43 +	}
    6.44 +
    6.45 +	private void appendBuffer(GeneralDBSqlGeoBuffer expr,
    6.46 +			GeneralDBSqlExprBuilder filter, SpatialFunctionsPostGIS stBuffer) {
    6.47 +		// TODO Auto-generated method stub
    6.48 +		
    6.49 +	}
    6.50  
    6.51  	//XXX Different Behavior
    6.52  	@Override
    6.53 @@ -759,7 +771,8 @@
    6.54  	protected void append(GeneralDBSqlGeoDistance expr, GeneralDBSqlExprBuilder filter)
    6.55  			throws UnsupportedRdbmsOperatorException
    6.56  			{
    6.57 -		appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Distance);
    6.58 +		//appendDistance(expr, filter, SpatialFunctionsPostGIS.ST_Distance);
    6.59 +		throw new UnsupportedRdbmsOperatorException("ST_Distance is not yet supported on sqlite.");
    6.60  			}
    6.61  
    6.62  	@Override
    6.63 @@ -2483,4 +2496,20 @@
    6.64  		filter.closeBracket();
    6.65  			}
    6.66  
    6.67 +	@Override
    6.68 +	protected void append(GeneralDBSqlST_MakeLine expr,
    6.69 +			GeneralDBSqlExprBuilder filter)
    6.70 +			throws UnsupportedRdbmsOperatorException {
    6.71 +		// TODO Auto-generated method stub
    6.72 +		
    6.73 +	}
    6.74 +
    6.75 +	@Override
    6.76 +	protected void append(GeneralDBSqlST_Centroid expr,
    6.77 +			GeneralDBSqlExprBuilder filter)
    6.78 +			throws UnsupportedRdbmsOperatorException {
    6.79 +		// TODO Auto-generated method stub
    6.80 +		
    6.81 +	}
    6.82 +
    6.83  }
     7.1 --- a/sqlite/src/main/java/org/openrdf/sail/sqlite/iteration/SqliteBindingIteration.java	Tue Jun 04 18:06:42 2013 +0300
     7.2 +++ b/sqlite/src/main/java/org/openrdf/sail/sqlite/iteration/SqliteBindingIteration.java	Tue Jun 04 18:40:38 2013 +0300
     7.3 @@ -1,3 +1,12 @@
     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) 2013, Pyravlos Team
    7.10 + * 
    7.11 + * http://www.strabon.di.uoa.gr/
    7.12 + */
    7.13  package org.openrdf.sail.sqlite.iteration;
    7.14  
    7.15  import java.sql.PreparedStatement;
    7.16 @@ -5,14 +14,15 @@
    7.17  import java.sql.SQLException;
    7.18  
    7.19  import org.openrdf.query.BindingSet;
    7.20 -import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants;
    7.21  import org.openrdf.sail.generaldb.iteration.GeneralDBBindingIteration;
    7.22  import org.openrdf.sail.rdbms.model.RdbmsValue;
    7.23  
    7.24 +import eu.earthobservatory.constants.GeoConstants;
    7.25 +
    7.26  /**
    7.27   * Converts a {@link ResultSet} into a {@link BindingSet} in an iteration.
    7.28   * 
    7.29 - * @author Manos Karpathiotakis <mk@di.uoa.gr>
    7.30 + * @author Dimitris Bilidas <grad0903@di.uoa.gr>
    7.31   * 
    7.32   */
    7.33  public class SqliteBindingIteration extends GeneralDBBindingIteration {