SWRL issue

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

SWRL issue

Jabardi
Hello all,
Suppose we have five student with five marks for each one as shown bellow
name test1 test2 test3 test4 test5
student1 1 0 0 0 0
student2 1 1 0 0 0
student3 1 1 1 0 0
student4 1 1 1 1 0
student5 1 1 1 1 1
 
How to infer that student who has summation >=3  is pass, using SWRL?

Best regards




--
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: SWRL issue

Igor Toujilov-2
You would need creating a linked list of marks for each student. See [1] on how to create a linked list. So, you will have five linked lists. Then you can calculate the sum for each list. An example is also provided in [1]. And then you can add a simple SWRL rule: if the sum for a student is greater or equal 3, then the student passed.

Cheers,
Igor

[1] https://sourceforge.net/p/meloproject/code/ci/master/tree/OWL/examples/list_sum.owl


> Sent: Thursday, August 22, 2019 at 2:03 PM
> From: "Jabardi" <[hidden email]>
> To: [hidden email]
> Subject: [protege-user] SWRL issue
>
> Hello all,
> Suppose we have five student with five marks for each one as shown bellow
> name test1 test2 test3 test4 test5
> student1 1 0 0 0 0
> student2 1 1 0 0 0
> student3 1 1 1 0 0
> student4 1 1 1 1 0
> student5 1 1 1 1 1
>
> How to infer that student who has summation >=3 is pass, using SWRL?
>
> Best regards
>
>
>
>
> --
> 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: SWRL issue

Jabardi
Hi Igor,
Thanks a lot for your respond.
I am beginner with ontology. I read the example that you sent, but i still
cannot understand it.
Please, can you explain more details. it's normal to create dataproperty
with same name and why?
Suppose if we have 5000 student, this is mean create 5000 linked list !!
please if you have a time can apply it on student example.
please I need more information urgent.

Regards



--
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: Aggregating data properties with SWRL ("SWRL issue")

Igor Toujilov-2

The subject line has been changed to reflect the essentials of the topic.

 

A new method for calculating aggregation data properties can be found in [1]. I did not see something like this used before. However, if you know that somebody used similar method before, please let me know.
It uses an indexer implementation in OWL. And it is much simpler to use than the linked lists. Of course automation tools needed to support this approach (may be Protégé can implement such features). But again, the indexer-based automation tools will be much simpler to implement than list-based ones.
May be Michael will be interested to include it in his tutorial.
I know there is a plug-in for bulk-importing individuals from a spreadsheet to Protégé. I never used this plug-in, but it might be useful for generating individuals in the indexer.

Cheers,
Igor

[1] https://sourceforge.net/p/meloproject/code/ci/master/tree/OWL/examples/indexer.owl
and the dependency import is here: https://sourceforge.net/p/meloproject/code/ci/master/tree/OWL/MELO.owl


> Sent: Saturday, August 24, 2019 at 3:49 PM
> From: "Jabardi" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] SWRL issue
>
> Hi Igor,
> Thanks a lot for your respond.
> I am beginner with ontology. I read the example that you sent, but i still
> cannot understand it.
> Please, can you explain more details. it's normal to create dataproperty
> with same name and why?
> Suppose if we have 5000 student, this is mean create 5000 linked list !!
> please if you have a time can apply it on student example.
> please I need more information urgent.
>
> Regards
>
>
>
> --
> 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: Aggregating data properties with SWRL ("SWRL issue")

Michael DeBellis-2
Igor, thanks for the pointer, sounds interesting, I'll check it out.  

Michael

On Mon, Aug 26, 2019 at 5:11 PM Igor Toujilov <[hidden email]> wrote:

The subject line has been changed to reflect the essentials of the topic.

 

A new method for calculating aggregation data properties can be found in [1]. I did not see something like this used before. However, if you know that somebody used similar method before, please let me know.
It uses an indexer implementation in OWL. And it is much simpler to use than the linked lists. Of course automation tools needed to support this approach (may be Protégé can implement such features). But again, the indexer-based automation tools will be much simpler to implement than list-based ones.
May be Michael will be interested to include it in his tutorial.
I know there is a plug-in for bulk-importing individuals from a spreadsheet to Protégé. I never used this plug-in, but it might be useful for generating individuals in the indexer.

Cheers,
Igor

[1] https://sourceforge.net/p/meloproject/code/ci/master/tree/OWL/examples/indexer.owl
and the dependency import is here: https://sourceforge.net/p/meloproject/code/ci/master/tree/OWL/MELO.owl


