I repackaged the codes in the attachment, the last two packages lacks a
Globals.java file, so it can't run directly~~sorry~~

The followings are a detailed explanation about my problem, including some
code samples~:
1.
At first, I initialize an ontmodel as follows:
OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);

The second time, I initialize the model as follows:
m = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);

After read an .owl, I create a class and print it in its axiom form
        ObjectProperty prop = m
                .getObjectProperty(m.getNsPrefixURI("") + "part");
        OntClass owlThing = m.getOntClass(OWL.Thing.getURI());
        OntClass cls = m.createSomeValuesFromRestriction(null, prop,
                (null == prop.getRange()) ? owlThing : prop.getRange());
        String description = ConceptDescriptor
                .renderConceptAxiomDescription(cls);
        System.out.println(description);

For the first time, the output is as follows:
∃part.Thing
the second time, the output is:
Exception in thread "main" java.lang.StackOverflowError
    at
org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.node2term(DefaultGraphLoader.java:542)
    at
org.mindswap.pellet.jena.graph.query.GraphQueryHandler$19.contains(GraphQueryHandler.java:540)
    at
org.mindswap.pellet.jena.graph.query.GraphQueryHandler.containsTriple(GraphQueryHandler.java:1553)
    at
org.mindswap.pellet.jena.PelletInfGraph.containsTriple(PelletInfGraph.java:488)
    at
org.mindswap.pellet.jena.PelletInfGraph.graphBaseContains(PelletInfGraph.java:335)
    at com.hp.hpl.jena.graph.impl.GraphBase.contains(GraphBase.java:270)
    at com.hp.hpl.jena.graph.impl.GraphBase.contains(GraphBase.java:296)
    at
com.hp.hpl.jena.ontology.impl.OWLProfile$SupportsCheck.hasType(OWLProfile.java:277)
    at
com.hp.hpl.jena.ontology.impl.OWLProfile$3.doCheck(OWLProfile.java:331)
    at
com.hp.hpl.jena.ontology.impl.OWLProfile.isSupported(OWLProfile.java:199)
    at
com.hp.hpl.jena.ontology.impl.ComplementClassImpl$1.canWrap(ComplementClassImpl.java:78)
    at
com.hp.hpl.jena.ontology.impl.ComplementClassImpl$1.wrap(ComplementClassImpl.java:64)
    at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:142)
    at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:22)
    at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:54)
    at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:97)
2. The second problem is related to the following code:
StringBuffer str = new StringBuffer();
        System.err
                .println("\nUnicode Character is not displayed properly when
it follows immediately after more than 1 english characters");
        str.append("an");
        str.append("\u2293");
        System.err.println(str);
System.out.print("an");
System.out.println("\u2293");
System.out.println("\u2293");

when "\u2293" follows more than 1 English characters, it goes to a square,
but it is expected to be "⊓"~

2011/5/17 Dave Reynolds <[email protected]>

> Hi,
>
> On Tue, 2011-05-17 at 15:07 +0800, 朱曼 wrote:
> > Sorry for that~another tar package can be found from attachment~~
>
> There's no attachment :)
>
> Did you read my request to explain specifically what the problem is
> including showing the exception? Since I don't have Pellet I can't run
> the code.
>
> Dave
>
>
> > Thanks~
> >
> > Best
> >
> > June
> >
> > 2011/5/17 Dave Reynolds <[email protected]>
> >         Hi,
> >
> >         Sorry, I don't have a RAR decompression program around so
> >         haven't been
> >         able to look at the code.
> >
> >         On Tue, 2011-05-17 at 14:45 +0800, 朱曼 wrote:
> >         > Dear list,
> >         >
> >         > Hi~
> >         >
> >         > When I am using Jena and Pellet, I encounter two problems:
> >         >
> >         > The first problem is about the ConceptDescriptor Class I
> >         wrote which
> >         > describe classes in axiom form. But different ways of
> >         building
> >         > OntModel the outputs are different, in fact, the one using
> >         PELLET
> >         > throws exceptions. I am wondering why and how can I improve
> >         > ConceptDescriptor class?
> >
> >
> >         In asking questions like this it would be helpful to explain
> >         exactly
> >         where the exception is and in what way the outputs differ.
> >         Certainly the
> >         different reasoner options lead to different inferences which
> >         will
> >         result in different behaviour.
> >
> >         The more specific you can make your question, and the smaller
> >         and more
> >         specific you can make your code sample, then the easier it is
> >         for anyone
> >         to help.
> >
> >         In that way people like myself who don't have a copy of Pellet
> >         available
> >         might still be able to help.
> >
> >         Dave
> >
> >
> >
>
>
>

Reply via email to