Enter a Numeric Range in Data Property for an Individual

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Enter a Numeric Range in Data Property for an Individual

DorisHung
Hi everyone,

I am new to Protege and ontology design. I've watched many tutorials on
Youtube and read several manuals and user guides. Maybe I'm not
understanding it well, but I'm wondering if there is a way to enter a range
of numeric value for an individual as a data property? For example, if I
want to specify the working temperature of an individual called /Case1/ as
between 300F and 500F using the data property defined as
/HasTemperatureRange/, is there a way such that the result looks like the
following?:

Case1 HasTemperatureRange xsd:decimal[>= 300,<= 500]

Thank you,
Doris



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

Michael DeBellis-2
Yes, that is easy to do. When you define the Range for your data property you will get a window with 2 tabs. One of them (probably the default and the one you use the most) just has a list of predefined datatypes. But the other one (called "Data Range Expression") allows you to enter arbitrary DL statements just as you would to define axioms for a defined class. You can enter expressions such as " xsd:decimal[>= 300,<= 500] " in that field.

Michael

On Thu, Jun 20, 2019 at 1:57 PM DorisHung <[hidden email]> wrote:
Hi everyone,

I am new to Protege and ontology design. I've watched many tutorials on
Youtube and read several manuals and user guides. Maybe I'm not
understanding it well, but I'm wondering if there is a way to enter a range
of numeric value for an individual as a data property? For example, if I
want to specify the working temperature of an individual called /Case1/ as
between 300F and 500F using the data property defined as
/HasTemperatureRange/, is there a way such that the result looks like the
following?:

Case1 HasTemperatureRange xsd:decimal[>= 300,<= 500]

Thank you,
Doris



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

Matthew Horridge-2
Administrator
In reply to this post by DorisHung
Hi Doris,

To do this, make Case1 an instance of your class expression HasTemperatureRange some xsd:decimal[>= 300,<= 500] 

You can do this in Protege by adding a Type to the individual.  Select the individual to do this then use the “Types” section in the Description view to add the class expression HasTemperatureRange some xsd:decimal[>= 300,<= 500] 

Cheers,

Matthew


On Jun 20, 2019, at 13:57, DorisHung <[hidden email]> wrote:

Hi everyone,

I am new to Protege and ontology design. I've watched many tutorials on
Youtube and read several manuals and user guides. Maybe I'm not
understanding it well, but I'm wondering if there is a way to enter a range
of numeric value for an individual as a data property? For example, if I
want to specify the working temperature of an individual called /Case1/ as
between 300F and 500F using the data property defined as
/HasTemperatureRange/, is there a way such that the result looks like the
following?:

Case1 HasTemperatureRange xsd:decimal[>= 300,<= 500]

Thank you,
Doris



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

Michael DeBellis-2
Sorry, I missed the bit about wanting to make it specific to a certain individual, what I said was just if you want to define the range for the property in general. Matthew's answer was of course the right one.

Michael

On Thu, Jun 20, 2019 at 2:14 PM Matthew Horridge <[hidden email]> wrote:
Hi Doris,

To do this, make Case1 an instance of your class expression HasTemperatureRange some xsd:decimal[>= 300,<= 500] 

You can do this in Protege by adding a Type to the individual.  Select the individual to do this then use the “Types” section in the Description view to add the class expression HasTemperatureRange some xsd:decimal[>= 300,<= 500] 

Cheers,

Matthew


On Jun 20, 2019, at 13:57, DorisHung <[hidden email]> wrote:

Hi everyone,

I am new to Protege and ontology design. I've watched many tutorials on
Youtube and read several manuals and user guides. Maybe I'm not
understanding it well, but I'm wondering if there is a way to enter a range
of numeric value for an individual as a data property? For example, if I
want to specify the working temperature of an individual called /Case1/ as
between 300F and 500F using the data property defined as
/HasTemperatureRange/, is there a way such that the result looks like the
following?:

Case1 HasTemperatureRange xsd:decimal[>= 300,<= 500]

Thank you,
Doris



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

