org.topbraid.core.registry
Interface IOntModelRegistry

All Known Implementing Classes:
TBCOntModelRegistry

public interface IOntModelRegistry

A global singleton managing all OntModels in the system. In a multi-user setting, this includes all user's OntModels.

Author:
Holger Knublauch

Method Summary
 com.hp.hpl.jena.rdf.model.Model getBaseModel(com.hp.hpl.jena.ontology.OntModel ontModel)
          Gets the base model of a given OntModel.
 com.hp.hpl.jena.rdf.model.Model getInferenceModel(com.hp.hpl.jena.ontology.OntModel ontModel)
           
 com.hp.hpl.jena.ontology.OntModel getOrLoadOntModel(java.net.URI baseURI)
          Gets an existing OntModel with a given base URI.
 com.hp.hpl.jena.rdf.model.Model getSystemModel(com.hp.hpl.jena.ontology.OntModel ontModel)
           
 java.util.Iterator<com.hp.hpl.jena.ontology.OntModel> listOntModels()
          Lists all available OntModels (for all sessions).
 java.util.Iterator<com.hp.hpl.jena.ontology.OntModel> listOntModels(com.hp.hpl.jena.graph.Graph graph)
           
 

Method Detail

getBaseModel

com.hp.hpl.jena.rdf.model.Model getBaseModel(com.hp.hpl.jena.ontology.OntModel ontModel)
Gets the base model of a given OntModel. The OntModel must be know to the registry. This method is preferred over OntModel.getBaseModel() which had a bug in Jena 3.1, and is furthermore inefficient as it creates a new model on each call.

Parameters:
ontModel -
Returns:

getInferenceModel

com.hp.hpl.jena.rdf.model.Model getInferenceModel(com.hp.hpl.jena.ontology.OntModel ontModel)

getOrLoadOntModel

com.hp.hpl.jena.ontology.OntModel getOrLoadOntModel(java.net.URI baseURI)
                                                    throws java.lang.Exception
Gets an existing OntModel with a given base URI. If the model does not exist yet, it will create it on demand.

Parameters:
baseURI - the base URI - must be registered in the workspace
Returns:
the existing or new OntModel
Throws:
java.lang.Exception - on load errors

getSystemModel

com.hp.hpl.jena.rdf.model.Model getSystemModel(com.hp.hpl.jena.ontology.OntModel ontModel)

listOntModels

java.util.Iterator<com.hp.hpl.jena.ontology.OntModel> listOntModels()
Lists all available OntModels (for all sessions).

Returns:
an Iterator of OntModels

listOntModels

java.util.Iterator<com.hp.hpl.jena.ontology.OntModel> listOntModels(com.hp.hpl.jena.graph.Graph graph)