apache-jena

Error while querying DBPedia using Apache Jena

余生颓废 提交于 2019-12-08 09:06:43
问题 import java.sql.ResultSet; import java.sql.SQLException; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSetFormatter; public class sparq { public static void main (String[] args) throws SQLException { String queryString= "PREFIX dbpedia: <http://dbpedia.org/resource/>"+ "PREFIX category: <http://dbpedia.org/resource

Jena Fuseki Sparql No query= error

ⅰ亾dé卋堺 提交于 2019-12-02 17:32:24
问题 I am trying to inset data in a jena fuseki graph using this simple query: PREFIX test: <http://test.org> INSERT {?subject test:hasName "Bob"} WHERE{ ?subject test:hasEmail "email@test.com" . } However, i get the error: Error 400: SPARQL Query: No 'query=' parameter Fuseki - version 2.3.1 (Build date: 2015-12-08T09:24:07+0000) What does this error mean, and how can i resolve it? this error also appear when i try to delete data. Thanks. 回答1: Make sure you are pointing at the appropriate

Jena TDB java.lang.ExceptionInInitializerError

守給你的承諾、 提交于 2019-11-28 11:32:28
I'm using Jena TDB for loading an RDF dataset and making SPARQL queries against it. I'm using the following maven dependency: <dependency> <groupId>org.apache.jena</groupId> <artifactId>apache-jena-libs</artifactId> <type>pom</type> <version>3.0.1</version> </dependency> And here's the java code where I'm trying to create a TDB dataset: public void loadDirectory(String outputFile){ Dataset dataset = TDBFactory.createDataset(directoryPath); Model tdb = dataset.getDefaultModel(); FileManager.get().readModel(tdb, outputFile); tdb.close(); dataset.close(); LOG.info("RDF dataset loaded to memory");

Jena TDB java.lang.ExceptionInInitializerError

橙三吉。 提交于 2019-11-27 06:16:02
问题 I'm using Jena TDB for loading an RDF dataset and making SPARQL queries against it. I'm using the following maven dependency: <dependency> <groupId>org.apache.jena</groupId> <artifactId>apache-jena-libs</artifactId> <type>pom</type> <version>3.0.1</version> </dependency> And here's the java code where I'm trying to create a TDB dataset: public void loadDirectory(String outputFile){ Dataset dataset = TDBFactory.createDataset(directoryPath); Model tdb = dataset.getDefaultModel(); FileManager