Strabon
changeset 689:516dec652431 temporals
Completed license, author information and some comments on my code. Also extended GeneralDBColumnVar with carrying temporal information.
line diff
1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBColumnVar.java Mon Nov 05 21:33:07 2012 +0200 1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBColumnVar.java Tue Nov 06 01:13:57 2012 +0200 1.3 @@ -35,7 +35,7 @@ 1.4 1.5 private String alias; 1.6 1.7 - 1.8 + private boolean temporal = false; 1.9 1.10 private String column; 1.11 1.12 @@ -160,8 +160,24 @@ 1.13 } 1.14 return var; 1.15 } 1.16 - 1.17 +//checks whether the sql variable is a temporal variable 1.18 1.19 + public static GeneralDBColumnVar createTemporalColumn(String alias, Var v, Value value) { 1.20 + GeneralDBColumnVar var = new GeneralDBColumnVar(); 1.21 + var.alias = alias; 1.22 + var.column = "id"; 1.23 + var.name = v.getName(); 1.24 + var.anonymous = v.isAnonymous(); 1.25 + var.value = value; 1.26 + var.types = ValueTypes.UNKNOWN; 1.27 + if (value instanceof RdbmsResource) { 1.28 + var.types = ValueTypes.RESOURCE; 1.29 + } 1.30 + 1.31 + var.setTemporal(true); 1.32 + 1.33 + return var; 1.34 + } 1.35 1.36 public boolean isSpatial() { 1.37 return spatial; 1.38 @@ -302,4 +318,13 @@ 1.39 return sb.toString(); 1.40 } 1.41 1.42 + public boolean isTemporal() { 1.43 + return temporal; 1.44 + } 1.45 + 1.46 + public void setTemporal(boolean temporal) { 1.47 + this.temporal = temporal; 1.48 + } 1.49 + 1.50 + 1.51 }
2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/PeriodTable.java Mon Nov 05 21:33:07 2012 +0200 2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/PeriodTable.java Tue Nov 06 01:13:57 2012 +0200 2.3 @@ -1,3 +1,18 @@ 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 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> 2.14 + * 2.15 + * PeriodTable extends the underlying rdbms schema of Strabon with one more table for storing period values. 2.16 + * These values are of Postgres Temporal PERIOD datatype. An Gist index is also used. 2.17 + */ 2.18 + 2.19 package org.openrdf.sail.generaldb.schema; 2.20 2.21 import java.sql.PreparedStatement; 2.22 @@ -11,16 +26,7 @@ 2.23 import org.openrdf.sail.generaldb.GeneralDBSqlTable; 2.24 import org.openrdf.sail.rdbms.schema.RdbmsTable; 2.25 2.26 -/** 2.27 - * Modified to be used with a valid time-enabled table 2.28 - * 2.29 - * Manages the rows in a value table. These tables have two columns: an internal 2.30 - * id column and a value (PERIOD) column 2.31 - * 2.32 - * @author James Leigh 2.33 - * @author Konstantina Bereta 2.34 - * 2.35 - */ 2.36 + 2.37 2.38 public class PeriodTable { 2.39 public static int BATCH_SIZE = 8 * 1024;
3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java Mon Nov 05 21:33:07 2012 +0200 3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java Tue Nov 06 01:13:57 2012 +0200 3.3 @@ -2,11 +2,19 @@ 3.4 * This Source Code Form is subject to the terms of the Mozilla Public 3.5 * License, v. 2.0. If a copy of the MPL was not distributed with this 3.6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 3.7 + * 3.8 + * Copyright (C) 2012, Pyravlos Team 3.9 + * 3.10 + * http://www.strabon.di.uoa.gr/ 3.11 * 3.12 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 3.13 - * 3.14 - * http://www.strabon.di.uoa.gr/ 3.15 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> 3.16 + * 3.17 + *This class implements a basic RDFS inference mechanism on the Geosparql ontology. A RDFHandler is 3.18 + *used to handle each Geosparql by applying the RDFS inferencing rules and producing inferences. 3.19 + *This was a solution for supporting one of the basic components of Geosparql as Strabon currently lacks in 3.20 + *general RDFS inference mechanisms. 3.21 */ 3.22 + 3.23 package eu.earthobservatory.runtime.generaldb; 3.24 3.25 import java.io.StringReader;
4.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsParser.java Mon Nov 05 21:33:07 2012 +0200 4.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsParser.java Tue Nov 06 01:13:57 2012 +0200 4.3 @@ -18,6 +18,20 @@ 4.4 import java.util.regex.Pattern; 4.5 4.6 import javax.naming.StringRefAddr; 4.7 +/** 4.8 + * This Source Code Form is subject to the terms of the Mozilla Public 4.9 + * License, v. 2.0. If a copy of the MPL was not distributed with this 4.10 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 4.11 + * 4.12 + * Copyright (C) 2012, Pyravlos Team 4.13 + * 4.14 + * http://www.strabon.di.uoa.gr/ 4.15 + * 4.16 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> 4.17 + * 4.18 + * based on code provided by ua Shinavier (http://fortytwo.net). Builds on code by Aduna. 4.19 + * 4.20 + */ 4.21 4.22 /** 4.23 * RDFParser implementation for the N-Quads RDF format. 4.24 @@ -27,7 +41,6 @@ 4.25 * 2) private member variables made public: reader, lineno, subject, predcate, object 4.26 * 3) private methods: skipWhitespace, skipLine, parseSubject, parsePredicate, parseObject, throwEOFException 4.27 * 4.28 - * @author Joshua Shinavier (http://fortytwo.net). Builds on code by Aduna. 4.29 */ 4.30 public class NQuadsParser extends ModifiedNTriplesParser { 4.31 protected Resource context;
5.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsTranslator.java Mon Nov 05 21:33:07 2012 +0200 5.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsTranslator.java Tue Nov 06 01:13:57 2012 +0200 5.3 @@ -1,3 +1,18 @@ 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 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> 5.14 + * 5.15 + *This class can be considered as a wrapper which makes the conversion from quadruples into valid time 5.16 + *annotated triples, with valid time annotation being stored as a named graph. 5.17 + */ 5.18 + 5.19 package eu.earthobservatory.runtime.generaldb; 5.20 5.21 import java.io.IOException;
6.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java Mon Nov 05 21:33:07 2012 +0200 6.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java Tue Nov 06 01:13:57 2012 +0200 6.3 @@ -1,3 +1,18 @@ 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 + * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> 6.14 + * 6.15 + * This class handles every quadruple statement by using the fourth element as a named graph and 6.16 + * creates another triple to annotate the former statement with valid time in the default graph 6.17 + * 6.18 + */ 6.19 package eu.earthobservatory.runtime.generaldb; 6.20 6.21 import java.text.ParseException;