How can I use class assertions to classify prime numbers?

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

How can I use class assertions to classify prime numbers?

Daniel B.
Hi there!

I was wondering if there was a way to classify prime numbers using class
expressions and datatypes. Same with composite (non-prime) numbers

Thank you!

Daniel



-----
Daniel B.
--
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
Daniel B.
Reply | Threaded
Open this post in threaded view
|

Re: How can I use class assertions to classify prime numbers?

Lorenz Buehmann
classify by what? So, you have individuals for numbers and you add which
relations to them? Note, the URI itself is opaque, it does not contain
any semantic meaning.

So if you have properties that denote a prime number and you attach
those properties to an individual that represents a prime number, sure.
Otherwise, a reasoner won't do any math computation.

On 05.05.20 07:37, Daniel B. wrote:

> Hi there!
>
> I was wondering if there was a way to classify prime numbers using class
> expressions and datatypes. Same with composite (non-prime) numbers
>
> Thank you!
>
> Daniel
>
>
>
> -----
> Daniel B.
> --
> 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: How can I use class assertions to classify prime numbers?

Daniel B.
I do. I have the following classes:

Number>Real>Rational>Integer>Non-Negative Integer>Positive Integer>Prime
Number

The thing is I don't know how to formulate the class expression in the
Equivalent To class expression editor in order to classify any given entity
that meets the expression that I'm looking for and, therefore, is classified
as a Prime Number.

The question is: What is that class expression that would allow that the
given entity was classified as a Prime Number, given a set of properties?

Thanks!

Daniel



-----
Daniel B.
--
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
Daniel B.
Reply | Threaded
Open this post in threaded view
|

Re: How can I use class assertions to classify prime numbers?

Lorenz Buehmann
well, that's what I was asking you ... which properties/attributes make
your number a prime number. Not sure if you understand, but the data has
to be asserted explicitly, there is **no** math calculation going on in
OWL reasoning and you can't express something like "natural number
greater than 1 that cannot be formed by multiplying two smaller natural
numbers". What you could do - and then you still have to assert the data
to each number - is to add to each number the numbers that can be used
in their product and if it's more than 1 it wouldn't be prime. Or just
the number of prime factors.

By the way, a fun project: http://km.aifb.kit.edu/projects/numbers/web/n1


On 05.05.20 09:59, Daniel B. wrote:

> I do. I have the following classes:
>
> Number>Real>Rational>Integer>Non-Negative Integer>Positive Integer>Prime
> Number
>
> The thing is I don't know how to formulate the class expression in the
> Equivalent To class expression editor in order to classify any given entity
> that meets the expression that I'm looking for and, therefore, is classified
> as a Prime Number.
>
> The question is: What is that class expression that would allow that the
> given entity was classified as a Prime Number, given a set of properties?
>
> Thanks!
>
> Daniel
>
>
>
> -----
> Daniel B.
> --
> 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: How can I use class assertions to classify prime numbers?

Igor Toujilov-2
Hi Daniel,
The short answer is: You cannot do this in pure OWL class expressions because they don’t support arithmetic. However, you can do this for limited numbers when you add an SWRL rule to your ontology.

SWRL is used as a complement to OWL to allow more expressivity.

To achieve this you need:
1. Numbers from 2 to square root of n to be pre-generated as individual property values in your ontology. Here n is the limit: your rule (see below) can only detect prime numbers from 2 to n.
2. Add a simple SWRL rule to your ontology to classify an individual with a property value from 2 to n as a composite number if the value can be represented as a product of two pre-generated numbers.

Cheers,
Igor

> Sent: Tuesday, May 05, 2020 at 9:48 AM
> From: "Lorenz Buehmann" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] How can I use class assertions to classify prime numbers?
>
> well, that's what I was asking you ... which properties/attributes make
> your number a prime number. Not sure if you understand, but the data has
> to be asserted explicitly, there is **no** math calculation going on in
> OWL reasoning and you can't express something like "natural number
> greater than 1 that cannot be formed by multiplying two smaller natural
> numbers". What you could do - and then you still have to assert the data
> to each number - is to add to each number the numbers that can be used
> in their product and if it's more than 1 it wouldn't be prime. Or just
> the number of prime factors.
>
> By the way, a fun project: http://km.aifb.kit.edu/projects/numbers/web/n1
>
>
> On 05.05.20 09:59, Daniel B. wrote:
> > I do. I have the following classes:
> >
> > Number>Real>Rational>Integer>Non-Negative Integer>Positive Integer>Prime
> > Number
> >
> > The thing is I don't know how to formulate the class expression in the
> > Equivalent To class expression editor in order to classify any given entity
> > that meets the expression that I'm looking for and, therefore, is classified
> > as a Prime Number.
> >
> > The question is: What is that class expression that would allow that the
> > given entity was classified as a Prime Number, given a set of properties?
> >
> > Thanks!
> >
> > Daniel
> >
> >
> >
> > -----
> > Daniel B.
> > --
> > 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: How can I use class assertions to classify prime numbers?

Daniel B.
Thank you both so much! I will look into all the things you shared!

Take care!

Daniel



-----
Daniel B.
--
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
Daniel B.