3

私はOWLにかなり慣れていないので、まだ制限を学んでいます。私はこれらのステートメントをモデル化しようとしています:

  1. 人 (P) は男性 (M) または女性 (F) になることができますが、両方ではありません
  2. 人は男性または女性でなければなりません
  3. 男は服を着ない
  4. 女性は少なくとも 1 つのドレスを持っている (D)

これまでのところ、次のようにモデル化しました。

P -> canBe -> M  
P -> canBe -> F  
M <- disjoint -> F  
F -> has (>= 1) -> D

男性または女性でなければならないという制限を追加する方法と、男性がドレスを着ていないことを示す方法について、私は混乱しています. また、一般的なモデリングについても確信が持てず、フィードバックをいただければ幸いです。

4

1 に答える 1

2

In general, there can be different ways of achieving the same goal. That means that the following answers aren't necessarily the only possibility, but they're the first ones that come to my mind.

1. A person (P) can be male (M) or female (F), but not both.
2. A person must be male or female.

For these two statements, there's an important modeling decision to make. Are Male and Female each subclasses of a Person class, or are you using some property, e.g., hasSex that relates person to a sex? If you're using the subclass approach, then you can do this by declaring that

Person is the disjoint union of Male and Female.

This means that every instance of Person is an instance of Male or an instance of Female, and that the classes Male and Female are disjoint, so nothing is an instance of both. (Of course, if you can talk about non-person things that male and female, then you wouldn't want to use this approach exactly.)

If you're using a property like hasSex, then it's either an object property or a data property. In the first case, you'd need a class Sex with two individuals male and female, and you'd declare that they are different from each other, and you could make hasSex a functional property, and declare its range to be the class Sex. Some of this depends on how general your classes and properties are, of course. If you don't declare a range for the property, then you'd still want to use some sort of restriction class as a superclass of Person. E.g.,

Person ⊑ =1 hasSex.{male,female}
Person ⊑ ∀hasSex.{male,female}

These axioms say that each person has exactly one value from {male, female} as a value for the *hasSex*property, and that every value a person has for hasSex must be from {male, female}.

3. A male has no dresses
4. A female has at least one dress (D)

If you're using a general has property that can apply to more than just dresses (as opposed to, for instance, a hasDress property that applies only to dresses), and you have a class for Dress, these are simply:

Male ⊑ =0 has.Dress
Female ⊑ ≥1 has.Dress

于 2014-03-02T19:51:18.750 に答える