Swrl rule

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

Swrl rule

asma saighi
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks


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

testmultimedia.owl (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Swrl rule

Lorenz Buehmann
Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



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

Lorenz Buehmann
In reply to this post by asma saighi
And what is the idea of rule1, which in fact does have in it's body all atoms from the body of rule2 + some more? In that case, the rule2 already infers what rule1 would also infer.

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



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

asma saighi
In reply to this post by Lorenz Buehmann
Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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: Swrl rule

samsontu
OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson

On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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: Swrl rule

Lorenz Buehmann
Exactly. And I would stick to a naming convention in your ontology. E.g. all classes start with capital letter and properties with lower case. Moreover, I would use CamelCase for ocmpound words then.

On 16.03.2016 16:39, Samson Tu wrote:
OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson

On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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: Swrl rule

samsontu
In reply to this post by samsontu
Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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

Re: Swrl rule

asma saighi
Hi,
Yes i need that both text and audio classes to have individuals. 
Is it possible to compare the value of two variables such as expressed in the rule: swrlb:greaterThan(?y, ?z)

I add text end and audio begin as data properties.
In the rule i want to express that if the multimedia document is composed of a text and an audio and the text end > audio begin then transmoding service is infered. 



De : Samson Tu <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 17h42
Objet : Re: [protege-user] Swrl rule

Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




_______________________________________________
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

testmultimedia.owl (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Swrl rule

samsontu
Had you changed the uppercase ‘Audio' and ‘Text' in the rule 

...hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z)...

to lowercase ‘audio' and ‘text’ and test the rule again?

With best regards,
Samson


On Mar 16, 2016, at 10:49 AM, asma saighi <[hidden email]> wrote:

Hi,
Yes i need that both text and audio classes to have individuals. 
Is it possible to compare the value of two variables such as expressed in the rule: swrlb:greaterThan(?y, ?z)

I add text end and audio begin as data properties.
In the rule i want to express that if the multimedia document is composed of a text and an audio and the text end > audio begin then transmoding service is infered. 



De : Samson Tu <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 17h42
Objet : Re: [protege-user] Swrl rule

Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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


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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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

Re: Swrl rule

asma saighi
In reply to this post by asma saighi



Hi,
I want to express through the following rule that no service matches with the multimedia document: Multimedia doc(?x) ∧ hascontent (?x, text) → has service (?x, nothing)

How can i express NULL or nothing with SWRL rules?
 Thinks



De : Samson Tu <[hidden email]>
À : asma saighi <[hidden email]>; User support for WebProtege and Protege Desktop <[hidden email]>
Cc : Samson Tu <[hidden email]>
Envoyé le : Jeudi 17 mars 2016 17h49
Objet : Re: [protege-user] Swrl rule

Had you changed the uppercase ‘Audio' and ‘Text' in the rule 

...hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z)...

to lowercase ‘audio' and ‘text’ and test the rule again?

With best regards,
Samson


On Mar 16, 2016, at 10:49 AM, asma saighi <[hidden email]> wrote:

Hi,
Yes i need that both text and audio classes to have individuals. 
Is it possible to compare the value of two variables such as expressed in the rule: swrlb:greaterThan(?y, ?z)

I add text end and audio begin as data properties.
In the rule i want to express that if the multimedia document is composed of a text and an audio and the text end > audio begin then transmoding service is infered. 



De : Samson Tu <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 17h42
Objet : Re: [protege-user] Swrl rule

Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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


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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944








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

Re: Swrl rule

Martin O'Connor-2


Martin

On Mar 21, 2016, at 10:42 AM, asma saighi <[hidden email]> wrote:




Hi,
I want to express through the following rule that no service matches with the multimedia document: Multimedia doc(?x) ∧ hascontent (?x, text) → has service (?x, nothing)

How can i express NULL or nothing with SWRL rules?
 Thinks



De : Samson Tu <[hidden email]>
À : asma saighi <[hidden email]>; User support for WebProtege and Protege Desktop <[hidden email]>
Cc : Samson Tu <[hidden email]>
Envoyé le : Jeudi 17 mars 2016 17h49
Objet : Re: [protege-user] Swrl rule

Had you changed the uppercase ‘Audio' and ‘Text' in the rule 

...hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z)...

to lowercase ‘audio' and ‘text’ and test the rule again?

With best regards,
Samson


