This is the javadoc for the class:
http://owlapi.sourceforge.net/javadoc/uk/ac/manchester/cs/owl/owlapi/OWLClas...
Here is the errors.
Suggestions: Catch errors in print-object and print anyways, with flag if you really want to signal error.
-Alan
Inconsistent precedence graph. [Condition of type SIMPLE-ERROR]
Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [ABORT] Return to SLIME's top level. 2: [ABORT] Abort thread.
Backtrace: 0: (ERROR "Inconsistent precedence graph.") 1: (MOP::TOPOLOGICAL-SORT (#<BUILT-IN-CLASS T> #<STANDARD-CLASS STANDARD-OBJECT {F2FBFF}> #<JAVA-CLASS {163B1C}> #<JAVA-CLASS {82B591}> #<JAVA-CLASS {5E632A}> #<JAVA-CLASS {C069F9}> ...) ((#<STANDARD-CLA.. 2: (MOP::STD-COMPUTE-CLASS-PRECEDENCE-LIST #<JAVA-CLASS {79BBDF}>) 3: (#<STANDARD-GENERIC-FUNCTION MOP::COMPUTE-CLASS-PRECEDENCE-LIST {B10995}> #<JAVA-CLASS {79BBDF}>) 4: (MOP::STD-FINALIZE-INHERITANCE #<JAVA-CLASS {79BBDF}>) 5: (#<STANDARD-GENERIC-FUNCTION MOP::FINALIZE-INHERITANCE {98068D}> #<JAVA-CLASS {79BBDF}>) 6: (#<FUNCTION {C1F62E}> #<JAVA-CLASS {79BBDF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA-CLASS {5E632A}> #<JAVA-CLASS {82B591}>) ...) 7: (APPLY #<FUNCTION {C1F62E}> #<JAVA-CLASS {79BBDF}> (:NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (# # #) :JAVA-CLASS #<java.lang.Class interface org.semanticweb.owlap.. 8: (#<FUNCTION {D182D6}> #<JAVA-CLASS {79BBDF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA-CLASS {5E632A}> #<JAVA-CLASS {82B591}>) ...) 9: (APPLY #<FUNCTION {D182D6}> (#<JAVA-CLASS {79BBDF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (# # #) :JAVA-CLASS ...)) 10: (#<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE {318C29}> #<JAVA-CLASS {79BBDF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA-CLASS {5.. 11: (APPLY #<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE {318C29}> #<JAVA-CLASS {79BBDF}> (:NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (# # #) :JAVA-CLASS #<java.lang... 12: (#<FUNCTION {E4B5A9}> #<STANDARD-CLASS JAVA-CLASS {67DCEF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA-CLASS {5E632A}> #<JAVA-CLASS {.. 13: (APPLY #<FUNCTION {E4B5A9}> (#<STANDARD-CLASS JAVA-CLASS {67DCEF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (# # #) :JAVA-CLASS ...)) 14: (#<STANDARD-GENERIC-FUNCTION MAKE-INSTANCE {216D6D}> #<STANDARD-CLASS JAVA-CLASS {67DCEF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA.. 15: (APPLY #<STANDARD-GENERIC-FUNCTION MAKE-INSTANCE {216D6D}> #<STANDARD-CLASS JAVA-CLASS {67DCEF}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| (:DIRECT-SUPERCLASSES (# # #) :JAVA-CLASS #<j.. 16: (SYSTEM:ENSURE-CLASS #:|org.semanticweb.owlapi.model.OWLClassExpression| :METACLASS #<STANDARD-CLASS JAVA-CLASS {67DCEF}> :DIRECT-SUPERCLASSES (#<JAVA-CLASS {C069F9}> #<JAVA-CLASS {5E632A}> #<JAVA-CLA.. 17: (ENSURE-JAVA-CLASS #<java.lang.Class interface org.semanticweb.owlapi... {1D3D9D}>) 18: (ENSURE-JAVA-CLASS #<java.lang.Class class uk.ac.manchester.cs.owl.ow... {B8486F}>) 19: (PRINT-OBJECT #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #S(SYSTEM::STRING-OUTPUT-STREAM)) 20: (SYSTEM::OUTPUT-UGLY-OBJECT #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #S(SYSTEM::STRING-OUTPUT-STREAM)) 21: (SYSTEM::%PRINT-OBJECT #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #S(SYSTEM::STRING-OUTPUT-STREAM)) 22: (SYSTEM:OUTPUT-OBJECT #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #S(SYSTEM::STRING-OUTPUT-STREAM)) 23: (SYSTEM::OUTPUT-LIST (#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/N... {E1F.. 24: (SYSTEM::OUTPUT-UGLY-OBJECT (#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/N... 25: (SYSTEM::%PRINT-OBJECT (#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/N... {E.. 26: (SYSTEM:OUTPUT-OBJECT (#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/N... {E1.. 27: (PRIN1-TO-STRING (#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/N... {E1F4D8}.. 28: (SWANK::PRESENT-REPL-RESULTS ((#<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ontology.neuinfo.org/NIF... {9B8B79}> #<uk.ac.manchester.cs.owl.owlapi.OWLClassImpl < http://ccdb.ucsd.edu/NDPO/1.0/.. 29: (#<FUNCTION {68B350}>) 30: (SWANK::TRACK-PACKAGE #<FUNCTION {68B350}>) 31: (#<FUNCTION {D47FC3}>) 32: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<FUNCTION {D47FC3}>) 33: (#<FUNCTION {101CC5}>) 34: (FUNCALL #<FUNCTION {101CC5}>) 35: (#<FUNCTION (LAMBDA (SWANK-BACKEND::FN)) {4616CA}> #<FUNCTION {101CC5}>) 36: (APPLY #<FUNCTION (LAMBDA (SWANK-BACKEND::FN)) {4616CA}> #<FUNCTION {101CC5}> NIL) 37: (SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS #<FUNCTION {101CC5}>) 38: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<FUNCTION {101CC5}>) 39: (SWANK::REPL-EVAL "(imports-declarations @) ") 40: (SWANK:LISTENER-EVAL "(imports-declarations @) ") 41: (SYSTEM::%EVAL (SWANK:LISTENER-EVAL "(imports-declarations @) ")) 42: (EVAL (SWANK:LISTENER-EVAL "(imports-declarations @) ")) 43: (SWANK::EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(imports-declarations @) ") "COMMON-LISP-USER" 712) 44: (APPLY #<FUNCTION SWANK::EVAL-FOR-EMACS {825BB7}> ((SWANK:LISTENER-EVAL "(imports-declarations @) ") "COMMON-LISP-USER" 712)) 45: (SWANK::PROCESS-REQUESTS NIL) 46: (#<FUNCTION {D0F6AE}>) 47: (FUNCALL #<FUNCTION {D0F6AE}>) 48: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK) #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK {E26AA1}> #<FUNCTION {D0F6AE}>) 49: (APPLY #<FUNCTION (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK) {F31E8A}> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK {E26AA1}> #<FUNCTION {D0F6AE}> NIL) 50: (SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK {E26AA1}> #<FUNCTION {D0F6AE}>) 51: (#<FUNCTION {5A3285}>) 52: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #S(SLIME-OUTPUT-STREAM)) (*STANDARD-INPUT* . #S(SLIME-INPUT-STREAM)) (*TRACE-OUTPUT* . #S(SLIME-OUTPUT-STREAM)) (*ERROR-OUTPUT* . #S(SLIME-OUTPUT-STREA.. 53: (#<FUNCTION {5F32BE}>) 54: (JRUN-EXCEPTION-PROTECTED #<FUNCTION {5F32BE}>) 55: (#<FUNCTION {FC7979}>) 56: (JRUN-EXCEPTION-PROTECTED #<FUNCTION {FC7979}>) 57: (SWANK::CALL-WITH-CONNECTION #S(SWANK::CONNECTION :SOCKET #<java.net.ServerSocket ServerSocket[addr=0.0.0.0/0.0.0.... {8B2078}> :SOCKET-IO #<TWO-WAY-STREAM {DF7E}> :DEDICATED-OUTPUT NIL :USER-INPUT #S.. 58: (JRUN-EXCEPTION-PROTECTED #<FUNCTION {50D4FE}>) 59: (#<FUNCTION {CF8D9B}>)
On Fri, May 7, 2010 at 6:12 PM, Alan Ruttenberg alanruttenberg@gmail.com wrote:
This is the javadoc for the class: http://owlapi.sourceforge.net/javadoc/uk/ac/manchester/cs/owl/owlapi/OWLClas... Here is the errors. Suggestions: Catch errors in print-object and print anyways, with flag if you really want to signal error. -Alan
Inconsistent precedence graph.
Hi Alan,
the error was probably caused by the code that computed the class precedence list for JAVA-CLASSes, which didn't remove duplicate entries (which can happen with interfaces). I fixed that and committed to trunk.
While I was at it, I also rationalized a bit the order of the classes in the CPL:
1. first come Java classes 2. then interfaces 3. then java.lang.Object 4. and finally non-Java CLOS classes.
the motivation for that is 1. and 2. concrete classes are arguably more specific than interfaces; 3. "everything is an (java.lang.)Object"; 4. well, they have to be there ;)
Let me know if that fixes your bug and if you have further comments or observations.
Cheers, Alessio
Didn't seem to do it:
(ensure-java-class (find-java-class "uk.ac.manchester.cs.owl.owlapi.OWLClassImpl"))
Fails - trackback below.
Could it have something to do with the different classloaders? I'm using the bsh class loader.
-Alan
Inconsistent precedence graph. [Condition of type SIMPLE-ERROR]
Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [ABORT] Return to SLIME's top level. 2: [ABORT] Abort thread.
Backtrace: 0: (ERROR "Inconsistent precedence graph.") 1: (MOP::TOPOLOGICAL-SORT (#<BUILT-IN-CLASS T> #<STANDARD-CLASS STANDARD-OBJECT {BB8694}> #<JAVA-CLASS {76B70A}> #<JAVA-CLASS {EAFC88}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {F9B577}> ...) ((#<STANDARD-CLA.. 2: (MOP::STD-COMPUTE-CLASS-PRECEDENCE-LIST #<JAVA-CLASS {8ECBB9}>) 3: (#<FUNCTION (LAMBDA (MOP::ARGS MOP::NEXT-EMFUN)) {8CA21A}> (#<JAVA-CLASS {8ECBB9}>) NIL) 4: (#<FUNCTION {E67B9B}> (#<JAVA-CLASS {8ECBB9}>)) 5: (#<FUNCTION {E0F275}> #<JAVA-CLASS {8ECBB9}>) 6: (APPLY #<FUNCTION {E0F275}> (#<JAVA-CLASS {8ECBB9}>)) 7: (#<STANDARD-GENERIC-FUNCTION MOP::COMPUTE-CLASS-PRECEDENCE-LIST {3DAC04}> #<JAVA-CLASS {8ECBB9}>) 8: (MOP::STD-FINALIZE-INHERITANCE #<JAVA-CLASS {8ECBB9}>) 9: (#<STANDARD-GENERIC-FUNCTION MOP::FINALIZE-INHERITANCE {B34C53}> #<JAVA-CLASS {8ECBB9}>) 10: (#<FUNCTION {BF47E5}> #<JAVA-CLASS {8ECBB9}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {EAFC88}>) ...) 11: (APPLY #<FUNCTION {BF47E5}> #<JAVA-CLASS {8ECBB9}> (:NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {EAFC88}>.. 12: (#<FUNCTION {41D9FF}> #<JAVA-CLASS {8ECBB9}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {EAFC88}>) ...) 13: (APPLY #<FUNCTION {41D9FF}> (#<JAVA-CLASS {8ECBB9}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {EAFC88}>.. 14: (#<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE {10E1A4}> #<JAVA-CLASS {8ECBB9}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6.. 15: (APPLY #<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE {10E1A4}> #<JAVA-CLASS {8ECBB9}> (:NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-C.. 16: (#<FUNCTION {4F29D2}> #<STANDARD-CLASS JAVA-CLASS {D3B52}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLASS {E.. 17: (APPLY #<FUNCTION {4F29D2}> (#<STANDARD-CLASS JAVA-CLASS {D3B52}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-C.. 18: (#<STANDARD-GENERIC-FUNCTION MAKE-INSTANCE {617DFA}> #<STANDARD-CLASS JAVA-CLASS {D3B52}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-.. 19: (APPLY #<STANDARD-GENERIC-FUNCTION MAKE-INSTANCE {617DFA}> #<STANDARD-CLASS JAVA-CLASS {D3B52}> :NAME #:|org.semanticweb.owlapi.model.OWLClassExpression| (:DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> .. 20: (SYSTEM:ENSURE-CLASS #:|org.semanticweb.owlapi.model.OWLClassExpression| :METACLASS #<STANDARD-CLASS JAVA-CLASS {D3B52}> :DIRECT-SUPERCLASSES (#<JAVA-CLASS {F9B577}> #<JAVA-CLASS {6957A7}> #<JAVA-CLAS.. 21: (ENSURE-JAVA-CLASS #<java.lang.Class interface org.semanticweb.owlapi... {4E151E}>) 22: (ENSURE-JAVA-CLASS #<java.lang.Class class uk.ac.manchester.cs.owl.ow... {4C68D4}>) 23: (ENSURE-JAVA-CLASS #<java.lang.Class class uk.ac.manchester.cs.owl.ow... {765640}>) 24: (SYSTEM::%EVAL (ENSURE-JAVA-CLASS (FIND-JAVA-CLASS "uk.ac.manchester.cs.owl.owlapi.OWLClassImpl")))
On Sun, May 9, 2010 at 7:05 AM, Alan Ruttenberg alanruttenberg@gmail.com wrote:
Didn't seem to do it:
(ensure-java-class (find-java-class "uk.ac.manchester.cs.owl.owlapi.OWLClassImpl"))
Fails - trackback below.
Duh, right. The remove-duplicates was a silly mistake, it's completely non influential. The problem here is that Java inheritance of interfaces is order-independent, while CLOS honors a class precedence order. It's thus possible to have Java interfaces that create precedence graphs which cannot be ordered by CLOS standard rules, as you have found out, specifically:
OWLObject extends Comparable, but OWLPredicate extends Comparable, OWLObject
in CLOS, that would be like:
(defclass comp () ()) (defclass owlo (comp) ()) (defclass owlp (comp owlo) ())
So, I patched it again to completely skip the default compute-class-precedence-list method and directly sort the list of superclasses (as returned by mop::compute-superclasses*). I tested it with your OWL example and it works.
Thanks for reporting!
Alessio
armedbear-devel@common-lisp.net