- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这里是 fuseki/jena 的新手。我设法让 fuseki 使用 tdb1 与 OWLFBRuleReasoner 一起运行没问题,但不能让它与 tdb2 ( http://jena.apache.org/2016/tdb# ) 一起工作。我找不到同时使用 TDB2 和 OWLFBRuleReasoner 的配置的明确示例,所以我只是转换了这个(有效)
@prefix : <http://base/#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
# fuseki configuration to have OWL entailment
# this is the configuration on s-stf-gin (fuseki data folder is on c:\)
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB gsip" ;
fuseki:dataset :tdb_dataset_readwrite ;
fuseki:name "gsip" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore
"data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .
# above, remove data, update and upload in prod
:tdb_dataset_readwrite
a ja:RDFDataset;
rdfs:label "GSIP";
ja:defaultGraph <#model_inf> ;
tdb:location "c:\\fuseki/databases/gsip" .
<#model_inf> a ja:InfModel ;
ja:baseModel <#graph> ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
] .
<#graph> rdf:type tdb:GraphTDB ;
tdb:dataset :tdb_dataset_readwrite .
(这个工作正常。我用 owl:inverseOf 属性测试过)
进入这个(那行不通)
@prefix : <http://base/#> .
@prefix tdb2: <http://jena.apache.org/2016/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
:service_tdb_all a fuseki:Service ;
fuseki:dataset :dataset ;
fuseki:name "gsip" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .
:dataset a ja:RDFDataset ;
ja:defaultGraph <#model_inf> ;
tdb2:location "c:\\fuseki/databases/gsip"
.
<#model_inf> a ja:InfModel ;
ja:baseModel <#graph> ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
] .
<#graph> rdf:type tdb2:GraphTDB ; # also tried tdb2:GraphTDB2
tdb2:dataset :dataset .
如您所见,我基本上只是将 tdb 替换为 tdb2(命名空间和所有)。 Fuseki 启动并运行良好,但 OWL 推理不起作用。
任何人都可以指出相关文档/示例吗?或者我可能完全误解了 TDB1 与 TDB2 的交易。
谢谢
编辑:修复了我的 TDB2 配置文件(仍然不起作用)。
最佳答案
以下对我有用:
@prefix : <http://base/#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
:service_tdb_all a fuseki:Service ;
rdfs:label "TDB [MyDatasetName]" ;
fuseki:dataset :inferred_dataset ;
fuseki:name "[MyDatasetName]" ;
fuseki:serviceQuery "query" , "sparql" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore
"data" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" .
:inferred_dataset a ja:RDFDataset ;
ja:defaultGraph :inference_model .
:inference_model a ja:InfModel ;
ja:baseModel :tdb_graph ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
] .
:tdb_graph a tdb:GraphTDB ;
tdb:dataset :tdb_dataset_readwrite .
:tdb_dataset_readwrite
a tdb:DatasetTDB ;
tdb:location "[MyDatasetLocationOnDisk]" .
与您的版本的主要区别是没有推理的单独数据集(而不是已经注意到的循环“Barry NL”)和 tdb 前缀的不同命名空间。请注意,命名空间前缀可以自由选择(它们没有语义),更改命名空间前缀并不重要,只要它指向相同的命名空间 URL。
关于rdf - 使用 TDB2 和 OWL Reasoner 配置 fuseki,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48770691/
我正在尝试使用 TDB 使用 Jena 在 Java 中进行查询。所以基本上我得到了一个 n3 文件名 song.n3 并且使用这个文件我想将它与 TDB 一起使用。所以我创建了一个在我的 Java1
我必须为 DBpedia 中的一组 1500 个实体序列化一些特定属性(大约十部电影的属性)。因此,对于每个实体,我运行 sparql 查询以检索它们,之后,对于每个 ResultSet,我使用默认的
使用:jena-fuseki-1.1.0,apache-jena-2.12.0 我想要达到的目标和我目前的状态: 我正在尝试使用 dbpedia Persondata(英语和德语)、跨语言链接、图像和
我正在尝试在 java 中查询 jena TDB。我的代码如下。我的 TDB 数据集似乎是空的,因为 model.size()(其中 model 是数据集默认模型)返回 0。我确定它不为空,不过,因为
我正在提供一个数据集,其中包含来自 Fuseki 2 中 TDB 数据集的 10-20 个命名图。 我想使用推理器对我的数据进行推断。我希望看到的行为是每个图中推断的三元组应该出现在这些图中(尽管如果
这是我的配置文件 # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 ## Fuseki Server c
有没有办法通过 Java API 使用 OWL API 访问 Jena TDB? Jena 似乎不支持 OWL-API。除了 RDF API 之外,它还具有一些便利函数 (OntAPI),用于在被视为
我有一个问题。 我正在尝试在 Jena TDB 上加载我的 RDF 文件。 我写了这段代码: public void store(){ String directory = "C:\\tdb"
我目前正在改编一个在内存模型中与 JENA 一起使用的程序,但当我尝试使用 TDB 存储不同的命名模型时会中断。我认为由此产生的行为是 JENA 中的一个错误,但也许我对同一 TDB 中命名模型的假设
我对 Apache Jena TDB 有疑问。基本上我创建了一个新的数据集,将数据从 RDF/XML 文件加载到名为“http://example.com/model/filename”的命名模型中,
我有一个问题要问你: 我想在我的 Jena TDB TripleStore 上加载一个文件。我的文件很大,大约80Mb,大约700000个三倍RDF。当我尝试加载它时,执行停止工作或需要很长时间。 我
我正在使用 Jena API 在 Jena TDB 中插入和更新三元组。我的设计是这样的,每个插入操作都在事务控制之内。例如: dataset.begin (ReadWrite.WRITE) try
我有一个相当小的图,其中包含大约 50 万个三元组。我还生成了 stats.opt 文件并在相当快的计算机(四核、16gb ram、ssd 驱动器)上运行我的代码。但是对于我在 OP 界面的帮助下构建
public void createDatabase(){ // Make a TDB-backed dataset String directory = "MyDatabase
我正在使用 Jena TDB (1.1.1) 来存储一组命名图。一切正常,但每当我从数据集中检索命名图时,所有 namespace 前缀信息都会丢失。有没有办法保留原始 RDF 图中的 namespa
是否可以运行 Jena TDB database从 Python 应用程序存储大量 RDF 数据?什么是 Python 的原生替代品? 最佳答案 另一种方法是使用 SPARQL 端点,例如 Apach
我想重写我当前的代码以使用交易。但是,根据 Jena 文档 (http://incubator.apache.org/jena/documentation/tdb/tdb_transactions.h
根据 Apache website TDB“可以用作单台机器上的高性能 RDF 存储”。阅读文档我看不到它存储任何内容的位置。是否只是将每个资源存储在定义目录中其自己的文件中,如 this 中所述教程
我有一个 RDF 文件,其中包含 7MB 和约 80k 语句。 启动应用程序时,我有以下代码,用于检索我需要向用户显示的项目列表: NodeIterator iterator =
我正在开发一个使用 Jena 进行存储(带有 TDB 后端)的应用程序。我正在寻找类似 Squirrel 的东西,它可以让我看到正在存储的内容,运行查询等。这似乎是一个明显需要的东西,但我的(可能措辞
我是一名优秀的程序员,十分优秀!