如何区分 Jena RDFS-INF 模型中的公理和推断语句?
How can I distinguish an axiom from an inferred statement in a Jena RDFS-INF model?
当我在 Jena 中创建一个 RDFS_MEM_RDFS_INF 模型并阅读一些 RDFS 文件时,添加了许多未在文件中明确说明的语句。例如。如果我们有一个三元组
a p b
并且 p 是 rdfs:subPropertyOf q,比
a q b 是
也在模型中。具体例子如下:if
a skos:related b
在文件中
a skos:semanticRelation b
也在模型中。
是否有可能检查模型中的陈述是公理还是推论? OWL 模型有这样的方法,但我使用的是 RDFS 模型。一个简单的解决方案是构建两个模型,一个没有推理,一个有推理,但我更喜欢内存消耗较少的解决方案。
保留:
Jena InfModel has a method getRawModel(). This Model wont contain the
inferred statements, it will contain only the axioms in the file. use
a check against that. If you are using the OntModel it has got a
method getBaseModel().
和表明这是一个解决方案:
Thanks. This works fine! I didn't find that method when I was reading
the documentation last week.
(如果 djthequest 发布了一个,我会删除这个答案。)
Jena InfModel
有一个方法 getRawModel()
。 Model
不包含推断语句,它只包含文件中的公理。对此进行检查。如果您使用 OntModel
它有一个方法 getBaseModel()
.
当我在 Jena 中创建一个 RDFS_MEM_RDFS_INF 模型并阅读一些 RDFS 文件时,添加了许多未在文件中明确说明的语句。例如。如果我们有一个三元组
a p b
并且 p 是 rdfs:subPropertyOf q,比
a q b 是
也在模型中。具体例子如下:if
a skos:related b
在文件中
a skos:semanticRelation b
也在模型中。
是否有可能检查模型中的陈述是公理还是推论? OWL 模型有这样的方法,但我使用的是 RDFS 模型。一个简单的解决方案是构建两个模型,一个没有推理,一个有推理,但我更喜欢内存消耗较少的解决方案。
保留
Jena InfModel has a method getRawModel(). This Model wont contain the inferred statements, it will contain only the axioms in the file. use a check against that. If you are using the OntModel it has got a method getBaseModel().
和
Thanks. This works fine! I didn't find that method when I was reading the documentation last week.
(如果 djthequest 发布了一个,我会删除这个答案。)
Jena InfModel
有一个方法 getRawModel()
。 Model
不包含推断语句,它只包含文件中的公理。对此进行检查。如果您使用 OntModel
它有一个方法 getBaseModel()
.