- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了这个本体,其中包含两个类:血糖和服务。 Blood-Sugar 有两个数据属性:hasValu(范围为 xsd:int)和 hasStatut(范围为 xsd:string)。对象属性triggerService以Blood-Sugar为域,以Service为范围。
我想用这个规则推断数据属性断言:
Blood_Sugar(?x) ∧ hasValue(?x, ?y) ∧ swrlb:greaterThan(?y, 126) ∧ swrlb:lessThan(?y, 500) → hasStatut(?x, "High")
然后我想用这个规则推断一个新的对象属性:
Blood_Sugar(?x) ∧ hasStatut(?x, "High") ∧ Service(?s) → triggerService(?x, ?s)
但是,当我创建应应用规则的个体时,推理器并没有给出我想要的结果。这是演示此行为的本体:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY swrl "http://www.w3.org/2003/11/swrl#" >
<!ENTITY swrlb "http://www.w3.org/2003/11/swrlb#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY protege "http://protege.stanford.edu/plugins/owl/protege#" >
<!ENTITY xsp "http://www.owl-ontologies.com/2005/08/07/xsp.owl#" >
<!ENTITY swrla "http://swrl.stanford.edu/ontologies/3.3/swrla.owl#" >
<!ENTITY sqwrl "http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl#" >
]>
<rdf:RDF xmlns="http://www.owl-ontologies.com/Ontology1391620136.owl#"
xml:base="http://www.owl-ontologies.com/Ontology1391620136.owl"
xmlns:swrla="http://swrl.stanford.edu/ontologies/3.3/swrla.owl#"
xmlns:sqwrl="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#"
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#">
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl"/>
<owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/3.3/swrla.owl"/>
</owl:Ontology>
<swrl:Variable rdf:ID="s"/>
<swrl:Variable rdf:ID="x"/>
<swrl:Variable rdf:ID="y"/>
<owl:Class rdf:ID="Blood_Sugar"/>
<swrl:Imp rdf:ID="Rule-2">
<swrl:body>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;ClassAtom"/>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:classPredicate rdf:resource="#Blood_Sugar"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;DatavaluedPropertyAtom"/>
<swrl:argument2 rdf:datatype="&xsd;string">High</swrl:argument2>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:propertyPredicate rdf:resource="#hasStatut"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;ClassAtom"/>
<swrl:argument1>
<rdf:Description rdf:about="#s"/>
</swrl:argument1>
<swrl:classPredicate rdf:resource="#Service"/>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</swrl:AtomList>
</rdf:rest>
</swrl:AtomList>
</rdf:rest>
</swrl:AtomList>
</swrl:body>
<swrl:head>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;IndividualPropertyAtom"/>
<swrl:argument2>
<rdf:Description rdf:about="#s"/>
</swrl:argument2>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:propertyPredicate rdf:resource="#triggerService"/>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</swrl:AtomList>
</swrl:head>
</swrl:Imp>
<swrl:Imp rdf:ID="Rule-1">
<swrl:body>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;ClassAtom"/>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:classPredicate rdf:resource="#Blood_Sugar"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;DatavaluedPropertyAtom"/>
<swrl:argument2>
<rdf:Description rdf:about="#y"/>
</swrl:argument2>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:propertyPredicate rdf:resource="#hasValue"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;BuiltinAtom"/>
<swrl:arguments>
<rdf:List>
<rdf:first>
<rdf:Description rdf:about="#y"/>
</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first rdf:datatype="&xsd;long">126</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</rdf:List>
</rdf:rest>
</rdf:List>
</swrl:arguments>
<swrl:builtin>
<rdf:Description rdf:about="&swrlb;greaterThan"/>
</swrl:builtin>
</rdf:Description>
</rdf:first>
<rdf:rest>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;BuiltinAtom"/>
<swrl:arguments>
<rdf:List>
<rdf:first>
<rdf:Description rdf:about="#y"/>
</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first rdf:datatype="&xsd;long">500</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</rdf:List>
</rdf:rest>
</rdf:List>
</swrl:arguments>
<swrl:builtin>
<rdf:Description rdf:about="&swrlb;lessThan"/>
</swrl:builtin>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</swrl:AtomList>
</rdf:rest>
</swrl:AtomList>
</rdf:rest>
</swrl:AtomList>
</rdf:rest>
</swrl:AtomList>
</swrl:body>
<swrl:head>
<swrl:AtomList>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="&swrl;DatavaluedPropertyAtom"/>
<swrl:argument2 rdf:datatype="&xsd;string">High</swrl:argument2>
<swrl:argument1>
<rdf:Description rdf:about="#x"/>
</swrl:argument1>
<swrl:propertyPredicate rdf:resource="#hasStatut"/>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</swrl:AtomList>
</swrl:head>
</swrl:Imp>
<Blood_Sugar rdf:ID="Blood_Sugar_1">
<hasValue rdf:datatype="&xsd;int">150</hasValue>
</Blood_Sugar>
<owl:DatatypeProperty rdf:ID="hasStatut">
<rdfs:domain rdf:resource="#Blood_Sugar"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="hasValue">
<rdfs:domain rdf:resource="#Blood_Sugar"/>
<rdfs:range rdf:resource="&xsd;int"/>
</owl:DatatypeProperty>
<owl:Class rdf:ID="Service"/>
<Service rdf:ID="Service_1"/>
<owl:ObjectProperty rdf:ID="triggerService">
<rdfs:domain rdf:resource="#Blood_Sugar"/>
<rdfs:range rdf:resource="#Service"/>
</owl:ObjectProperty>
</rdf:RDF>
最佳答案
But the reasonner does not give me the result that i want when I creat instances !!!
这里提供更多详细信息会有所帮助。您如何知道推理器(顺便问一下,您使用的是哪个推理器?)没有推断出所需的属性?你启用推理机了吗?您是否运行查询来检查推论是否存在?您是否在 Protégé 中设置了配置来显示所有适当的推论?
无论如何,感谢您提供本体来重现您的结果。我能够将其加载到 Protégé 中,运行 Pellet 推理机,我可以得到以下推论:
Blood_Sugar_1 triggerService Service_1
Blood_Sugar_1 hasStatut "High"^^string
Blood_Sugar_1 hasStatut "150"^^int
虽然 Pellet 能够计算所有这些推论,但 Protégé 默认情况下仅显示对象属性的推论;您必须进入 Reasoner > 配置... 菜单,并确保在“显示的单独推理”部分下选中“数据属性断言”选项。 my answer 中更详细地描述了打开 Pellet Reasoner 并设置此选项。至Ontology property definition in Protégé-OWL / SWRL .
关于rdf - SWRL 规则不会推断新的对象和数据属性断言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21540839/
来自 RDF Schema 1.1 2.4 rdfs:Datatype rdfs:Datatype is the class of datatypes. All instances of rdfs:D
我遇到了books ontology ,在 owl 的底部文档,我们有: A reservation has been made by a person for a boo
在 RDF/XML 文件中具有属性的订单是否重要?换句话说,以下两个相同吗? 1 2 2 1 最佳答案 是的,RDF 在数学上被定义为一组三元组,因此这些三元组在您使用
我刚开始学习 RDF,我的问题是: 空白节点的目的是什么? 例子: ex:John foaf:knows _:p1 _:p1 foaf:birthDate 04-21 这
让我们看看这个例子:http://dbpedia.org/page/Berlin “owl:sameAs”和“is owl:sameAs of”有什么区别 最佳答案 owl:sameAs 是一个对称属
许多数据集都有变化的历史。将历史数据作为关联数据提供可能是一个挑战。我正在考虑的一般情况是,数据集包含有关具有可以随时间变化的属性的事物的数据。一个例子可能是温莎城堡的历史:它过去有很多配置,但它仍然
我正在使用 MarkLogic 8.0-6.3 使用 sem:rdf-load 从 RDF 文件生成三元组时很少有三元组没有被创建。 我已经粘贴了 RDF 文件内容、生成的三元组和我用来加载文件的查询
在这里完成 RDF 新手,我正在努力理解如何创建合理且可重用的谓词。我问了我们公司的几位专家,但他们的谓词(被迫)通过复制对象是唯一的(例如 woman,has_a_bag,purse 与 woman
谁能给我一个 RDF 中具体化的简单例子?我想看看我是否理解正确。 例如,我提出以下案例 Tolkien -> wrote -> Lord of the rings /|\
我想对如下所示的合作伙伴关系进行建模,我以标记属性图的格式表示。 我想使用RDF语言来表达上面的图,特别是我想了解是否可以表达“loves”边的标签(这是一篇文章/信件的URI)。 我是RDF新手,我
我在构建 Project Gutenberg 目录的 SPARQL 查询时遇到困难(可在页面底部的 Gutenberg Feeds 获取)。我知道我对 SparQL/RDF 等如何工作缺乏了解。实际上
我正在用 RDF 创建一个 Material 集合。我遇到了两种处理度量单位的方法: 通过将描述性名称链接到 RDF 属性: prop:density prop:hasUnits "kg/m
RDF:Property 是否可以包含其他属性以及 rdf:range 和 rdf:domain。例如,您是否可以拥有以下内容: This is a member of
我对 RDF 和 RDF Schema (RDFS) 有点困惑。我读过一些文档,其中提到 rdfs 是为 RDF 定义词汇表。 根据这个定义,我可以说 RDFS 是像 OWL 或 Dublin Cor
rdf:resource、rdf:about 和 rdf:ID 之间在概念上有什么区别。我做了一些调查,但我还不清楚它们之间的区别。例如,第一次声明资源时是否使用rdf:ID,rdf:resource
这是rdf代码: 42 我需要得到号码 "42" .我试过这个: PREFIX soton: PREFIX skos: ?location skos:notation rdf:
关于语义网的初学者问题。 我有一个颜色知识库,其中包括相似的颜色、颜色修饰符(暗、亮、~ish 等)、颜色关系(更深、更亮)、颜色同义词等。我想弄清楚 RDF/OWL 是否是一个操作(主要是查询)这个
有什么办法可以加快 rdf 文件加载到 Sesame 中的速度吗?我有 N-triple 格式的文件,大小从几 MB 到几 GB。我已经尝试了 Sesame Cook Book 中的前三种方法,但无济
例如,这句话: "I give John a book." 使其成为一组三元组: I give John. John hasIndirect book. book count 1. 或者,它可以是:
在 RDF 图的 Turtle 序列化中,我有很多这样的三元组(很多个体,都有一个共同的类型值): :A a :b . :B a :b . :C a :b . :D a :b . # … :Z a :
我是一名优秀的程序员,十分优秀!