Protege - Pellet - Jena 2 - OutOfMemory

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Protege - Pellet - Jena 2 - OutOfMemory

Cameron Claussen
Hey all -

I'm in need of some pointers on how to troubleshoot this problem.  I've
developed two OWL-DL ontologies using protege and the dig interface to pellet.  
They classify fine and the Inference action gives me what I would expect.

Now, I'm trying to use the Jena Ontology API to build my model and use the
Pellet reasoner to validate the model and/or print out the inconsistent
classes.  Because the protege ontologies use meta.owl, I add that to the
DocumentManager first.  Regardless of whether I use the pellet reasoner (non-
dig) interface or the pellet dig interface, the JVM with the pellet reasoner
throws OutOfMemory exceptions.

Do I need to design my ontology differently in Protege if I'm going to load it
using Jena?

Thanks for any pointers!  (Code below)


(non-dig): OutOfMemory on model.validate
        String ont = "";
        String metaOnt = "";

        // create an empty ontology model using Pellet spec
        OntModel model = ModelFactory.createOntologyModel(
PelletReasonerFactory.THE_SPEC );
        model.getDocumentManager().addAltEntry( metaOnt,
        "file:./data/ontologies/meta.owl" );
        model.getDocumentManager().addAltEntry( ont,
" );

        // read the file ont );
        // print validation report
        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );

(the DIGExample code):
  public static void main( String[] args ) {
    // set up a configuration resource to connect to the reasoner
    // on port 8081 on the local system
    Model cModel = ModelFactory.createDefaultModel();
    Resource conf = cModel.createResource();
    conf.addProperty( ReasonerVocabulary.EXT_REASONER_URL,
                      cModel.createResource( "http://localhost:8081" ) );
    // create the reasoner factory and the reasoner
    DIGReasonerFactory drf = (DIGReasonerFactory) ReasonerRegistry.theRegistry()
DIGReasonerFactory.URI );
    DIGReasoner r = (DIGReasoner) drf.create( conf );
    // now make a model
    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( r );
    OntModel m = ModelFactory.createOntologyModel( spec, null );
    // load an input document

    m.getDocumentManager().addAltEntry( "",
    "file:./data/ontologies/meta.owl" );
    m.getDocumentManager().addAltEntry( "http://www.owl-",
    "file:./data/ontologies/Capabilities.owl" ); "" );

    // list the inconsistent classes
    StmtIterator i = m.listStatements( null, OWL.equivalentClass, OWL.Nothing );
    while (i.hasNext()) {
        System.out.println( "Class " + i.nextStatement().getSubject() + " is
unsatisfiable" );

To unsubscribe go to