Strabon

changeset 343:ee84ac7678c4

Added factory classes for stSPARQL XML, KML, and GeoJSON formats
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Jun 25 13:47:09 2012 +0300 (2012-06-25)
parents 7837e4b7fd73
children 4db12593a767
files resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriterFactory.java resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsKMLWriter.java resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsKMLWriterFactory.java resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriterFactory.java resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultFormat.java
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriterFactory.java	Mon Jun 25 13:47:09 2012 +0300
     1.3 @@ -0,0 +1,26 @@
     1.4 +package org.openrdf.query.resultio.sparqljson;
     1.5 +
     1.6 +import java.io.OutputStream;
     1.7 +
     1.8 +import org.openrdf.query.resultio.TupleQueryResultFormat;
     1.9 +import org.openrdf.query.resultio.TupleQueryResultWriter;
    1.10 +import org.openrdf.query.resultio.TupleQueryResultWriterFactory;
    1.11 +import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    1.12 +
    1.13 +/**
    1.14 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    1.15 + *
    1.16 + */
    1.17 +public class stSPARQLResultsGeoJSONWriterFactory implements TupleQueryResultWriterFactory {
    1.18 +
    1.19 +	@Override
    1.20 +	public TupleQueryResultFormat getTupleQueryResultFormat() {
    1.21 +		return stSPARQLQueryResultFormat.GEOJSON;
    1.22 +	}
    1.23 +
    1.24 +	@Override
    1.25 +	public TupleQueryResultWriter getWriter(OutputStream out) {
    1.26 +		return new stSPARQLResultsGeoJSONWriter(out);
    1.27 +	}
    1.28 +
    1.29 +}
     2.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsKMLWriter.java	Mon Jun 25 13:28:37 2012 +0300
     2.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsKMLWriter.java	Mon Jun 25 13:47:09 2012 +0300
     2.3 @@ -3,7 +3,6 @@
     2.4  import java.io.ByteArrayOutputStream;
     2.5  import java.io.IOException;
     2.6  import java.io.OutputStream;
     2.7 -import java.io.UnsupportedEncodingException;
     2.8  import java.util.List;
     2.9  
    2.10  import javax.xml.namespace.QName;
    2.11 @@ -116,10 +115,9 @@
    2.12  	 * results in KML.
    2.13  	 * 
    2.14  	 * @param out
    2.15 -	 * @throws UnsupportedEncodingException
    2.16  	 */
    2.17 -	public stSPARQLResultsKMLWriter(OutputStream out) throws UnsupportedEncodingException {
    2.18 -		this(new stSPARQLXMLWriter(out, "UTF-8"));
    2.19 +	public stSPARQLResultsKMLWriter(OutputStream out) {
    2.20 +		this(new stSPARQLXMLWriter(out));
    2.21  	}
    2.22  	
    2.23  	public stSPARQLResultsKMLWriter(stSPARQLXMLWriter writer) {
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsKMLWriterFactory.java	Mon Jun 25 13:47:09 2012 +0300
     3.3 @@ -0,0 +1,26 @@
     3.4 +package org.openrdf.query.resultio.sparqlxml;
     3.5 +
     3.6 +import java.io.OutputStream;
     3.7 +
     3.8 +import org.openrdf.query.resultio.TupleQueryResultFormat;
     3.9 +import org.openrdf.query.resultio.TupleQueryResultWriter;
    3.10 +import org.openrdf.query.resultio.TupleQueryResultWriterFactory;
    3.11 +import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    3.12 +
    3.13 +/**
    3.14 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    3.15 + *
    3.16 + */
    3.17 +public class stSPARQLResultsKMLWriterFactory implements TupleQueryResultWriterFactory {
    3.18 +
    3.19 +	@Override
    3.20 +	public TupleQueryResultFormat getTupleQueryResultFormat() {
    3.21 +		return stSPARQLQueryResultFormat.KML;
    3.22 +	}
    3.23 +
    3.24 +	@Override
    3.25 +	public TupleQueryResultWriter getWriter(OutputStream out) {
    3.26 +		return new stSPARQLResultsKMLWriter(out);
    3.27 +	}
    3.28 +
    3.29 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriterFactory.java	Mon Jun 25 13:47:09 2012 +0300
     4.3 @@ -0,0 +1,25 @@
     4.4 +package org.openrdf.query.resultio.sparqlxml;
     4.5 +
     4.6 +import java.io.OutputStream;
     4.7 +
     4.8 +import org.openrdf.query.resultio.TupleQueryResultFormat;
     4.9 +import org.openrdf.query.resultio.TupleQueryResultWriter;
    4.10 +import org.openrdf.query.resultio.TupleQueryResultWriterFactory;
    4.11 +
    4.12 +/**
    4.13 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    4.14 + *
    4.15 + */
    4.16 +public class stSPARQLResultsXMLWriterFactory implements TupleQueryResultWriterFactory {
    4.17 +
    4.18 +	@Override
    4.19 +	public TupleQueryResultFormat getTupleQueryResultFormat() {
    4.20 +		return TupleQueryResultFormat.SPARQL;
    4.21 +	}
    4.22 +
    4.23 +	@Override
    4.24 +	public TupleQueryResultWriter getWriter(OutputStream out) {
    4.25 +		return new stSPARQLResultsXMLWriter(out);
    4.26 +	}
    4.27 +
    4.28 +}
     5.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultFormat.java	Mon Jun 25 13:28:37 2012 +0300
     5.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultFormat.java	Mon Jun 25 13:47:09 2012 +0300
     5.3 @@ -18,7 +18,7 @@
     5.4   * as an additional description for a feature (e.g., a tuple query result with
     5.5   * a projected variable corresponding to a geometry). 
     5.6   * 
     5.7 - * @author Charlampos Nikolaou <charnik@di.uoa.gr>
     5.8 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
     5.9   *
    5.10   */
    5.11  public class stSPARQLQueryResultFormat extends TupleQueryResultFormat {