On Mar 16, 2016, at 10:49 AM, asma saighi <[hidden email]> wrote:

Hi,
Yes i need that both text and audio classes to have individuals. 
Is it possible to compare the value of two variables such as expressed in the rule: swrlb:greaterThan(?y, ?z)

I add text end and audio begin as data properties.
In the rule i want to express that if the multimedia document is composed of a text and an audio and the text end > audio begin then transmoding service is infered. 



De : Samson Tu <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 17h42
Objet : Re: [protege-user] Swrl rule

Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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


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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944







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

samsontu
Depending on what Asma is asking, the relationship may be represented as an OWL class, defined as 

MultimediaDoc and hasContent value text

being a subclass of 

not (hasService some owl:Thing)

With best regards,
Samson


On Mar 21, 2016, at 12:07 PM, Martin O'Connor <[hidden email]> wrote:



Martin

On Mar 21, 2016, at 10:42 AM, asma saighi <[hidden email]> wrote:




Hi,
I want to express through the following rule that no service matches with the multimedia document: Multimedia doc(?x) ∧ hascontent (?x, text) → has service (?x, nothing)

How can i express NULL or nothing with SWRL rules?
 Thinks



De : Samson Tu <[hidden email]>
À : asma saighi <[hidden email]>; User support for WebProtege and Protege Desktop <[hidden email]>
Cc : Samson Tu <[hidden email]>
Envoyé le : Jeudi 17 mars 2016 17h49
Objet : Re: [protege-user] Swrl rule

Had you changed the uppercase ‘Audio' and ‘Text' in the rule 

...hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z)...

to lowercase ‘audio' and ‘text’ and test the rule again?

With best regards,
Samson


On Mar 16, 2016, at 10:49 AM, asma saighi <[hidden email]> wrote:

Hi,
Yes i need that both text and audio classes to have individuals. 
Is it possible to compare the value of two variables such as expressed in the rule: swrlb:greaterThan(?y, ?z)

I add text end and audio begin as data properties.
In the rule i want to express that if the multimedia document is composed of a text and an audio and the text end > audio begin then transmoding service is infered. 



De : Samson Tu <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 17h42
Objet : Re: [protege-user] Swrl rule

Hi,

It doesn’t make sense to add a “class time.” Instead of just trying to make a rule “work,” think about whether the ontology and the rule make sense. Give each entity in your ontology a definition, and ask yourself whether a individual of type Text to be also an individual of type multimedia_doc and context. Is it meaningful for Audio (a class) to be treated also as an individual?  

With best regards,
Samson



On Mar 16, 2016, at 9:01 AM, asma saighi <[hidden email]> wrote:





OWL and SWRL are case-sensitive.

audio is not the same as Audio. Ditto text and Text.

Samson
==> Yes, audio and text are individuals. Audio and Text are classes. I think that i have to add a classe time.


On Mar 16, 2016, at 6:56 AM, asma saighi <[hidden email]> wrote:

Conditions in the first rule are:
if we have a multimedia content composed of a text & an audio & (text end  > audio begin) 
text end and audio begin are data type properties of text and ausio respectively.

Expecting result is to inferer the corresponding service to the multimedia content in this rule is transmoding.

when i use jess to reason on this rule, no thing happen (do not inferer the service).

The first rule i add it just to demonstrate that the with some conditions it work (it gives the service transmoding), but when i add  (text end (time) > audio begin (time)) it doesn't work.

Is the problem clear now?
Thinks


De : Lorenz buehmann <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 16 mars 2016 14h28
Objet : Re: [protege-user] Swrl rule

Amsa,

please try to explain the problem better, it's not the first time we have to ask for more details:

What does not work?
What would you expect to get based on the first rule?

Lorenz

On 16.03.2016 13:42, asma saighi wrote:
Hello,
In the attached ontology i created two rules. The second rule work but the first one doesn't work. I edited it as follow:
doc multimedia_doc(?x) ∧ hascontent(?x, audio) ∧ hascontent(?x, text) ∧ hasAudioBegin(Audio, ?y) ∧ hasTextEnd(Text, ?z) ∧ 
swrlb:greaterThan(?z, ?y) → hasservice(?x, transmoding)
 
I dont understand where is the problem, in the ontology or in the rule editing? I use jess.
Thinks



_______________________________________________
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




-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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


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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944







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


-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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