Strabon

changeset 1397:42f26a9fe609

changed also MonetDB createGeoValue() for bug #71
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Sep 19 10:40:06 2014 +0300 (2014-09-19)
parents 63037c4974c5
children 08acbf7620dc
files generaldb/src/main/java/org/openrdf/sail/generaldb/iteration/GeneralDBBindingIteration.java generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java monetdb/src/main/java/org/openrdf/sail/monetdb/iteration/MonetDBBindingIteration.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/iteration/GeneralDBBindingIteration.java	Fri Sep 19 02:45:20 2014 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/iteration/GeneralDBBindingIteration.java	Fri Sep 19 10:40:06 2014 +0300
     1.3 @@ -25,11 +25,10 @@
     1.4  import org.openrdf.sail.rdbms.model.RdbmsResource;
     1.5  import org.openrdf.sail.rdbms.model.RdbmsValue;
     1.6  
     1.7 -import eu.earthobservatory.constants.GeoConstants;
     1.8 -
     1.9  /**
    1.10   * Converts a {@link ResultSet} into a {@link BindingSet} in an iteration.
    1.11   * 
    1.12 + * @author Charalampos Nikolaou <charnik@di.uoa.gr.
    1.13   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.14   */
    1.15  public abstract class GeneralDBBindingIteration extends RdbmIterationBase<BindingSet, QueryEvaluationException> {
    1.16 @@ -206,6 +205,21 @@
    1.17  	 * literals. What about geo:wktLiteral?
    1.18  	 * However, this method is called by {@link convert} method only, which
    1.19  	 * in turn is not called by any method!
    1.20 +	 * 
    1.21 +	 */
    1.22 +	
    1.23 +	/**
    1.24 +	 * Creates a geospatial value from the given result set and index position.
    1.25 +	 * When projecting on a geospatial value, we get also its SRID, and its 
    1.26 +	 * datatype, so that we are able to assign that datatype to the new value. 
    1.27 +	 * 
    1.28 +	 * @param rs the current result set over which we are iterating
    1.29 +	 * @param index the index position to start reading from
    1.30 +	 *        index + 1: geospatial value (in binary)
    1.31 +	 *        index + 2: SRID
    1.32 +	 *        index + 3: datatype
    1.33 +	 * @return
    1.34 +	 * @throws SQLException
    1.35  	 */
    1.36  	protected abstract RdbmsValue createGeoValue(ResultSet rs, int index)
    1.37  	throws SQLException;
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java	Fri Sep 19 02:45:20 2014 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java	Fri Sep 19 10:40:06 2014 +0300
     2.3 @@ -74,7 +74,7 @@
     2.4  	 * We used data from this tree traversal and supplied it to a new optimizer
     2.5  	 * that got the job done --> SpatialJoinOptimizer
     2.6  	 */
     2.7 -	private boolean spatiallyEnabled = false;
     2.8 +	//private boolean spatiallyEnabled = false;
     2.9  	//Will be used in the FOLLOWING - NEW - OPTIMIZER!
    2.10  	private int geo_values_occurences = 0;
    2.11  
     3.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/iteration/MonetDBBindingIteration.java	Fri Sep 19 02:45:20 2014 +0300
     3.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/iteration/MonetDBBindingIteration.java	Fri Sep 19 10:40:06 2014 +0300
     3.3 @@ -19,8 +19,8 @@
     3.4  /**
     3.5   * Converts a {@link ResultSet} into a {@link BindingSet} in an iteration.
     3.6   * 
     3.7 - * @author James Leigh
     3.8 - * 
     3.9 + * @author Charalampos Nikolaou <charnik@di.uoa.gr.
    3.10 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    3.11   */
    3.12  public class MonetDBBindingIteration extends GeneralDBBindingIteration {
    3.13  
    3.14 @@ -39,7 +39,8 @@
    3.15  			Blob labelBlob = rs.getBlob(index + 1);
    3.16      		byte[] label = labelBlob.getBytes((long)1, (int)labelBlob.length());
    3.17      		int srid = rs.getInt(index + 2);
    3.18 -			return vf.getRdbmsPolyhedron(id, GeoConstants.WKT, label, srid);
    3.19 +    		String datatype = rs.getString(index + 3);
    3.20 +			return vf.getRdbmsPolyhedron(id, datatype, label, srid);
    3.21  		}
    3.22  
    3.23  		return createResource(rs, index);