概括
提前感谢您帮助我编写了可以在 TopBraid Composer 免费版中声明为 SPIN 规则并使用的 CONSTRUCT/WHERE 语句。
我正在尝试在声明中嵌入 SPARQL CONSTRUCT/WHERE 语句spin:rule
,然后执行它。我对下面的陈述 1 或 2 返回零推论。我正在使用 Java 7、Eclipse 4.3 和 TopBraid Composer 免费版。我已经成功地将语句 3 作为类表单中的 SPIN 构造函数声明运行(语句 3)。我已经在我交叉发布到用户论坛的 SPARQL 查询编辑器(解释器)中成功运行了语句 4。
细节
事实 1:我无法将语句 1 作为 SPIN 规则运行。
----声明1---
CONSTRUCT {
?this owl:hasKey ?x .
}
WHERE {
BIND (spif:generateUUID() AS ?x) .
}
事实 2:我无法将语句 2 作为 SPIN 规则运行。
----声明2----
CONSTRUCT {
?this owl:hasKey ?x .
}
WHERE {
?this rdfs:subClassOf node:entity .
BIND (spif:generateUUID() AS ?x) .
}
--No Error Message--
事实 3:但是,我在类表单的构造函数字段中成功使用了语句 3。
----声明3----
CONSTRUCT {
?this owl:hasKey ?x .
}
WHERE {
BIND (spif:generateUUID() AS ?x) .
}
Success: When a new instance is created a new triple indicating a key is created.
事实 4:我在 SPARQL 查询编辑器中成功使用了 Statement 4,这是类似的。
----声明4----
CONSTRUCT {
?s owl:hasKey ?x .
}
WHERE {
?s rdf:type node:word_use
BIND (spif:generateUUID() AS ?x) .
}
Success: When statement is run all current instances get keys.
事实 5:我没有在 Ontology Profile 表单中检查任何 SPARQL 规则库。
事实 6:我已经导入了以下两个库。
<http://spinrdf.org/spin> from local file TopBraid/SPIN/spin.ttl.
<http://spinrdf.org/sp> from local file TopBraid/SPIN/sp.ttl
事实 7:文件中的命名空间是:
Base URI (Location) - http://example.org/
Default Namespace - http://example.org/
But the Base URI keeps getting reset to:
http://www.semanticweb.org/owl/owlapi/turtle
ace_lexicon - http://attempto.ifi.uzh.ch/ace_lexicon#
arc - http://example.org/arc#
arg - http://spinrdf.org/arg#
concept - http://example.org/concept#
node - http://www.example.org/node#
owl - http://www.w3.org/2002/07/owl#
rdf - http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs - http://www.w3.org/2001/01/rdf-schema#
skos - http://www.w3.org/2004/02/skos/core#
sp - http://spinrdf.org/sp#
spif - http://spinrdf.org/spif#
spin - http://spinrdf.org/spin#
spl - http://spinrdf.org/spl#
word_sense - http://example.org/word_sense#
word_term - http://example.org/word_term#
word_use - http://example.org/word_use#
事实 8:我正在使用的类具有以下断言。
Name - node:unclassified_concept
SubClassOf - node:entity
事实 9:node:unclassified_concept 类的一个实例如下所述。
URI - http://example.org/concept#regardless_of1
rdfs:comment - without attention to
rdfs:isDefinedBy - <http://en.wiktionary.org/wiki/regardless_of>
rdfs:label - regardless of
事实 10:我已经成功地使用了 Jena 通用规则推理以及 OWL_MEM_RULE_INF OntModelSpec、读/写、基本模型、inf 模型和 ont 模型。
语境
我的问题的背景如下。我正在使用 Java 和 Jena 构建和迭代执行本体和规则集,以证明 OWL/RDF 的概念表示、考虑和响应非平凡的打字英语。我使用的句子很重要(41 个单词,三个从句等)。当前本体在不针对任何 OWL/RDF 规则(传递性等)运行时有 1422 个断言。我尽可能使用 TopBraid Composer 来补充 Jena 编程,以确保我符合约定和标准。