> Sent: Saturday, August 24, 2019 at 3:49 PM
> From: "Jabardi" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] SWRL issue
>
> Hi Igor,
> Thanks a lot for your respond.
> I am beginner with ontology. I read the example that you sent, but i still
> cannot understand it.
> Please, can you explain more details. it's normal to create dataproperty
> with same name and why?
> Suppose if we have 5000 student, this is mean create 5000 linked list !!
> please if you have a time can apply it on student example.
> please I need more information urgent.
>
> Regards
>
>
>
> --
> 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: Aggregating data properties with SWRL ("SWRL issue")

Igor Toujilov-2
In reply to this post by Jabardi
In my previous posts I suggested to use linked lists or indexers to calculate sums. Currently this approach is not easy to use if you have massive data because automation tools are not yet available.
So, for this use case, an easier approach is to use Protégé Cellfie Plugin to import individuals, their values, and the sums from an Excel spreadsheet to your ontology. In this case, the sums are calculated in the spreadsheet, and the target ontology might have individuals like the following:

Individual: student1
Facts: has_sum_of_marks 1

Then you write a rule:

has_sum_of_marks(?s, ?m), greaterThanOrEqual(?m, 3) -> passed_exam(?s)

Regards,
Igor


> Sent: Thursday, August 22, 2019 at 2:03 PM
> From: "Jabardi" <[hidden email]>
> To: [hidden email]
> Subject: [protege-user] SWRL issue
>
> Hello all,
> Suppose we have five student with five marks for each one as shown bellow
> name test1 test2 test3 test4 test5
> student1 1 0 0 0 0
> student2 1 1 0 0 0
> student3 1 1 1 0 0
> student4 1 1 1 1 0
> student5 1 1 1 1 1
>  
> How to infer that student who has summation >=3  is pass, using SWRL?
>
> Best regards
>
>
>
>
> --
> 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: Aggregating data properties with SWRL ("SWRL issue")

Igor Toujilov-2
Another approach to this use case does not require calculating sums, and does not use SWRL at all. But it works only if you have binary assessment for tests (passed, not passed), not a numeric mark. In this case, you can use a cardinality restriction axiom, and the reasoner will calculate the sums internally.
For example:

Individual: student1
    Facts:  
     passed  test1,
      not  passed  test2,
      not  passed  test3,
      not  passed  test4,
      not  passed  test5

Then you write an axiom:

passed min 3 test SubClassOf passed_exam

Enjoy!
Igor


> Sent: Saturday, August 31, 2019 at 10:25 PM
> From: "Igor Toujilov" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")
>
> In my previous posts I suggested to use linked lists or indexers to calculate sums. Currently this approach is not easy to use if you have massive data because automation tools are not yet available.
> So, for this use case, an easier approach is to use Protégé Cellfie Plugin to import individuals, their values, and the sums from an Excel spreadsheet to your ontology. In this case, the sums are calculated in the spreadsheet, and the target ontology might have individuals like the following:
>
> Individual: student1
> Facts: has_sum_of_marks 1
>
> Then you write a rule:
>
> has_sum_of_marks(?s, ?m), greaterThanOrEqual(?m, 3) -> passed_exam(?s)
>
> Regards,
> Igor
>
>
> > Sent: Thursday, August 22, 2019 at 2:03 PM
> > From: "Jabardi" <[hidden email]>
> > To: [hidden email]
> > Subject: [protege-user] SWRL issue
> >
> > Hello all,
> > Suppose we have five student with five marks for each one as shown bellow
> > name test1 test2 test3 test4 test5
> > student1 1 0 0 0 0
> > student2 1 1 0 0 0
> > student3 1 1 1 0 0
> > student4 1 1 1 1 0
> > student5 1 1 1 1 1
> >  
> > How to infer that student who has summation >=3  is pass, using SWRL?
> >
> > Best regards
> >
> >
> >
> >
> > --
> > 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: Aggregating data properties with SWRL ("SWRL issue")

Igor Toujilov-2
Actually this shows an interesting generic observation:

If you have a sum calculation task on integer data properties (especially with very small data values), and it is possible to convert these data properties to object properties, then you can delegate the sum calculation to the reasoner.

Igor


