I designed an ontology model for a Smart House. A sensor attached to each object. In my ontology, I have a class Sensor
. Each object in this class has an Id-number. For example, Cabinet
is an individual of Sensor
. I have several Cabinet
with different Id-number in the Kitchen such as Cabinet hasID# 42
, Cabinet hasID# 52
. I am using protege, I define hasID
as a data property and locatedIn
as an object property. I want to know is it possible to have:
Cabinet locatedIn Kitchen
Cabinet hasID 42
Cabinet hasID 52
or should I change the hasID
to an object property and define a class IdNumber
?
You are approaching this the wrong way, I think. You do not have one Cabinet with several IDs, you have several different cabinets. In other words, you have two individuals, each of type Cabinet
. One has id 42, the other has id 52.
In (pseudo) RDF triples:
:cabinet42 a :Cabinet ;
:locatedIn :kitchen ;
:hasID 42 .
:cabinet52 a :Cabinet ;
:locatedIn :kitchen ;
:hasID 52 .
So in Protege, you need to create two separate individuals, one for each cabinet, and then give each individual its own ID property.
As an aside, as you can see in the above RDF, it may not even be necessary to give them :hasID
properties at all: they each already have their own unique identifier (namely their URIs: :cabinet42
and :cabinet52
).