1

I'm using OWL (version 4.0.2) e Pellet (3.0) to populate an ontology and then use SWRL rules to infer new facts. But some jar in OWL API is printing a huge amount of message while I try to make inferences and no result is showed in the end - in fact, I don't wait until the end cause it takes forever executing.

Here is where I set some ontology info:

manager = OWLManager.createOWLOntologyManager();
    factory = manager.getOWLDataFactory();   
    this.ontologyURI = ontologyURI;
    pm = new DefaultPrefixManager(null, null,
            ontologyURI);


    File ontologyFile = new File("TwitterOntology.owl");
    try {
        ontology = manager.loadOntologyFromOntologyDocument(ontologyFile);
    } catch (OWLOntologyCreationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

I send you part of the logs:

14:54:38.961 [main] DEBUG o.s.o.rdf.rdfxml.parser.TripleLogger - Total number of triples: 4788 14:54:38.966 [main] DEBUG o.s.o.r.r.p.OptimisedListTranslator - list: ObjectPropertyAtom(http://www.semanticweb.org/michel/ontologies/2014/6/TwitterOntology#hashtagContainedInTweetRule Variable() Variable()) 14:54:38.967 [main] DEBUG o.s.o.r.r.p.OptimisedListTranslator - list: ObjectPropertyAtom(http://www.semanticweb.org/michel/ontologies/2014/6/TwitterOntology#posts Variable() Variable()) 14:54:38.967 [main] DEBUG o.s.o.r.r.p.OptimisedListTranslator - list: DataPropertyAtom()

14:54:40.316 [main] INFO c.c.o.e.BlackBoxExplanation - Initial axiom count: 50 14:54:40.319 [main] INFO c.c.o.e.BlackBoxExplanation - Expanding axioms (expansion 0) 14:54:40.320 [main] INFO c.c.o.e.BlackBoxExplanation - ... expanded by 62 14:54:40.321 [main] INFO c.c.o.e.BlackBoxExplanation - Expanding axioms (expansion 1) 14:54:40.322 [main] INFO c.c.o.e.BlackBoxExplanation - ... expanded by 77 14:54:40.324 [main] INFO c.c.o.e.BlackBoxExplanation - Expanding axioms (expansion 2) 14:54:40.324 [main] INFO c.c.o.e.BlackBoxExplanation - ... expanded by 96 14:54:40.328 [main] INFO c.c.o.e.BlackBoxExplanation - Expanding axioms (expansion 3) 14:54:40.328 [main] INFO c.c.o.e.BlackBoxExplanation - ... expanded by 120 14:54:40.333 [main] INFO c.c.o.e.BlackBoxExplanation - Expanding axioms (expansion 4) 14:54:40.334 [main] INFO c.c.o.e.BlackBoxExplanation - ... expanded by 150

If some of you could give me any hint I'd be really greatful.

Regards, Michel.

2 Answers2

0

Slf4j is the logging library in use, looks like you've got a very low log level.

Check if you have a simplelogger.properties file in your classpath, and set org.slf4j.simple logger.defaultLogLevel=error

Depending on existing settings, you might have to change some other local configuration.

Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • I tried to set the System property in eclipse: `-Dorg.slf4j.simple logger.defaultLogLevel=error` before running my main class but I got the same logs. – Mitch Souza Sep 25 '15 at 16:03
  • That would imply one of the libraries you're using is setting it to a different value. Try logLevel instead of defaultLogLevel. – Ignazio Sep 25 '15 at 16:24
  • There must be some other source for the log level being set to INFO. Can you check your classpath for property files, possibly included in jars, AMD make sure your property file is first in the classpath? – Ignazio Sep 30 '15 at 18:01
  • I don't have a property file for "log"... I just set the system properties in eclipse doing: -Dorg.slf4j.simpleLogger.logLevel=error -Dtwitter4j.loggerFactory=twitter4j.NullLoggerFactory . I'm using Twitter4j to extract tweets from Twitter so I needed to set the second property. "By default, Twitter4J prints log messages to standard output. If any of SLF4J, Commons-Logging, Log4J is in the classpath, log messages will be printed via the available logging library. You can disable logging by specifying -Dtwitter4j.loggerFactory=twitter4j.NullLoggerFactory to the system properties." – Mitch Souza Sep 30 '15 at 18:49
  • But it doesn't work.. I have a twitter4j.properties file where I set "debug=false" – Mitch Souza Sep 30 '15 at 18:51
0

I figured out how to solve my problem. I put the answer here in case any of you are facing the same:

I was using the slf4j-api-1.7.12.jar in my code. This jar needs the .class from "org.slf4j.impl.StaticLoggerBinder". I didn't notice that I had already put the following jar in my classpath: ch.qos.logback.classic-0.9.28.jar. This last one jar has "org.slf4j.impl.StaticLoggerBinder".class. But the problem is that it prints a huge amount of logging messages during runtime.

I solved the problem using another jar - slf4j-nop-1.7.12.jar - instead of - ch.qos.logback.classic-0.9.28.jar - that has the .class that I needed but prints no messages in runtime.

I hope I was clear.