Strabon

changeset 1018:88e2bc9da9cd

changed GeosparqlRDFHandlerBase to extend RDFInserter instead of RDFHandlerBase
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Apr 09 00:48:38 2013 +0300 (2013-04-09)
parents 093aeabd52a7
children f488c7c3d433
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Tue Apr 09 00:36:27 2013 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/GeosparqlRDFHandlerBase.java	Tue Apr 09 00:48:38 2013 +0300
     1.3 @@ -14,6 +14,8 @@
     1.4  import org.openrdf.model.Statement;
     1.5  import org.openrdf.model.vocabulary.RDF;
     1.6  import org.openrdf.model.vocabulary.RDFS;
     1.7 +import org.openrdf.repository.RepositoryConnection;
     1.8 +import org.openrdf.repository.util.RDFInserter;
     1.9  import org.openrdf.rio.helpers.RDFHandlerBase;
    1.10  import org.openrdf.rio.ntriples.NTriplesParser;
    1.11  
    1.12 @@ -26,10 +28,14 @@
    1.13   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    1.14   * @author Konstantina Bereta <konstantina.bereta@di.uoa.gr>
    1.15   */
    1.16 -public class GeosparqlRDFHandlerBase extends RDFHandlerBase {
    1.17 +public class GeosparqlRDFHandlerBase extends RDFInserter {
    1.18  	
    1.19  	//private static final Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.generaldb.GeosparqlRDFHandlerBase.class);
    1.20  	
    1.21 +	public GeosparqlRDFHandlerBase(RepositoryConnection con) {
    1.22 +		super(con);
    1.23 +	}
    1.24 +
    1.25  	private static final boolean ENABLE_INFERENCE = false;
    1.26  	
    1.27  	private static String TYPE 		= RDF.TYPE.stringValue();
    1.28 @@ -485,7 +491,7 @@
    1.29  		
    1.30  		StringReader reader = new StringReader(gmltext);
    1.31  
    1.32 -		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase();
    1.33 +		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase(null);
    1.34  
    1.35  		handler.startRDF();
    1.36  		parser.setRDFHandler(handler);
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Apr 09 00:36:27 2013 +0300
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Apr 09 00:48:38 2013 +0300
     2.3 @@ -128,7 +128,6 @@
     2.4  		System.setProperty("org.geotools.referencing.forceXY", "true");
     2.5  		
     2.6  		//our repository
     2.7 -		//repo1 = new SailRepository(db_store);
     2.8  		repo = new GeneralDBSailRepository(db_store);
     2.9  
    2.10  		try {
    2.11 @@ -387,7 +386,7 @@
    2.12  
    2.13  		RDFParser parser = Rio.createParser(format);
    2.14  
    2.15 -		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase();
    2.16 +		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase(con);
    2.17  
    2.18  		parser.setRDFHandler(handler);
    2.19  		parser.parse(reader, "");
    2.20 @@ -429,7 +428,7 @@
    2.21  
    2.22  		RDFParser parser = Rio.createParser(format);
    2.23  
    2.24 -		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase();
    2.25 +		GeosparqlRDFHandlerBase handler = new GeosparqlRDFHandlerBase(con);
    2.26  
    2.27  		parser.setRDFHandler(handler);
    2.28  		parser.parse(reader, "");