[Pellet-users] Interpreting the output of RulesExample

Robert Davey robert.davey at bbsrc.ac.uk
Thu Sep 13 09:48:59 UTC 2007


Here's the snip of Alan's code:

------------------
(defun log-abox (&optional (level "ALL") (kb *default-kb*))
   (let ((logger (#"getLogger" (get-java-field (#"getABox" (kb-kb  
kb)) "log"))))
     (unless (#"hasMoreElements" (#"getAllAppenders" logger))
       (#"addAppender" logger (new 'consoleappender (new  
'simplelayout))))
     (#"setLevel" logger (get-java-field  'org.apache.log4j.Level  
level))))

(defun log-tbox (&optional (level "ALL") (kb *default-kb*))
   (let ((logger (#"getLogger" (get-java-field (#"getTBox" (kb-kb  
kb)) "log"))))
     (unless (#"hasMoreElements" (#"getAllAppenders" logger))
       (#"addAppender" logger (new 'consoleappender (new  
'simplelayout))))
     (#"setLevel" logger (get-java-field  'org.apache.log4j.Level  
level))))

(defun log-kb (&optional (level "ALL") (kb *default-kb*))
   (let ((logger (#"getLogger" (get-java-field (kb-kb kb) "log"))))
     (unless (#"hasMoreElements" (#"getAllAppenders" logger))
       (#"addAppender" logger (new 'consoleappender (new  
'simplelayout))))
     (#"setLevel" logger (get-java-field  'org.apache.log4j.Level  
level))))
------------------

And here's some of our Java code, where reasoner is a member variable,
Level is from the apache log4j library, and Log4JLogger is a apache
commons library wrapper class for the log4j Logger class:

------------------
public void setLogLevel(org.apache.log4j.Level level)
{
        Log4JLogger abox_logger =
(Log4JLogger)reasoner.getKB().getABox().log;
        abox_logger.getLogger().setLevel(level);
        
        Log4JLogger taxonomy_logger =
(Log4JLogger)reasoner.getKB().getTaxonomy().log;
        taxonomy_logger.getLogger().setLevel(level);
        
        Log4JLogger kb_logger = (Log4JLogger)reasoner.getKB().log;
        kb_logger.getLogger().setLevel(level);
}
------------------

Hope this helps

Rob

On Sat, 2007-09-08 at 17:11 +0200, Role Francois wrote:
> Thanks for uour reply but what is the code posted by Alan ? A piece of
> code that allows to turn off debug in a program using Pellet ? If so I
> would be grateful if you could post it.
> 
> By the way, reading the post I saw that there is a concern with the SWRL
> syntax. As Pellet users, what exactly must we be careful about?
> 
> François
> 
> > Hi Francois,
> >
> > Yes you can turn the debug output off - if you check the list for the
> > "Pellet logging" thread, a simple solution is documented there.
> >
> > If you need some Java code to help instead of Alan's lisp-ish version,
> > I'm happy to post it up.
> >
> > Cheers
> >
> > Rob
> >
> > On Fri, 2007-09-07 at 11:04 +0200, Role Francois wrote:
> >> Hi,
> >>
> >>
> >>
> >> Thanks to your guidance I succeeded in running RulesExample  and got the
> >> output below.
> >>  The result is ok but where do the lines beginning with [java]  INFO
> >> [main] (ABox.java:1530)...  come from ? And what do they mean ? And is
> >> there a way to suppress this debug info ?
> >>
> >>
> >>
> >> run:
> >>
> >>      [java]  INFO [main] (PelletOptions.java:82) - Reading Pellet
> >> configuration file
> >> jar:file:/C:/Perso/tools/apache-ant-1.6.5-bin/apache-ant-1.6.5/pellet-lib/pellet.jar!/pellet.properties
> >>
> >>      [java]  INFO [main] (KnowledgeBase.java:1473) - Expressivity:
> >> ALCHOI,
> >> Classes: 5 Properties: 5 Individuals: 6 Strategy: RuleStrategy
> >>
> >>      [java]  INFO [main] (ABox.java:1530) - ABox consistency for 0
> >> individuals
> >>
> >>      [java]  INFO [main] (ABox.java:1619) - Consistent: true Tree depth:
> >> 6
> >> Tree size: 27 Time: 141
> >>
> >>      [java]  INFO [main] (ABox.java:1532) - Consistency
> >> all(inv(http://localhost/dl-safe.owl#sibling),not(value(http://localhost/dl-safe.owl#Cain)))
> >> for 2 individuals [http://localhost/dl-safe.owl#Romulus,
> >> http://localhost/dl-safe.owl#Remus]
> >>
> >>      [java]  INFO [main] (ABox.java:1619) - Consistent: true Tree depth:
> >> 6
> >> Tree size: 30 Time: 109
> >>
> >>      [java]  INFO [main] (ABox.java:1532) - Consistency
> >> all(inv(http://localhost/dl-safe.owl#sibling),not(value(http://localhost/dl-safe.owl#Cain)))
> >> for 1 individuals [http://localhost/dl-safe.owl#Abel]
> >>
> >>      [java]  INFO [main] (ABox.java:1619) - Consistent: false Tree
> >> depth:
> >> 2 Tree size: 11 Time: 125
> >>
> >>      [java]  INFO [main] (ABox.java:1532) - Consistency
> >> all(inv(http://localhost/dl-safe.owl#sibling),not(value(http://localhost/dl-safe.owl#Cain)))
> >> for 1 individuals [http://localhost/dl-safe.owl#Oedipus]
> >>
> >>      [java]  INFO [main] (ABox.java:1619) - Consistent: true Tree depth:
> >> 6
> >> Tree size: 29 Time: 62
> >>
> >>      [java]  INFO [main] (ABox.java:1532) - Consistency
> >> all(inv(http://localhost/dl-safe.owl#sibling),not(value(http://localhost/dl-safe.owl#Cain)))
> >> for 1 individuals [http://localhost/dl-safe.owl#Adam]
> >>
> >>      [java]  INFO [main] (ABox.java:1619) - Consistent: true Tree depth:
> >> 6
> >> Tree size: 29 Time: 63
> >>
> >>      [java] Cain has sibling(s): Abel
> >>
> >>
> >>
> >> Thanks,
> >>
> >> François
> >>
> >> _______________________________________________
> >> Pellet-users mailing list
> >> Pellet-users at lists.owldl.com
> >> http://lists.owldl.com/mailman/listinfo/pellet-users
> >> _______________________________________________
> >>
> >> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
> > --
> > ---------------------------------------
> > Dr. Rob Davey
> > NCYC / Institute of Food Research
> > Computational Biology / John Innes Centre
> > Norwich Research Park
> > Norwich, Norfolk, NR4 7HU
> >
> > http://www.comparagrid.org/
> > http://cbr.jic.ac.uk/dicks/
> > ---------------------------------------
> >
> >
> 
> 
-- 
---------------------------------------
Dr. Rob Davey
NCYC / Institute of Food Research
Computational Biology / John Innes Centre
Norwich Research Park
Norwich, Norfolk, NR4 7HU

http://www.comparagrid.org/
http://cbr.jic.ac.uk/dicks/
---------------------------------------



More information about the Pellet-users mailing list