jena

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

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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

How to create an ontology in Java?

只愿长相守 提交于 2019-12-03 09:30:31
问题 I've some data triplets that I want to write in some sort of basic OWL ontology. I've triplets like: Delhi is part of India or India is an Asian country Note that I've relations like "is-a", "part-of", or "related-to". What's the simplest way to build an ontology? Any working example or a reference to an example website will be great help! 回答1: There are a lot of different things mixed up in your question, I strongly suggest you take a bit of time (away from the keyboard!) to think through

How to use Jena TDB to store local version of Linked Movie Database

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a local version of LinkedMDB that is in N-Triples format and want to query it. Now, I want to use Jena TDB, which can store the data that can be used for querying later. I checked the documentation for TDB Java API , but was unable to load the N-Triples file and then query with SPARQL. I've used the following code: String directory = "E:\\Applications\\tdb-0.8.9\\TDB-0.8.9\\bin\\tdb" ; Dataset dataset = TDBFactory . createDataset ( directory ); // assume we want the default model, or we could get a named model here Model tdb

Jena TDB to store and query using API

巧了我就是萌 提交于 2019-12-03 09:06:15
I am new to both Jena-TDB and SPARQL, so it might be a silly question. I am using tdb-0.9.0, on Windows XP. I am creating the TDB model for my trail_1.rdf file. My understanding here(correct me if I am wrong) is that the following code will read the given rdf file in TDB model and also stores/load (not sure what's the better word) the model in the given directory D:\Project\Store_DB\data1\tdb : // open TDB dataset String directory = "D:\\Project\\Store_DB\\data1\\tdb"; Dataset dataset = TDBFactory.createDataset(directory); Model tdb = dataset.getDefaultModel(); // read the input file String

Can I configure Jena Fuseki with inference and TDB?

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb : < http : //jena.hpl.hp.com/2008/tdb#> . @prefix rdf : < http : //www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs : < http : //www.w3.org/2000/01/rdf-schema#> . @prefix ja : < http : //jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb : < http : //jena.hpl.hp.com/2008/tdb#> . [] ja :

Querying DBpedia with SPARQL and Jena

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 05:17:36
问题 I cannot understand how can I query DBpedia using Jena. In the tutorials like here(Listing 4) model is initialized as follows: // Open the bloggers RDF graph from the filesystem InputStream in = new FileInputStream(new File("bloggers.rdf")); // Create an empty in-memory model and populate it from the graph Model model = ModelFactory.createMemModelMaker().createModel(); model.read(in,null); // null base URI, since model URIs are absolute in.close(); Let's say I want to write a query that will

Toggle Jena Reasoner

此生再无相见时 提交于 2019-12-03 03:50:53
I have a Jena ontology model ( OntModel ) which I'm modifying programatically. This model was initially created using the default ModelFactory method to create an Ontology model (with no parameters) . The problem was, as the program ran and the model was changed, the default Jena Reasoner would run (and run and run and run). The process was entirely too slow for what I need and would run out of memory on large data sets. I changed the program to use a different ontology model factory method to create a model with no reasoner. This ran extremely fast and exhibited none of the memory problems I

Jena/ARQ: Difference between Model, Graph and DataSet

心不动则不痛 提交于 2019-12-03 02:44:33
问题 I'm starting to work with the Jena Engine and I think I got a grasp of what semantics are. However I'm having a hard time understanding the different ways to represent a bunch of triples in Jena and ARQ: The first thing you stumble upon when starting is Model and the documentation says its Jenas name for RDF graphs. However there is also Graph which seemed to be the necessary tool when I want to query a union of models, however it does not seem to share a common interface with Model ,

Jena Fuseki Sparql No query= error

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 endpoint. In Fuseki the queries endpoint (for example,

SPARQL parse error with Jena, but DBpedia accepts the query

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Jena to launch a SPARQL query. I have this code, which produces an error. I don't understand the reason for this error, since putting the query into the DBpedia SPARQL endpoint works! I think that I wrote the query string correctly. What's the error? Code String sparqlQueryString= "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "+ "select ?sub ?super (count(?mid) as ?length) where {"+ "values ?sub { <http://dbpedia.org/ontology/Writer> }" + "?sub rdfs:subClassOf* ?mid ."+ "?mid rdfs:subClassOf+ ?super .}"+ "group by (?sub