Questions tagged [rdf4j]

Eclipse RDF4J is a Java framework for working with RDF, SPARQL, and OWL. It offers a set of libraries and APIs for parsing, writing, scalable storage and reasoning, as well as a Workbench and Server application for deployment of RDF databases. This tag should be used for all questions regarding use of the RDF4J libraries and tools.

Eclipse RDF4J is a Java framework for parsing, writing, storing, querying and reasoning with RDF, SPARQL, and OWL. It offers a set of libraries and APIs for parsing, writing, scalable storage and reasoning, as well as a Workbench and Server application for deployment of RDF databases.

Eclipse RDF4J is the successor of the OpenRDF Sesame project.

For more information see the RDF4J community website.

155 questions
2
votes
2 answers

How to maintain order while retrieving the data in sparql

Is there a way to ensure the order during the retrieval in sparql? Say I want to store List(order important) as an object {:subj :pred 'o1'. :subj :pred 'o2'. :subj :pred 'o3'} How can I insert the above data such that when I perform…
harish chava
  • 252
  • 2
  • 19
2
votes
1 answer

How can I find out the type of sparql query using the code?

String qb = "PREFIX dc: \n" + "INSERT DATA\n" + "{ \n" + " dc:title \"A new book\" ;\n" + " dc:creator…
2
votes
1 answer

Merge RDF .ttl files into one file database - filtering and keeping only the data/triples needed

I need to merge 1000+ .ttl files into one file database. How can I merge them with filtering the data in the source files and keep only the data needed in the target file? Thanks
Aram
  • 123
  • 1
  • 8
2
votes
1 answer

Convert tuples to json using rdf4j

The problem is the following: When parsing a sparql query, I get simplified ast and I need to pass it to a third-party library for further processing, but the functionality out of the box (rdf4j) does not allow transferring ast in a machine-readable…
2
votes
1 answer

Does RDF4J offer a way to pretty print results in tabular format?

I am trying to pretty print the results I get from a SPARQL query in RDF4J. Is there a method or class, inside RDF4J that offers this functionality? I am not asking for other 3rd party software or additional source code (there is already a question…
pgmank
  • 5,303
  • 5
  • 36
  • 52
2
votes
1 answer

Lucene full-text search only works for labels that match search string exactly

I have a bit of a trouble to make full-text search work with Apache Lucene. I can retrieve names when I type in the whole label, e.g. "cat", but typing "c" yields nothing. I am using RDF4J. This is the SPARQL query that I use: SELECT DISTINCT ?e2…
Yuehai
  • 1,165
  • 1
  • 10
  • 20
2
votes
1 answer

RDF4J 2.4.0-M3 GeoSPARQL query not working

Hi I am using the latest version RDF4J 2.4.0-M3 and I am trying to execute the following query: PREFIX geof: PREFIX geo: PREFIX lgd:…
2
votes
1 answer

A simple SPIN rule doesn't work in RDF4J

I've just started using the triple store RDF4J (I am using its workbench, version 2.3.1, run on Windows 10 with Tomcat 9.0) I want to use the SPIN rules in RDF4J. Therefore, I created a new repository (In memory with RDFS+SPIN support). I wanted to…
W.Huang
  • 21
  • 2
2
votes
1 answer

How can I use the RDF4J console to programmatically create a repository?

As explained here, it is easy to clear an existing repository and load new datasets. However, due to the dialogue nature of the create command, I fail to see how I can set up a repo just using a script. Moreover, the REST API documentation seems to…
matentzn
  • 337
  • 1
  • 10
2
votes
1 answer

RDF4J method for splitting literal into value and datatype

If I have connection cxn to an empty triplestore and I say: val CheckSparql = "select (count(?s) as ?scount) where { ?s ?p ?o . }" val PreparedSparql = cxn.prepareTupleQuery(QueryLanguage.SPARQL, CheckSparql) val Result =…
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
2
votes
1 answer

Are typed literals "tricky" in RDF4J?

In RDF, I can have an entity that is bound by a single property to multiple literal values. Those values can also be typed to add clarity. :dumpTruck :weight "heavy"^^xsd:string . :dumpTruck :weight "36000"^^xsd:integer . In SPARQL, I can query…
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
2
votes
1 answer

Scala RDF4J application won't terminate

I have been writing a fair amount of Scala + RDF4J over the past several months. So far so good. I just wrote this today, and the application won't terminate. It prints out the requested three triples and the word "done" but doesn't return to a…
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
2
votes
1 answer

Can't infer an interesting pizza

I have loaded the pizza ontology into Stardog and Blazegraph, along with some triples I authored, including a pizza with four toppings. I have tried to make the toppings distinct, as @AKSW suggested. The pizza ontology defines an interesting pizza…
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
2
votes
3 answers

How can I dump embedded Blazegraph contents to an RDF file?

I have created a blazegraph RDF4J repository and connection in Scala: val props = new Properties() props.put(Options.BUFFER_MODE, BufferMode.DiskRW) props.put(Options.FILE, "embedded.jnl") var sail = new BigdataSail(props) var repo = new…
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
2
votes
1 answer

RDF4J workbench failing SPARQL federated query

I have Tomcat running on my machine with RDF4J server and RDF4J workbench deployed. I am trying to run a federated query to join two Native Java Stores (NativeStore1 and NativeStore2) and link data from them. Right now, I am trying to get anything…
1
2
3
10 11