类上的对象属性实例? [英] Object property instance on class?

查看:94
本文介绍了类上的对象属性实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

举个例子:

-Food(class
 -Bread(instance of Food!
-Species(class
  -Animal(class
    - Horse(class
      -Unicorn(instance

现在我需要能够设置面包-> eatableBy->马.但是我无法对类进行对象属性声明.因此,我可以将它设置为可食用,并添加Horse的所有实例,但是我有很多实例,因此有点多余.有谁知道一种有效的方法来达到相同的效果?

例如如果我想知道什么马可以吃,还需要还面包.如果我想知道独角兽可以吃的所有食物,就需要归还面包(因为这是一匹马,所有的马都吃面包).如果我想知道Animal的子类吃什么,它还必须返回Bread.

解决方案

如果我对您的理解正确,则您有一个实例 面包,并希望确保可食用 class 的每个实例. OWL具有值限制,可让您描述与某些特定值有某种关系的一组个人.例如表达式

       喜欢披萨

是所有喜欢披萨的个人的一类. OWL还允许您使用属性的逆函数,以便表达式

        (赞) Joe

是Joe喜欢的所有事物的类.这些类表达式可用于公理,包括​​子类公理.特别是,您可以这样说

       马 SubClassOf canEat value Bread

类型的每个人都可以吃面包.但是,您有一个eatableBy属性,而不是canEat属性.不过,这只是canEat的反面,因此您可以说,每个 Horse 类型的人都可以用公理来吃单个的 Bread :

      马 SubClassOf inverse (可食用)面包 >

在Protégé中,它看起来像:

Let's say for example:

-Food(class
 -Bread(instance of Food!
-Species(class
  -Animal(class
    - Horse(class
      -Unicorn(instance

Now I need to be able to set Bread -> eatableBy -> Horse. But I can't make a object property assertion to a class. So I could set it eatable by and add all the instances of Horse, but I have a lot of instances so that would be a bit redundant. Does anybody know a good efficient way to do achieve the same effect?

E.g. If I need to know what Horses can eat it needs to return Bread also. If I want to know all the food an Unicorn can eat, it needs to return Bread (because it's a horse and all horses eat bread). If I need to know what the subclasses of Animal eat, it also has to return Bread.

解决方案

If I understand you correctly, you have an instance Bread and want to ensure that it is eatable by every instance of the class Horse. OWL has value restrictions which let you describe the set of individuals that stand in some relation to some particular value. E.g., the expression

        likes value Pizza

is the class of all individuals that like pizza. OWL also lets you use the inverse of properties, so that the expression

        inverse(likes) value Joe

is the class of all things that Joe likes. These class expressions can be used in axioms, including subclass axioms. In particular, you could say that

        Horse SubClassOf canEat value Bread

to say that every individual of type Horse can eat the individual Bread. Rather than a canEat property, though, you've got an eatableBy property. That's just the inverse of canEat, though, so you can say that every individual of type Horse can eat the individual Bread with the axiom:

        Horse SubClassOf inverse(eatableBy) value Bread

In Protégé, that looks like:

这篇关于类上的对象属性实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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