> Sent: Saturday, August 31, 2019 at 11:12 PM
> From: "Igor Toujilov" <[hidden email]>
> To: [hidden email]
> Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")
>
> Another approach to this use case does not require calculating sums, and does not use SWRL at all. But it works only if you have binary assessment for tests (passed, not passed), not a numeric mark. In this case, you can use a cardinality restriction axiom, and the reasoner will calculate the sums internally.
> For example:
>
> Individual: student1
>     Facts:  
>      passed  test1,
>       not  passed  test2,
>       not  passed  test3,
>       not  passed  test4,
>       not  passed  test5
>
> Then you write an axiom:
>
> passed min 3 test SubClassOf passed_exam
>
> Enjoy!
> Igor
>
>
> > Sent: Saturday, August 31, 2019 at 10:25 PM
> > From: "Igor Toujilov" <[hidden email]>
> > To: [hidden email]
> > Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")
> >
> > In my previous posts I suggested to use linked lists or indexers to calculate sums. Currently this approach is not easy to use if you have massive data because automation tools are not yet available.
> > So, for this use case, an easier approach is to use Protégé Cellfie Plugin to import individuals, their values, and the sums from an Excel spreadsheet to your ontology. In this case, the sums are calculated in the spreadsheet, and the target ontology might have individuals like the following:
> >
> > Individual: student1
> > Facts: has_sum_of_marks 1
> >
> > Then you write a rule:
> >
> > has_sum_of_marks(?s, ?m), greaterThanOrEqual(?m, 3) -> passed_exam(?s)
> >
> > Regards,
> > Igor
> >
> >
> > > Sent: Thursday, August 22, 2019 at 2:03 PM
> > > From: "Jabardi" <[hidden email]>
> > > To: [hidden email]
> > > Subject: [protege-user] SWRL issue
> > >
> > > Hello all,
> > > Suppose we have five student with five marks for each one as shown bellow
> > > name test1 test2 test3 test4 test5
> > > student1 1 0 0 0 0
> > > student2 1 1 0 0 0
> > > student3 1 1 1 0 0
> > > student4 1 1 1 1 0
> > > student5 1 1 1 1 1
> > >  
> > > How to infer that student who has summation >=3  is pass, using SWRL?
> > >
> > > Best regards
> > >
> > >
> > >
> > >
> > > --
> > > 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
>
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Aggregating data properties with SWRL ("SWRLissue")

Jabardi

Hi  Igor,

Thanks for valuable information.

I think the solve problem by use Protégé Cellfie Plugin to import individuals is not solving , it is just transfer calculation to excel which makes the necessary computation and then back data to SWRL.

How to solve problem  in SWRL?

Please, can applying the same example with Linked-list

 

Best Regards

Mohammed

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Sunday, September 1, 2019 1:36 AM
To: [hidden email]
Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRLissue")

 

Actually this shows an interesting generic observation:

 

If you have a sum calculation task on integer data properties (especially with very small data values), and it is possible to convert these data properties to object properties, then you can delegate the sum calculation to the reasoner.

 

Igor

 

 

> Sent: Saturday, August 31, 2019 at 11:12 PM

> From: "Igor Toujilov" <[hidden email]>

> To: [hidden email]

> Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")

> 

> Another approach to this use case does not require calculating sums, and does not use SWRL at all. But it works only if you have binary assessment for tests (passed, not passed), not a numeric mark. In this case, you can use a cardinality restriction axiom, and the reasoner will calculate the sums internally.

> For example:

>

> Individual: student1

>     Facts: 

>      passed  test1,

>       not  passed  test2,

>       not  passed  test3,

>       not  passed  test4,

>       not  passed  test5

>

> Then you write an axiom:

>

> passed min 3 test SubClassOf passed_exam

>

> Enjoy!

> Igor

>

>

> > Sent: Saturday, August 31, 2019 at 10:25 PM

> > From: "Igor Toujilov" <[hidden email]>

> > To: [hidden email]

> > Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")

> >

> > In my previous posts I suggested to use linked lists or indexers to calculate sums. Currently this approach is not easy to use if you have massive data because automation tools are not yet available.

> > So, for this use case, an easier approach is to use Protégé Cellfie Plugin to import individuals, their values, and the sums from an Excel spreadsheet to your ontology. In this case, the sums are calculated in the spreadsheet, and the target ontology might have individuals like the following:

> >

> > Individual: student1

> > Facts: has_sum_of_marks 1

> >

> > Then you write a rule:

> >

> > has_sum_of_marks(?s, ?m), greaterThanOrEqual(?m, 3) -> passed_exam(?s)

> >

> > Regards,

> > Igor

> >

> >

> > > Sent: Thursday, August 22, 2019 at 2:03 PM

> > > From: "Jabardi" <[hidden email]>

> > > To: [hidden email]

