rdf模式中域和范围的区别?
您能举例说明 rdfs:domain 和 rdfs:range 之间的区别吗?我什么时候应该使用域和范围?我读过 h w3c rdf prime 但我不明白其中的区别
could you please explain me the difference between rdfs:domain and rdfs:range with an example? and when should i use domain and when range? i have read h w3c rdf primer but i did not understand the difference
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从简单的角度来看,域和范围属性可以让您深入了解属性将主题链接到对象的方式。
对于域属性,当您使用具有此关联属性的属性将主题链接到对象时,主题就有资格作为在域中指定的事物类型。领域。例如,我们查看一个词汇表,发现我们的属性的域是一个项目。
因此,简单地说,只要使用“名称”属性描述的主题是一种项目(或者可能是一种项目),那么您继续使用该术语来描述该事物应该没有问题,因为大多数其他人会认为,如果使用这个术语描述某事物,那么它就是一个项目。您会发现不仅人类,而且机器(在本例中为推理机)也会做出相同的推论。
范围的工作方式与域完全相同,但对于这个范围,它适用于语句的宾语,而不是主语。请注意;有时您可能会遇到域或范围适用于多个事物的情况。在这种情况下,这意味着主语或客体(域或范围)是指定的所有类型(交集而不是并集)。
From a simplistic point of view, the domain and range properties are there to give you insight into the way that the property links a subject to an object.
In the case of the domain property, when you link a subject to an object using a property with this associated attribute, then the subject qualifies as a type of thing specified in the domain. For example, we look at a vocabulary and we see that the domain of our property is a Project.
So, simply put, as long as the subject being described using the “name” attribute is a type of project (or could be a type of project), then you should have no problem going ahead using that term to describe that thing, because most other people will interpret that if something is described using this term, then it is a project. You'll find it is not only humans but also machines (or reasoners in this case) that make the same inferences.
The range works exactly like the domain, but with this one, it applies to the object of the statement and not the subject. A word of caution; you might at times come across instances where the domain or range applies to more than one thing. In this case, it means that the subject or object (domain or range) is all of the types specified (the intersection not the union).
我发现从一个例子开始更容易:假设我们有一个属性
happened_at
,其 DOMAIN 和 RANGE 定义如下:Event
Olympic Games
happened_at
Place
Location
happened_at
的资源都是活动
或奥运会
Place
)例如,在以这种方式定义的本体中,当我找到属性
happened_at
从其范围 I知道它的值只能是Place
或Location
并且从它的域,我知道具有此属性的资源将是活动
或奥运会
。在 RDF 中,属性 P 的范围和域类 C 形式化如下:
您可以在 W3C 建议中阅读完整的定义 此处。
I find it easier starting with an example: let's say that we have a property
happened_at
with DOMAIN and RANGE defined as follow:Event
Olympic Games
happened_at
Place
Location
happened_at
is an instance ofEvent
orOlympic Games
Place
)So for instance in an ontology defined in this way when I found the property
happened_at
from its range I know that its value could be onlyPlace
orLocation
and from its domain, I know that the resource that has this property will be an instance ofEvent
orOlympic Games
.In RDF the property P will have range and domain class C formalized as follow:
You can read the full definition in the W3C recommendation here.