【问题标题】:How do owl and rdfs property domain range work?owl 和 rdfs 属性域范围如何工作?
【发布时间】:2017-06-06 18:25:20
【问题描述】:

我试图理解 rdfs 域和范围的语义。因为我来自面向对象的背景,所以我很难理解语义以及如何根据 rdfs 语句验证数据。

这是一个海龟格式的示例文件:

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix tmpl: <http://template.example.com/>
prefix data: <http://data.example.com/>

    tmpl:Thing a owl:Class.
    tmpl:Employment rdfs:subClassOf tmpl:TemporalThing.
    tmpl:Party rdfs:subClassOf tmpl:Thing.
    tmpl:Individual rdfs:subClassOf tmpl:Party.
    tmpl:Organisation rdfs:subClassOf tmpl:Party.
    tmpl:LimitedLiabilityCompany rdfs:subClassOf tmpl:Organisation.
    tmpl:hasCurrentEmployer a owl:ObjectProperty;
        rdfs:domain tmpl:Party;
        rdfs:range tmpl:Party.
    data:Simon a tmpl:Individual;
        skos:prefLabel "Simon S".
    data:PtyLtd a tmpl:LimitedLiabilityCompany.
    data:Simon tmpl:hasCurrentEmployer data:PtyLtd.

    tmpl:Animal a owl:Thing.
    data:Beans a tmpl:Animal.
    data:Simon tmpl:hasCurrentEmployer data:Beans.

我使用 GRAPHDB 作为我的测试环境。我希望最后一条语句会失败并显示某种消息,因为“Beans”是“动物”,不是“派对”。

然而,GRAPHDB 只接受该语句。

有什么想法吗?

编辑

基于以下 Stanislav 的评论:虽然推理引擎可能对此没有问题,但我们可以在应用程序中使用域和范围进行错误检查。

【问题讨论】:

  • Animal 不是Party 的声明在哪里?记住:Open World。如果您通过推理器运行当前知识库,它将推断出BeansParty。另外:你在数据库上配置了inference吗?
  • OWL 类只有在有原因(即直接或推断的公理)使它们如此时才不相交。鉴于您目前的知识库,没有这样的理由(还)。
  • 如果您希望单独的层次结构不相交,您必须(至少)声明根不相交。
  • @user2302244 在 OWL 中,不推断并不意味着否定成立!理解这一点很重要!
  • 顺便说一句,在某种意义上你是对的……在 RDFS 级别上,应用程序的行为是相当不确定的。见4. Using the Domain and Range vocabulary。请稍微编辑您的问题,我会投票赞成:)。

标签: owl ontology rdfs graphdb


【解决方案1】:

正如 cmets 中所说,您误解了域和范围的语义。

P rdfs:domain D
P rdfs:range R

意味着如果声明 s P o 成立,那么(在运行推理器的情况下),可以推断出 s rdf:type Do rdf:type R

域和范围从不限制属性。这必须清楚。

要了解事情的运作方式,请查看示例OWL direct semantics for object properties here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-17
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2017-05-31
    • 2016-09-02
    • 2012-04-16
    • 1970-01-01
    相关资源
    最近更新 更多