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