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)

Cameron

(non-dig): OutOfMemory on model.validate
=========================================
        String ont = "http://www.owl-ontologies.com/Capabilities.owl";
        String metaOnt = "http://www.co-
ode.org/ontologies/meta/2005/06/15/meta.owl";

        // 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,
                                        "file:./data/ontologies/Capabilities.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.co-
ode.org/ontologies/meta/2005/06/15/meta.owl",
    "file:./data/ontologies/meta.owl" );
    m.getDocumentManager().addAltEntry( "http://www.owl-
ontologies.com/Capabilities.owl",
    "file:./data/ontologies/Capabilities.owl" );
    m.read( "http://www.owl-ontologies.com/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 http://protege.stanford.edu/community/subscribe.html