Discussion:
[protege-user] SWRL Issue
Michael DeBellis
2018-11-29 17:41:18 UTC
Permalink
I decided to just take a quick and dirty first cut at a graph theory
ontology and have come across something in SWRL I can't understand. I'm
using Protege version 5.2.0 running on Windows 10 Home version 1803 and
Java 8 Update 191. I'm using Pellet as my Reasoner.

I'm attaching the ontology and a PDF that shows the tree graph I'm using as
my first graph.

I have a class called Edge that connects one node to another with
properties fromNode and toNode. Then I defined a transitive property called
hasSuccessor. My idea was to just use a SWRL rule to define the basic
successors of nodes directly connected by an edge and then the fact that
hasSuccessor is transitive will take care of the rest. So my rule is:

fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> hasSuccessor(?n1, ?n2)

This seemed to work except for some reason SWRL doesn't seem to be picking
up the first Edge: E1 that connects N1 and N2. I also ran a SQWRL rule:

fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> sqwrl:select(?n1, ?n2)

And it fired for Edges 2-4 but not Edge 1. (Also, I'm getting that autogen0
prefix thing again but I don't think that effects the reasoning).

Michael
Jim Balhoff
2018-11-29 17:58:15 UTC
Permalink
Hi Michael,

I looked at your ontology and was perplexed for a little while, but then I noticed that E1 has NEGATIVE object property assertions to N1 and N2. :-)

Best regards,
Jim
I decided to just take a quick and dirty first cut at a graph theory ontology and have come across something in SWRL I can't understand. I'm using Protege version 5.2.0 running on Windows 10 Home version 1803 and Java 8 Update 191. I'm using Pellet as my Reasoner.
I'm attaching the ontology and a PDF that shows the tree graph I'm using as my first graph.
fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> hasSuccessor(?n1, ?n2)
fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> sqwrl:select(?n1, ?n2)
And it fired for Edges 2-4 but not Edge 1. (Also, I'm getting that autogen0 prefix thing again but I don't think that effects the reasoning).
Michael
<Graph1.pdf><GraphTheoryOntology.owl>_______________________________________________
protege-user mailing list
https://mailman.stanford.edu/mailman/listinfo/protege-user
Michael DeBellis
2018-11-29 18:02:33 UTC
Permalink
D'oH! Can't believe I missed that. Thanks!!!

Michael
Post by Jim Balhoff
Hi Michael,
I looked at your ontology and was perplexed for a little while, but then I
noticed that E1 has NEGATIVE object property assertions to N1 and N2. :-)
Best regards,
Jim
Post by Michael DeBellis
I decided to just take a quick and dirty first cut at a graph theory
ontology and have come across something in SWRL I can't understand. I'm
using Protege version 5.2.0 running on Windows 10 Home version 1803 and
Java 8 Update 191. I'm using Pellet as my Reasoner.
Post by Michael DeBellis
I'm attaching the ontology and a PDF that shows the tree graph I'm using
as my first graph.
Post by Michael DeBellis
I have a class called Edge that connects one node to another with
properties fromNode and toNode. Then I defined a transitive property called
hasSuccessor. My idea was to just use a SWRL rule to define the basic
successors of nodes directly connected by an edge and then the fact that
Post by Michael DeBellis
fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> hasSuccessor(?n1, ?n2)
This seemed to work except for some reason SWRL doesn't seem to be
picking up the first Edge: E1 that connects N1 and N2. I also ran a SQWRL
Post by Michael DeBellis
fromNode(?e1, ?n1) ^ toNode(?e1, ?n2) -> sqwrl:select(?n1, ?n2)
And it fired for Edges 2-4 but not Edge 1. (Also, I'm getting that
autogen0 prefix thing again but I don't think that effects the reasoning).
Post by Michael DeBellis
Michael
<Graph1.pdf><GraphTheoryOntology.owl>_______________________________________________
Post by Michael DeBellis
protege-user mailing list
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
https://mailman.stanford.edu/mailman/listinfo/protege-user
Loading...