Strabon

changeset 657:e3b9342f0914 temporals

updated literal manager to handle valid period datatype, tool and make an insertion in temporal table
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed Oct 24 17:53:16 2012 +0300 (2012-10-24)
parents b4f3521af846
children c273bdca2caf
files generaldb/src/main/java/org/openrdf/sail/generaldb/managers/LiteralManager.java generaldb/src/main/java/org/openrdf/sail/generaldb/model/XMLGSDatatypeUtil.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/LiteralManager.java	Wed Oct 24 17:40:50 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/LiteralManager.java	Wed Oct 24 17:53:16 2012 +0300
     1.3 @@ -130,8 +130,11 @@
     1.4  					{
     1.5  						table.insertGeoSpatial(id, label,dt,null,null);
     1.6  					}
     1.7 +					else if(XMLGSDatatypeUtil.isPeriodDatatype(datatype)) // valid period  case- Constant
     1.8 +					{ //TODO remember that the period should be validated, haven't decided the level yet though
     1.9 +						table.insertTemporal(id, label);
    1.10 +					}
    1.11  				}
    1.12 -				
    1.13  			}
    1.14  			catch (NumberFormatException e) {
    1.15  				table.insertDatatype(id, label, dt);
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/model/XMLGSDatatypeUtil.java	Wed Oct 24 17:40:50 2012 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/model/XMLGSDatatypeUtil.java	Wed Oct 24 17:53:16 2012 +0300
     2.3 @@ -46,6 +46,9 @@
     2.4  	 * @param value
     2.5  	 * @return
     2.6  	 * @author Charalampos Nikolaou <charniK@di.uoa.gr>
     2.7 +	 * 
     2.8 +	 * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
     2.9 +	 * added period datatype validator as well for storing valid time period literals
    2.10  	 */
    2.11  	public static boolean isGeometryValue(Value value) {
    2.12  		if (value instanceof Literal) {
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Wed Oct 24 17:40:50 2012 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Wed Oct 24 17:53:16 2012 +0300
     3.3 @@ -28,6 +28,9 @@
     3.4   * 
     3.5   * @author James Leigh
     3.6   * 
     3.7 + * @author Konstantina Bereta (aka constant) 
     3.8 + *  Added table and functions for storing valid time literalsl with period datatype
     3.9 + * 
    3.10   */
    3.11  public class LiteralTable {
    3.12  
    3.13 @@ -187,7 +190,7 @@
    3.14  	 * @throws InterruptedException 
    3.15  	 * @throws SQLException 
    3.16  	 * @throws NullPointerException ******************************************************************/
    3.17 -	public void insertTemporall(Integer id, String label) throws NullPointerException, SQLException, InterruptedException
    3.18 +	public void insertTemporal(Number id, String label) throws NullPointerException, SQLException, InterruptedException
    3.19  	{
    3.20  
    3.21  		//TODO the label should be validated as a period before reaching this point. Not sure yet on which level this should be done