rdf4j

How to turn a SPARQL/SPIN query/rule into an RDF structure from Java?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 16:15:09
问题 I have been using TopQuadrant Composer Free Edition (TBC FE) to embed SPARQL/SPIN rules (primarily SPIN constructors) in my OWL ontologies stored as RDF. Part of this process is that the SPARQL source code is tokenized/encoded in an RDF structure according to http://spinrdf.org/sp.html which the schema specified in http://spinrdf.org/sp. It is this structure that actually gets interpreted by RDF4J to run the SPIN rules. I'm also using RDF4J as my triple store, reasoner, SPARQL endpoint, and

How to turn a SPARQL/SPIN query/rule into an RDF structure from Java?

不想你离开。 提交于 2019-12-04 20:57:14
I have been using TopQuadrant Composer Free Edition (TBC FE) to embed SPARQL/SPIN rules (primarily SPIN constructors) in my OWL ontologies stored as RDF. Part of this process is that the SPARQL source code is tokenized/encoded in an RDF structure according to http://spinrdf.org/sp.html which the schema specified in http://spinrdf.org/sp . It is this structure that actually gets interpreted by RDF4J to run the SPIN rules. I'm also using RDF4J as my triple store, reasoner, SPARQL endpoint, and SPIN rule engine. In addition, I'm generating custom Java code and GUIs to manipulate my data and rules

How to load a gzipped rdf file to rdf4j Repository?

a 夏天 提交于 2019-12-02 02:59:51
I want to load a gzipped rdf file into a org.eclipse.rdf4j.repository.Repository . During the upload, status messages must be logged to the console. The size of my rdf file is ~1GB of uncompressed or ~50MB of compressed data. Actually an RDF4J repository will automatically process a compressed (zip/gzip) file correctly, already. So you can simply do this: RepositoryConnection conn = ... ; // your store connection conn.add(new File("file.zip"), null, RDFFormat.NTRIPLES): If you want to include reporting, a different (somewhat simpler) approach is to use an org.eclipse.rdf4j.repository.util

How to convert RDF to pretty nested JSON using java rdf4j

六月ゝ 毕业季﹏ 提交于 2019-11-26 12:31:37
问题 I have a simple RDF file and want to convert it to nice nested JSON. :b0 a <http://schema.org/Book> ; <http://schema.org/name> \"Semantic Web Primer (First Edition)\" ; <http://schema.org/offers> _:b1 ; <http://schema.org/publisher> \"Linked Data Tools\" . _:b1 a <http://schema.org/Offer> ; <http://schema.org/price> \"2.95\" ; <http://schema.org/priceCurrency> \"USD\" . should become { \"type\" : \"Book\", \"name\" : \"Semantic Web Primer (First Edition)\", \"offers\" : { \"type\" : \"Offer\"