tdb

Extract schema from rdf/xml

核能气质少年 提交于 2019-12-13 04:55:36
问题 I am making use of a tool called as FRED (http://wit.istc.cnr.it/stlab-tools/fred) , which generates the RDF/XML for the given natural language text. But that tool is making use its own predefined schema and also the namespaces. There is no way for the user to give their own schema for the tool. Whatever the RDF/XML data, which I have got from that tool is fed to Triple Data Store using Apache JENA library. Is it possible to extract the Schema like class properties, objects and Data

Creating a Lucene index for an existing Apache Jena TDB to implement text search

此生再无相见时 提交于 2019-12-12 05:30:47
问题 I have a large Apache Jena TDB, I want to build a Lucene index using Apache Jena 2.10.2 for use with the new text search feature. I find the documentation hard to follow. I first tried to use configuration in code, but had trouble with the dependencies. Any combination of lecene-core and solr-solrj would either result in certain 'classNotFound' errors or a 'StandardAnalyzer overrides final method tokenStream' error. Example of Code: Dataset ds1 = DatasetFactory.createMem() ; EntityDefinition

tdbloader2 fails with classpath error

邮差的信 提交于 2019-12-11 14:56:34
问题 When I run the following command: bin/tdbloader2 --loc=/store/data/here /seed/data/serverfault-dump.nt And the response I get is: 10:52:31 -- TDB Bulk Loader Start 10:52:31 Data phase Error: Could not find or load main class com.hp.hpl.jena.tdb.store.bulkloader2.CmdNodeTableBuilder Which is most likely caused by a problem with my environment variables, somewhere, of something. The problem is, I don't often work with Java and so I don't know enough to know how to figure out what that class

Jena TDB , see how many triple stored during tdb creation

 ̄綄美尐妖づ 提交于 2019-12-11 14:25:19
问题 Hi is possible to see the number of triple in storing during tdb creation with java api? I run the TDB factory with a rar file in turtle , but during the creation of files in my directory i cant see how many triple it has stored. How can i solve this problem? 回答1: You can access the bulk-loader through java code (to view triples introduced) as follows: final Dataset tdbDataset = TDBFactory.createDataset( /*location*/ ); try( final InputStream in = /*get input stream for your large file*/) {

Jena TDB after reason then update

让人想犯罪 __ 提交于 2019-12-11 13:44:18
问题 I am using Jena and I want to update the new ontology into my tdb. For example. I have 100 rows in my ontology , after I add some rules and run the reasoner, there are 105 rows now. And I need to update these 5 additional rows in my tdb. How can I get this done ? I try to google it and I found two ways. One is using sparql to update , another is truncating the tdb and add the new model into it. Is there any other better solution? Thanks you -- code void after_reasoner(Model m) { String yago =

SPARQL query works in Fuseki but not in Jena TDB

本秂侑毒 提交于 2019-12-11 03:21:42
问题 I have my data organised in multiple graphs. The graph in which a triple is saved matters. The data structure is complicated but it can be simplified like this: My store contains cakes, where there's a hierarchy of different cake types, all subclasses of <cake> <http://example.com/a1> a <http://example.com/applecake> <http://example.com/a2> a <http://example.com/rainbowcake> ... Depending on how they get created by a user in a UI, they end up in a different graph. If for instance the user

Error when I load RDF triples in TDB Triple Store

杀马特。学长 韩版系。学妹 提交于 2019-12-08 14:48:49
问题 I have a question for you: I have loaded my file RDF in TDB Triple Store: Dataset dataset = TDBFactory.createDataset(directory); Model model = dataset.getNamedModel("http://nameFile"); TDBLoader.loadModel(model, file ); Now, I would like to realize a procedure which checks whether the graph is on the Triple Store or not. I have written this code: String queryStr = "select * {graph <http://nameFile> { ?s ?p ?o }}"; Dataset dataset = TDBFactory.createDataset(directory); Query query =

Fuseki config for 2 datasets + text index : how to use turtle files?

…衆ロ難τιáo~ 提交于 2019-12-08 06:09:20
问题 I'm new to fuseki and want to use 2 TDB datasets for our project : a small one for our own data, and a large one (168 M triples, imported data from http://data.bnf.fr). We need to index the data because SPARQL queries using "FILTER(CONTAINS())" don't work on the large dataset ("BnF_text"). Therefore, I've built a text index for "BnF_text", following this post : Fuseki indexed (Lucene) text search returns no results (but I had to modify the turtle config file to get the text:query working). It

Query Jena TDB store

两盒软妹~` 提交于 2019-12-08 03:36:41
问题 I'm trying to query jena TDB in java. My code follows. It seems that my TDB dataset is empty because model.size() (where model is the dataset default model) return 0. I'm sure it isn't empty, though, because I can query it with Fuseki with my sparqlEndpoint. String directory = "//var//www//fuseki//TDB" ; Dataset dataset = TDBFactory.createDataset(directory) ; Model model = dataset.getDefaultModel(); String sparqlQueryString = "SELECT (count(*) AS ?count) { ?s ?p ?o }" ; Query query =

Query Jena TDB store

限于喜欢 提交于 2019-12-06 22:54:36
I'm trying to query jena TDB in java. My code follows. It seems that my TDB dataset is empty because model.size() (where model is the dataset default model) return 0. I'm sure it isn't empty, though, because I can query it with Fuseki with my sparqlEndpoint. String directory = "//var//www//fuseki//TDB" ; Dataset dataset = TDBFactory.createDataset(directory) ; Model model = dataset.getDefaultModel(); String sparqlQueryString = "SELECT (count(*) AS ?count) { ?s ?p ?o }" ; Query query = QueryFactory.create(sparqlQueryString) ; QueryExecution qexec = QueryExecutionFactory.create(query, model);