Strabon
changeset 361:d6319e10dbcc
moved Format to resultio package
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Mon Jun 25 20:58:45 2012 +0300 (2012-06-25) |
parents | 67376341384d |
children | de06ce11788d |
files | endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java resultio/src/main/java/org/openrdf/query/resultio/Format.java resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/Format.java resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultWriterFactory.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryDir.java runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryOp.java runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryDir.java runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryOp.java |
line diff
1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java Mon Jun 25 20:53:02 2012 +0300 1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java Mon Jun 25 20:58:45 2012 +0300 1.3 @@ -12,7 +12,7 @@ 1.4 import org.openrdf.query.MalformedQueryException; 1.5 import org.openrdf.query.QueryEvaluationException; 1.6 import org.openrdf.query.TupleQueryResultHandlerException; 1.7 -import org.openrdf.query.resultio.sparqlxml.Format; 1.8 +import org.openrdf.query.resultio.Format; 1.9 import org.openrdf.repository.RepositoryException; 1.10 import org.openrdf.repository.sail.SailRepositoryConnection; 1.11 import org.openrdf.rio.RDFFormat;
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/Format.java Mon Jun 25 20:58:45 2012 +0300 2.3 @@ -0,0 +1,97 @@ 2.4 +package org.openrdf.query.resultio; 2.5 + 2.6 +import java.util.HashMap; 2.7 +import java.util.Map; 2.8 + 2.9 +/** 2.10 + * This enumeration type represents the available formats 2.11 + * for the results of the evaluation of a SPARQL query. 2.12 + * 2.13 + * @author Charalampos Nikolaou <charnik@di.uoa.gr> 2.14 + * 2.15 + */ 2.16 +public enum Format { 2.17 + 2.18 + /** 2.19 + * Default format 2.20 + */ 2.21 + DEFAULT(""), 2.22 + 2.23 + /** 2.24 + * XML format 2.25 + */ 2.26 + XML("XML"), 2.27 + 2.28 + /** 2.29 + * KML format 2.30 + */ 2.31 + KML("KML"), 2.32 + 2.33 + /** 2.34 + * KMZ format (compressed KML) 2.35 + */ 2.36 + KMZ("KMZ"), 2.37 + 2.38 + /** 2.39 + * GeoJSON format 2.40 + */ 2.41 + GEOJSON("GeoJSON"), 2.42 + 2.43 + /** 2.44 + * Format for experiments 2.45 + */ 2.46 + EXP("EXP"), 2.47 + 2.48 + /** 2.49 + * HTML format 2.50 + */ 2.51 + HTML("HTML"), 2.52 + 2.53 + /** 2.54 + * Invalid format. 2.55 + */ 2.56 + INVALID("INVALID"); 2.57 + 2.58 + /** 2.59 + * The string representation of this format 2.60 + */ 2.61 + private String name; 2.62 + 2.63 + /** 2.64 + * Map a string constant to a Format 2.65 + */ 2.66 + private static final Map<String, Format> stringToEnum = new HashMap<String, Format>(); 2.67 + 2.68 + 2.69 + static { // initialize map from constant name to enum constant 2.70 + for (Format format : values()) { 2.71 + // add both upper- and lower-case versions of the format 2.72 + stringToEnum.put(format.toString(), format); 2.73 + stringToEnum.put(format.toString().toLowerCase(), format); 2.74 + } 2.75 + } 2.76 + 2.77 + /** 2.78 + * Format constructor. 2.79 + * 2.80 + * @param name 2.81 + */ 2.82 + Format(String name) { 2.83 + this.name = name; 2.84 + } 2.85 + 2.86 + @Override 2.87 + public String toString() { 2.88 + return name; 2.89 + } 2.90 + 2.91 + /** 2.92 + * Returns a Format enum given a format string. 2.93 + * 2.94 + * @param lang 2.95 + * @return 2.96 + */ 2.97 + public static Format fromString(String format) { 2.98 + return (stringToEnum.get(format) == null) ? INVALID:stringToEnum.get(format); 2.99 + } 2.100 +}
3.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqlxml/Format.java Mon Jun 25 20:53:02 2012 +0300 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,97 +0,0 @@ 3.4 -package org.openrdf.query.resultio.sparqlxml; 3.5 - 3.6 -import java.util.HashMap; 3.7 -import java.util.Map; 3.8 - 3.9 -/** 3.10 - * This enumeration type represents the available formats 3.11 - * for the results of the evaluation of a SPARQL query. 3.12 - * 3.13 - * @author Charalampos Nikolaou <charnik@di.uoa.gr> 3.14 - * 3.15 - */ 3.16 -public enum Format { 3.17 - 3.18 - /** 3.19 - * Default format 3.20 - */ 3.21 - DEFAULT(""), 3.22 - 3.23 - /** 3.24 - * XML format 3.25 - */ 3.26 - XML("XML"), 3.27 - 3.28 - /** 3.29 - * KML format 3.30 - */ 3.31 - KML("KML"), 3.32 - 3.33 - /** 3.34 - * KMZ format (compressed KML) 3.35 - */ 3.36 - KMZ("KMZ"), 3.37 - 3.38 - /** 3.39 - * GeoJSON format 3.40 - */ 3.41 - GEOJSON("GeoJSON"), 3.42 - 3.43 - /** 3.44 - * Format for experiments 3.45 - */ 3.46 - EXP("EXP"), 3.47 - 3.48 - /** 3.49 - * HTML format 3.50 - */ 3.51 - HTML("HTML"), 3.52 - 3.53 - /** 3.54 - * Invalid format. 3.55 - */ 3.56 - INVALID("INVALID"); 3.57 - 3.58 - /** 3.59 - * The string representation of this format 3.60 - */ 3.61 - private String name; 3.62 - 3.63 - /** 3.64 - * Map a string constant to a Format 3.65 - */ 3.66 - private static final Map<String, Format> stringToEnum = new HashMap<String, Format>(); 3.67 - 3.68 - 3.69 - static { // initialize map from constant name to enum constant 3.70 - for (Format format : values()) { 3.71 - // add both upper- and lower-case versions of the format 3.72 - stringToEnum.put(format.toString(), format); 3.73 - stringToEnum.put(format.toString().toLowerCase(), format); 3.74 - } 3.75 - } 3.76 - 3.77 - /** 3.78 - * Format constructor. 3.79 - * 3.80 - * @param name 3.81 - */ 3.82 - Format(String name) { 3.83 - this.name = name; 3.84 - } 3.85 - 3.86 - @Override 3.87 - public String toString() { 3.88 - return name; 3.89 - } 3.90 - 3.91 - /** 3.92 - * Returns a Format enum given a format string. 3.93 - * 3.94 - * @param lang 3.95 - * @return 3.96 - */ 3.97 - public static Format fromString(String format) { 3.98 - return (stringToEnum.get(format) == null) ? INVALID:stringToEnum.get(format); 3.99 - } 3.100 -}
4.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultWriterFactory.java Mon Jun 25 20:53:02 2012 +0300 4.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/stSPARQLQueryResultWriterFactory.java Mon Jun 25 20:58:45 2012 +0300 4.3 @@ -7,7 +7,6 @@ 4.4 4.5 import org.openrdf.query.resultio.sparqlgeojson.stSPARQLResultsGeoJSONWriterFactory; 4.6 import org.openrdf.query.resultio.sparqlhtml.stSPARQLResultsHTMLWriterFactory; 4.7 -import org.openrdf.query.resultio.sparqlxml.Format; 4.8 import org.openrdf.query.resultio.sparqlxml.stSPARQLResultsKMLWriterFactory; 4.9 import org.openrdf.query.resultio.sparqlxml.stSPARQLResultsXMLWriterFactory; 4.10 import org.openrdf.query.resultio.text.stSPARQLResultsTSVWriterFactory;
5.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Mon Jun 25 20:53:02 2012 +0300 5.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Mon Jun 25 20:58:45 2012 +0300 5.3 @@ -31,10 +31,10 @@ 5.4 import org.openrdf.query.TupleQueryResultHandlerException; 5.5 import org.openrdf.query.Update; 5.6 import org.openrdf.query.UpdateExecutionException; 5.7 +import org.openrdf.query.resultio.Format; 5.8 import org.openrdf.query.resultio.TupleQueryResultWriter; 5.9 import org.openrdf.query.resultio.stSPARQLQueryResultWriterFactory; 5.10 import org.openrdf.query.resultio.sparqlgeojson.stSPARQLResultsGeoJSONWriterFactory; 5.11 -import org.openrdf.query.resultio.sparqlxml.Format; 5.12 import org.openrdf.query.resultio.sparqlxml.stSPARQLResultsKMLWriterFactory; 5.13 import org.openrdf.query.resultio.sparqlxml.stSPARQLResultsXMLWriterFactory; 5.14 import org.openrdf.query.resultio.text.stSPARQLResultsTSVWriterFactory;
6.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryDir.java Mon Jun 25 20:53:02 2012 +0300 6.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryDir.java Mon Jun 25 20:58:45 2012 +0300 6.3 @@ -6,7 +6,7 @@ 6.4 import java.io.FilenameFilter; 6.5 import java.io.IOException; 6.6 6.7 -import org.openrdf.query.resultio.sparqlxml.Format; 6.8 +import org.openrdf.query.resultio.Format; 6.9 import org.slf4j.Logger; 6.10 import org.slf4j.LoggerFactory; 6.11
7.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryOp.java Mon Jun 25 20:53:02 2012 +0300 7.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/monetdb/QueryOp.java Mon Jun 25 20:58:45 2012 +0300 7.3 @@ -1,6 +1,6 @@ 7.4 package eu.earthobservatory.runtime.monetdb; 7.5 7.6 -import org.openrdf.query.resultio.sparqlxml.Format; 7.7 +import org.openrdf.query.resultio.Format; 7.8 import org.slf4j.Logger; 7.9 import org.slf4j.LoggerFactory; 7.10
8.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryDir.java Mon Jun 25 20:53:02 2012 +0300 8.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryDir.java Mon Jun 25 20:58:45 2012 +0300 8.3 @@ -6,7 +6,7 @@ 8.4 import java.io.FilenameFilter; 8.5 import java.io.IOException; 8.6 8.7 -import org.openrdf.query.resultio.sparqlxml.Format; 8.8 +import org.openrdf.query.resultio.Format; 8.9 import org.slf4j.Logger; 8.10 import org.slf4j.LoggerFactory; 8.11
9.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryOp.java Mon Jun 25 20:53:02 2012 +0300 9.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/postgis/QueryOp.java Mon Jun 25 20:58:45 2012 +0300 9.3 @@ -1,6 +1,6 @@ 9.4 package eu.earthobservatory.runtime.postgis; 9.5 9.6 -import org.openrdf.query.resultio.sparqlxml.Format; 9.7 +import org.openrdf.query.resultio.Format; 9.8 import org.slf4j.Logger; 9.9 import org.slf4j.LoggerFactory; 9.10