DorisHung
Thank you, Matthew and Michael, for your swift replies. Related to the same
question, I want to make a query in SQWRL to find all individuals that work
in the temperature range of 400F and 450F. This is my input:

Case(?c) ^ HasTemperatureRange(?c, ?t) ^ swrlb:greaterThan(?t, 400) ^
swrlb:lessThan(?t, 450) -> sqwrl:select(?c, ?t)

But the result will not return Case1, which I just input to have a working
temperature range from 300F to 500F. Is there something I'm missing?



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

Lorenz Buehmann

I guess you guys are mixing up between a range in OWL facts and a range in the real world domain. It remains unclear what you really want to say.

Saying

Individual :c

Types: HasTemperatureRange some xsd:decimal[>= 300,<= 500] 

does basically mean there is at least some value in between 300 and 500. But this is not a range for sure just because you call the property *Range. It's still a single value. So the property should ideally be called HasTemperatureValue

If you really want to model a range, then you should create dedicated properties for min and max, at least when you want to use those values in rules.

Something like

Individual :c

Facts: HasTemperatureRange :r .

Individual :r

Facts: minValue some 300

           maxValue some 500

Thank you, Matthew and Michael, for your swift replies. Related to the same
question, I want to make a query in SQWRL to find all individuals that work
in the temperature range of 400F and 450F. This is my input:

Case(?c) ^ HasTemperatureRange(?c, ?t) ^ swrlb:greaterThan(?t, 400) ^
swrlb:lessThan(?t, 450) -> sqwrl:select(?c, ?t)

Your ontology just states that :c has some unknown value between 300 and 500 for the property HasTemperatureRange, so it could also be 301, right? Moreover, it's not an explicit value, so what should a query return as binding for ?t  ?

It would only work if you add a data property assertion like HasTemperatureRange(:c, 400.0)

But again, you should first think about the modeling, for me it looks weird right now or I'm missing something


@Michael

Maybe you get what I mean and can give some better advice? You're better in ontology modeling and explaining things for sure

But the result will not return Case1, which I just input to have a working
temperature range from 300F to 500F. Is there something I'm missing?



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

DorisHung
Hi Lorenz,

Thank you for pointing out the confusion. You are right. What I want to
model is the fact that /Individual1/ can work at any temperature from 300 to
500, and I'm hoping that a query searching for any individual that can work
within the temperature range of 400 and 450 is able to select /Individual1/
as an output and returns the fact that /Individual1/ has a working
temperature from 300 to 500.

From what I'm understanding, assigning the properties *minValue* and
*maxValue* seem to be the right way to model, but I'm wondering how this
setting can support the query that I intend to do. For example, if I make a
query

Case(?c)^minValue(?c,400)^maxValue(?c,450) ->sqrwl:select(?c)

It will not return /Individual1/ since its minValue and maxValue are
explicitly assgined as 300 and 500.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Enter a Numeric Range in Data Property for an Individual

Lorenz Buehmann


Hi Lorenz,

Thank you for pointing out the confusion. You are right. What I want to
model is the fact that /Individual1/ can work at any temperature from 300 to
500, and I'm hoping that a query searching for any individual that can work
within the temperature range of 400 and 450 is able to select /Individual1/
as an output and returns the fact that /Individual1/ has a working
temperature from 300 to 500. 

>From what I'm understanding, assigning the properties *minValue* and
*maxValue* seem to be the right way to model, but I'm wondering how this
setting can support the query that I intend to do. For example, if I make a
query 

Case(?c)^minValue(?c,400)^maxValue(?c,450) ->sqrwl:select(?c)

It will not return /Individual1/ since its minValue and maxValue are
explicitly assgined as 300 and 500. 

if you really used my suggestion (which I'm not sure if it's the "best" way), you have to get the range individual first and then its values for min and max, or not? So basically, you just have to follow the path of the data and indeed you have to use the built-in functions for comparison of course. Something like this (untested of course):

Case(?c) ^ hasRange(?c ,?r) ^ minValue(?r, ?min) ^ maxValue(?r, ?max) ^ swrlb:greaterThanOrEqual(400, ?min) ^ swrlb:lessThanOrEqual(450, ?max) -> sqwrl:select(?c)




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user