use of org.apache.jena.fuseki.geosparql.cli.ArgsConfig in project jena by apache.
the class TDB2Test method setUpClass.
@BeforeClass
public static void setUpClass() throws DatasetException, SpatialIndexException {
File tempTDBDir = Files.createTempDir();
String[] args = { "-rf", "geosparql_test.rdf>xml", "-i", "-t", tempTDBDir.getAbsolutePath(), "-t2" };
ArgsConfig argsConfig = new ArgsConfig();
JCommander.newBuilder().addObject(argsConfig).build().parse(args);
// Setup dataset
Dataset dataset = DatasetOperations.setup(argsConfig);
// Configure server
SERVER = new GeosparqlServer(argsConfig.getPort(), argsConfig.getDatsetName(), argsConfig.isLoopbackOnly(), dataset, argsConfig.isUpdateAllowed());
SERVER.start();
}
use of org.apache.jena.fuseki.geosparql.cli.ArgsConfig in project jena by apache.
the class MainTest method setUpClass.
@BeforeClass
public static void setUpClass() throws DatasetException, SpatialIndexException {
String[] args = { "-rf", "geosparql_test.rdf>xml", "-i" };
ArgsConfig argsConfig = new ArgsConfig();
JCommander.newBuilder().addObject(argsConfig).build().parse(args);
// Setup dataset
Dataset dataset = DatasetOperations.setup(argsConfig);
// Configure server
SERVER = new GeosparqlServer(argsConfig.getPort(), argsConfig.getDatsetName(), argsConfig.isLoopbackOnly(), dataset, argsConfig.isUpdateAllowed());
SERVER.start();
}
use of org.apache.jena.fuseki.geosparql.cli.ArgsConfig in project jena by apache.
the class TDBTest method setUpClass.
@BeforeClass
public static void setUpClass() throws DatasetException, SpatialIndexException {
File tempTDBDir = Files.createTempDir();
String[] args = { "-rf", "geosparql_test.rdf>xml", "-i", "-t", tempTDBDir.getAbsolutePath() };
ArgsConfig argsConfig = new ArgsConfig();
JCommander.newBuilder().addObject(argsConfig).build().parse(args);
// Setup dataset
Dataset dataset = DatasetOperations.setup(argsConfig);
// Configure server
SERVER = new GeosparqlServer(argsConfig.getPort(), argsConfig.getDatsetName(), argsConfig.isLoopbackOnly(), dataset, argsConfig.isUpdateAllowed());
SERVER.start();
}
use of org.apache.jena.fuseki.geosparql.cli.ArgsConfig in project jena by apache.
the class Main method main.
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Apache SIS j.u.l logging redirection.
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
LOGGER.info("Arguments Received: {}", Arrays.asList(args));
ArgsConfig argsConfig = new ArgsConfig();
JCommander jCommander = JCommander.newBuilder().addObject(argsConfig).build();
jCommander.setProgramName("GeoSPARQL Fuseki");
jCommander.parse(args);
if (argsConfig.isHelp()) {
jCommander.usage();
return;
}
// Setup dataset
try {
Dataset dataset = DatasetOperations.setup(argsConfig);
// Configure server
GeosparqlServer server = new GeosparqlServer(argsConfig.getPort(), argsConfig.getDatsetName(), argsConfig.isLoopbackOnly(), dataset, argsConfig.isUpdateAllowed());
server.start();
} catch (SrsException | DatasetException | SpatialIndexException ex) {
LOGGER.error("GeoSPARQL Server: Exiting - {}: {}", ex.getMessage(), argsConfig.getDatsetName());
}
}
use of org.apache.jena.fuseki.geosparql.cli.ArgsConfig in project jena by apache.
the class EmptyTest method setUpClass.
@BeforeClass
public static void setUpClass() throws DatasetException, SpatialIndexException {
String[] args = { "-u" };
ArgsConfig argsConfig = new ArgsConfig();
JCommander.newBuilder().addObject(argsConfig).build().parse(args);
// Setup dataset
Dataset dataset = DatasetOperations.setup(argsConfig);
// Configure server
SERVER = new GeosparqlServer(argsConfig.getPort(), argsConfig.getDatsetName(), argsConfig.isLoopbackOnly(), dataset, argsConfig.isUpdateAllowed());
SERVER.start();
// Add data
String update = "PREFIX geo: <http://www.opengis.net/ont/geosparql#>\n" + "\n" + "INSERT DATA{" + "<http://example.org/Geometry#LineStringA> geo:hasSerialization \"LINESTRING(0 0, 10 10)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>;" + " a geo:Geometry ;" + " a geo:SpatialObject ." + "<http://example.org/Geometry#LineStringB> geo:hasSerialization \"LINESTRING(0 5, 10 5)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>;" + " a geo:Geometry ;" + " a geo:SpatialObject ." + "<http://example.org/Geometry#PointC> geo:hasSerialization \"POINT(5 5)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>;" + " a geo:Geometry ;" + " a geo:SpatialObject ." + "}";
UpdateRequest updateRequest = UpdateFactory.create(update);
UpdateExecution updateProcessor = UpdateExecution.service(SERVER.getLocalServiceURL()).update(updateRequest).build();
updateProcessor.execute();
}
Aggregations