Hi,
I had a problem using Algernon with Protege that I
seem to have fixed with the following change. The
issue is captured in the following trace log. In
short, Algernon was throwing an exception in a case
where it should have failed, and it prevented me from
doing back-chaining in certain cases. I tracked the
problem down to the particular class that I have
modified. I should say that I used the latest release
code (5.1) rather than download the latest CVS
snapshot, but regardless it appears that this file has
not been updated since then.
--Stephen
Ask: ((:FOR ?i ?n ?x (:INSTANCE
Cortical_Spiny_Stellate_Cell ?x)) (has_Neurotran
smitter ?x ?y))
Subroutine
Clause (:INSTANCE Cortical_Spiny_Stellate_Cell ?x)
Substitute
* No substitution made.
(:INSTANCE Cortical_Spiny_Stellate_Cell ?x)
* INSTANCE query returned 2 instances.
* FAIL: previous operation succeeded. Continuing.
RETURN :SUCCESS
Subroutine returned ((:SUCCESS . { ( (?x .
Cortical_Spiny_Stellate_Cell_2) ) })
(:SUCCESS . { ( (?x . Cortical_Spiny_Stellate_Cell_1) ) }))
Clause (:FOR ?i ?n ?x)
(:FOR ?i ?n ?x)
* :FOR - there are 2 bindings of ?x
Branch
* Adding activation "1.1" with a binding list of (
(?x . Cortical_Spiny_Stell
ate_Cell_2) (?i . 2) (?n . 2) )
* Adding activation "1.2" with a binding list of (
(?x . Cortical_Spiny_Stell
ate_Cell_1) (?i . 1) (?n . 2) )
Select
* Selected activation "1.2"
Clause (has_Neurotransmitter ?x ?y)
Substitute
--> (has_Neurotransmitter
Cortical_Spiny_Stellate_Cell_1 ?y)
Branch
* Adding activation "1.2.1" with a binding list of (
(?x . Cortical_Spiny_Ste
llate_Cell_1) (?i . 1) (?n . 2) )
ACTIVATE-BC (has_Neurotransmitter
Cortical_Spiny_Stellate_Cell_1 ?y)
* Can't activate rules because the relation is
already full on that frame.
Select
* Selected activation "1.2.1"
QUERY: (has_Neurotransmitter
Cortical_Spiny_Stellate_Cell_1 ?y)
* Query succeeded with 1 results.
* FAIL: previous operation succeeded. Continuing.
RETURN :SUCCESS
Select
* Selected activation "1.1"
Clause (has_Neurotransmitter ?x ?y)
Substitute
--> (has_Neurotransmitter
Cortical_Spiny_Stellate_Cell_2 ?y)
Branch
* Adding activation "1.1.1" with a binding list of (
(?x . Cortical_Spiny_Ste
llate_Cell_2) (?i . 2) (?n . 2) )
ACTIVATE-BC (has_Neurotransmitter
Cortical_Spiny_Stellate_Cell_2 ?y)
* Activating backward chaining rules from
(has_Neurotransmitter Cortical_Spin
y_Stellate_Cell_2 ?y)
Exception in thread "AWT-EventQueue-0"
java.lang.ClassCastException: edu.stanfor
d.smi.protegex.owl.model.impl.DefaultOWLObjectProperty
at
org.algernon.kb.okbc.protege.AlgernonProtegeFrame.getParents(Algernon
ProtegeFrame.java:246)
at
org.algernon.rule.RuleManager.getParents(RuleManager.java:192)
at
org.algernon.rule.RuleManager.getRules(RuleManager.java:281)
at
org.algernon.Algernon.getActivatedRules(Algernon.java:1266)
at
org.algernon.aam.Processor.activateClosures(Processor.java:383)
at
org.algernon.aam.opcode.ActivateBCRules.execute(ActivateBCRules.java:
115)
at
org.algernon.aam.Processor.process(Processor.java:246)
at org.algernon.Algernon.ask(Algernon.java:495)
at org.algernon.Algernon.ask(Algernon.java:441)
at org.algernon.Algernon.ask(Algernon.java:387)
at
org.algernon.kb.okbc.protege.plugins.AlgernonTab.doAskOrTell(Algernon
Tab.java:520)
at
org.algernon.kb.okbc.protege.plugins.action.AskAction.actionPerformed
(AskAction.java:62)
at
javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Sour
ce)
at
java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown
Source)
at
javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown
Source)
at java.awt.Container.dispatchEventImpl(Unknown
Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at
java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
at
java.awt.LightweightDispatcher.dispatchEvent(Unknown
Source)
at java.awt.Container.dispatchEventImpl(Unknown
Source)
at java.awt.Window.dispatchEventImpl(Unknown
Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown
Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
***CONTENT OF PATCH****
--- AlgernonProtegeFrame.java 2006-07-24
20:03:59.190420800 -0700
+++ AlgernonProtegeFrame.java~ 2004-02-12
21:06:58.000000000 -0800
@@ -273,7 +273,7 @@
// Superslot of a slot
else if (this instanceof AlgernonProtegeRelation)
{
- return
m_kb.convertToAlgernon(((Slot)m_frame).getSuperslots());
+ return ((Slot)m_frame).getSuperslots();
}
// Superfacet of a facet
Patch obtained by running diff -u on the modified file versus the original file: AlgernonProtegeFrame.java