简体   繁体   中英

What is the main difference between instances and sub-classes?

This question is about Ontologies , I am implementing an ontology about potential physical attacks on wireless sensors as devices.

I created class Modification_Attack meaning attacks which modify in the sensor itself. I created Programming_Modification as an instance of this class, is this logical, is it better a sub-class or neither an instance nor a sub-class?

What is the main difference between instances and sub-classes?

This question isn't really unique to OWL ontologies; it comes up in object-oriented programming, and in set theory in mathematics. A class is a collection of its members. Eg,

Person ≡ { person 1 , person 2 , … }

Suppose you have another class:

TallPerson ≡ { person 63 , person 102 , … }

A class A is a subclass of the class B if every element of A is also an element of B:

(A ⊆ B) ≡ (x ∈ A → x ∈ B)

So, for instance, if every member of TallPerson is also a member of Person , then TallPerson is a subclass of Person .

I created class Modification_Attack meaning attacks which modify in the sensor itself.I created Programming_Modification as an instance of this class , is this logical , is it better a sub-class or neither an instance nor a sub-class?

This is a choice that you need to make. It really depends on the context and how you intend to use the ontology. If you're observing attacks in the wild and trying to categorize them, you probably want a subclass, but you'll want to have instances of Programming_Modification . That is, you'll want something like:

Programming_Modification ≡ { attack 24 , attack 89 , … }

But if you've got some other kind of use case, where you you want to talk about Programming_Modification as a single entity, then it might make more sense for it to be an individual.

I have been thinking through the same issue. And I think the same thing can be both an instance and a subclass depending on whether you plan to use it conceptually or not, which can be simplified to whether you would describe it using the or a .

For example, I am working on a materials ontology, where the main class is Material . A particular type of material is Steel . If I say the steel then steel an instance of Material . If I say a steel then Steel is a subclass of Material . Further, steel is an instance of Steel . And it would be more appropriate to also give it some kind of meaningful identifier like steel-1 .

It all seems to come down whether you are using a term as a conceptual class or as a name for some instance of that class. In your case, I think it would probably be more appropriate to say Programming_Modification is a subclass as you could probably have many of such modifications which you would refer to as the first Programming_Modification or the second Programming_Modification . Would love to see what you came up with though if you have a solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM