owl和rdfs属性域范围如何工作? [英] How do owl and rdfs property domain range work?

查看:109
本文介绍了owl和rdfs属性域范围如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to understand the semantics of rdfs domain and range. Because I am from an object oriented background, I am struggling to understand the semantics and how to validate data against the rdfs statements.

这是乌龟格式的示例文件:

Here is a sample file in turtle format:

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"是动物",而不是是聚会".

I am using GRAPHDB as my test environment. I would expect the last statement to fail with some sort of message because 'Beans' is an 'Animal' which is not a 'Party'.

但是,GRAPHDB仅接受该语句.

Yet, GRAPHDB just accepts the statement.

有什么想法吗?

编辑

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

Based on Stanislav's comment below: While An inference engine might not have a problem with this, we can use the domain and range for error checking in an application.

推荐答案

如评论中所述,您误解了域和范围的语义.

As said in the comments, you misunderstood the semantics of domain and range.

P rdfs:domain D
P rdfs:range R

表示,如果语句s P o成立,则(在运行推理程序的情况下)可以推断出s rdf:type Do rdf:type R.

mean that if a statement s P o holds, then (with a reasoner running), it could be inferred that s rdf:type D and o rdf:type R.

域和范围从来都不是对该属性的限制.这必须很清楚.

Domain and range are never restrictions on the the property. That has to be clear.

要了解事物的工作原理,请检查examplem 对象的OWL直接语义属性.

To understand how things work, check for examplem OWL direct semantics for object properties here.

这篇关于owl和rdfs属性域范围如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