> > > Subject: [protege-user] SWRL issue

> > >

> > > Hello all,

> > > Suppose we have five student with five marks for each one as shown bellow

> > > name          test1      test2      test3      test4      test5

> > > student1   1              0              0              0              0

> > > student2   1              1              0              0              0

> > > student3   1              1              1              0              0

> > > student4   1              1              1              1              0

> > > student5   1              1              1              1              1

> > > 

> > > How to infer that student who has summation >=3  is pass, using SWRL?

> > >

> > > Best regards

> > >

> > >

> > >

> > >

> > > --

> > > 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

> 

_______________________________________________

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: Aggregating data properties with SWRL ("SWRLissue")

Igor Toujilov-2
Hi Mohammed,
Again, my two methods of calculation (the first, using the linked list, and the second, using the indexer) do work with SWIRL only (without Cellfie plugin. You can replicate them for your use case, if you read carefully the descriptions: for the linked lists please read my explanations at the annotation property "source"; for the indexer please read the explanations in the annotation property "'description". Of course you need understanding the logical theory of OWL.

However my point is: if you have massive data, you can't do it manually without automation tools.

And how about my third method: using object properties and cardinality restrictions? In this case you don't need SWRL.

Regards,
Igor
--
Sent from my Android phone with mail.com Mail. Please excuse my brevity.
On 01/09/2019, 21:39 "mohammed.H Naji" <[hidden email]> wrote:

Hi  Igor,

Thanks for valuable information.

I think the solve problem by use Protégé Cellfie Plugin to import individuals is not solving , it is just transfer calculation to excel which makes the necessary computation and then back data to SWRL.

How to solve problem  in SWRL?

Please, can applying the same example with Linked-list

 

Best Regards

Mohammed

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Sunday, September 1, 2019 1:36 AM
To: [hidden email]
Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRLissue")

 

Actually this shows an interesting generic observation:

 

If you have a sum calculation task on integer data properties (especially with very small data values), and it is possible to convert these data properties to object properties, then you can delegate the sum calculation to the reasoner.

 

Igor

 

 

> Sent: Saturday, August 31, 2019 at 11:12 PM

> From: "Igor Toujilov" <[hidden email]>

> To: [hidden email]

> Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")

>

 

> Another approach to this use case does not require calculating sums, and does not use SWRL at all. But it works only if you have binary assessment for tests (passed, not passed), not a numeric mark. In this case, you can use a cardinality restriction axiom, and the reasoner will calculate the sums internally.

> For example:

>

> Individual: student1

>     Facts: 

>      passed  test1,

>       not  passed  test2,

>       not  passed  test3,

>       not  passed  test4,

>       not  passed  test5

>

> Then you write an axiom:

>

> passed min 3 test SubClassOf passed_exam

>

> Enjoy!

> Igor

>

>

> > Sent: Saturday, August 31, 2019 at 10:25 PM

> > From: "Igor Toujilov" <[hidden email]>

> > To: [hidden email]

> > Subject: Re: [protege-user] Aggregating data properties with SWRL ("SWRL issue")

> >

> > In my previous posts I suggested to use linked lists or indexers to calculate sums. Currently this approach is not easy to use if you have massive data because automation tools are not yet available.

> > So, for this use case, an easier approach is to use Protégé Cellfie Plugin to import individuals, their values, and the sums from an Excel spreadsheet to your ontology. In this case, the sums are calculated in the spreadsheet, and the target ontology might have individuals like the following:

> >

> > Individual: student1

> > Facts: has_sum_of_marks 1

> >

> > Then you write a rule:

> >

> > has_sum_of_marks(?s, ?m), greaterThanOrEqual(?m, 3) -> passed_exam(?s)

> >

> > Regards,

> > Igor

> >

> >

> > > Sent: Thursday, August 22, 2019 at 2:03 PM

> > > From: "Jabardi" <[hidden email]>

> > > To: [hidden email]

> > > Subject: [protege-user] SWRL issue

> > >

> > > Hello all,

> > > Suppose we have five student with five marks for each one as shown bellow

> > > name          test1      test2      test3      test4      test5

> > > student1   1              0              0              0              0

> > > student2   1              1              0              0              0

> > > student3   1              1              1              0              0

> > > student4   1              1              1              1              0

> > > student5   1              1              1              1              1

> > > 

> > > How to infer that student who has summation >=3  is pass, using SWRL?

> > >

> > > Best regards

> > >

> > >

> > >

> > >

> > > --

> > > 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

>

 

_______________________________________________

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