Gilles Habran created JENA-1337:
-----------------------------------

             Summary: Trying to write an infered model to a String or a file 
never ends
                 Key: JENA-1337
                 URL: https://issues.apache.org/jira/browse/JENA-1337
             Project: Apache Jena
          Issue Type: Bug
    Affects Versions: Jena 3.2.0, Jena 3.1.1
            Reporter: Gilles Habran


Good morning,

I am trying to print an infered model but it never ends.

The ontologies I am using are huge and can be found here : 
http://publications.europa.eu/mdr/cdm/index.html

I tried with an OWL Reasoner or a Micro OWL Reasoner.

I created a small project with a Main class, a model and the ontologies here to 
show the problem : https://gitlab.com/gillouche/jena-perf

The thread dump shows that kind of stacktrace:

{code:java}
"main" #1 prio=5 os_prio=0 tid=0x00007f22f403f000 nid=0x3330 runnable 
[0x00007f22fbc92000]
   java.lang.Thread.State: RUNNABLE
        at java.util.LinkedList.remove(LinkedList.java:364)
        at 
org.apache.jena.reasoner.rulesys.impl.LPBRuleEngine.detach(LPBRuleEngine.java:233)
        - locked <0x00000005cfe72990> (a 
org.apache.jena.reasoner.rulesys.impl.LPBRuleEngine)
        at 
org.apache.jena.reasoner.rulesys.impl.LPInterpreter.close(LPInterpreter.java:168)
        at 
org.apache.jena.reasoner.rulesys.impl.Generator.setComplete(Generator.java:160)
        at 
org.apache.jena.reasoner.rulesys.impl.Generator.postCompletionCheckScan(Generator.java:371)
        at 
org.apache.jena.reasoner.rulesys.impl.Generator.checkForCompletions(Generator.java:313)
        at 
org.apache.jena.reasoner.rulesys.impl.LPBRuleEngine.pump(LPBRuleEngine.java:364)
        at 
org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.moveForward(LPTopGoalIterator.java:107)
        - locked <0x00000005d58aa060> (a 
org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator)
        - locked <0x00000005cfe72990> (a 
org.apache.jena.reasoner.rulesys.impl.LPBRuleEngine)
        at 
org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.hasNext(LPTopGoalIterator.java:223)
        at 
org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
        at 
org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
        at 
org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
        at 
org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
        at 
org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
        at 
org.apache.jena.util.iterator.Map1Iterator.hasNext(Map1Iterator.java:49)
        at 
org.apache.jena.util.iterator.NiceIterator.asSet(NiceIterator.java:208)
        at 
org.apache.jena.util.iterator.NiceIterator.toSet(NiceIterator.java:199)
        at org.apache.jena.graph.GraphUtil.listSubjects(GraphUtil.java:50)
        at 
org.apache.jena.riot.writer.RDFJSONWriter.output(RDFJSONWriter.java:76)
        at 
org.apache.jena.riot.writer.RDFJSONWriter.output(RDFJSONWriter.java:51)
        at 
org.apache.jena.riot.writer.RDFJSONWriter.write(RDFJSONWriter.java:63)
        at 
org.apache.jena.riot.adapters.RDFWriterRIOT.write(RDFWriterRIOT.java:74)
        at org.apache.jena.rdf.model.impl.ModelCom.write(ModelCom.java:358)
        at Main.main(Main.java:72)
{code}

In a Java Mission Control, the LinkedList.remove() hot methods take 80%.

If I don't infer the model, I can print it without any problem.

Note : I have another project using SHACL to validate an infered model against 
shapes. A simple model can be validated with SHACL but an infered model cannot 
be. The stacktrace of the thread dumps block with the same code 
(LPInterpreter.close() then LinkedList.remove()).

Would you have any idea what's happening? 

Thank you.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to