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 D Claussen

Hey all -

Apologies if this is a duplicate...

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 (developed using protege) and/or print out the inconsistent classes.   Regardless of whether I use the pellet reasoner (non-dig) interface or the pellet dig interface, the JVM with the pellet reasoner throws an OutOfMemory exception.

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)

Cameron

(non-dig): OutOfMemory on model.validate
=========================================

        String ont = "http://www.owl-ontologies.com/TestCapabilities.owl";

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

       
        // read the file
        model.read( 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()
                                                                  .getFactory( 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( "http://www.owl-ontologies.com/TestCapabilities.owl",
    "file:./data/ontologies/TestCapabilities.owl" );
    m.read( "http://www.owl-ontologies.com/TestCapabilities.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" );
    }

Cameron Claussen