org.topbraid.core.util
Class ModelUtil

java.lang.Object
  extended by org.topbraid.core.util.ModelUtil

public class ModelUtil
extends java.lang.Object

A collection of static utility methods dealing with Jena models and OntModels.

Author:
Holger Knublauch

Constructor Summary
ModelUtil()
           
 
Method Summary
static java.net.URI getBaseURI(com.hp.hpl.jena.rdf.model.Model model)
          Gets the base URI that is associated with a given Model (possibly an OntModel).
static java.util.List<com.hp.hpl.jena.rdf.model.Model> getRegularModels(com.hp.hpl.jena.ontology.OntModel ontModel)
          Gets all regular submodels of a given OntModel.
static java.util.List<com.hp.hpl.jena.graph.Graph> getRegularSubGraphs(com.hp.hpl.jena.ontology.OntModel ontModel)
           
static boolean isMemoryModel(com.hp.hpl.jena.rdf.model.Model model)
          Checks if a given Model (possibly an OntModel) only consists of in-memory models.
static java.util.Iterator listEditableModels()
           
static java.util.Iterator<com.hp.hpl.jena.rdf.model.Model> listRegularModels(com.hp.hpl.jena.ontology.OntModel ontModel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelUtil

public ModelUtil()
Method Detail

getBaseURI

public static java.net.URI getBaseURI(com.hp.hpl.jena.rdf.model.Model model)
Gets the base URI that is associated with a given Model (possibly an OntModel). If this is an OntModel, it will recurse with the base model of the OntModel, obtained using the static IOntModelRegistry.

Parameters:
model - a registered Model or OntModel
Returns:
the base URI or null if the model is not known

getRegularModels

public static java.util.List<com.hp.hpl.jena.rdf.model.Model> getRegularModels(com.hp.hpl.jena.ontology.OntModel ontModel)
Gets all regular submodels of a given OntModel.

Parameters:
ontModel - the OntModel
Returns:
a List of Models

getRegularSubGraphs

public static java.util.List<com.hp.hpl.jena.graph.Graph> getRegularSubGraphs(com.hp.hpl.jena.ontology.OntModel ontModel)

isMemoryModel

public static boolean isMemoryModel(com.hp.hpl.jena.rdf.model.Model model)
Checks if a given Model (possibly an OntModel) only consists of in-memory models. This can be used to estimate performance of certain operations, such as search so that they can be disabled.

Parameters:
model - a registered Model or OntModel
Returns:
true if every subgraph of model is a GraphMem

listEditableModels

public static java.util.Iterator listEditableModels()

listRegularModels

public static java.util.Iterator<com.hp.hpl.jena.rdf.model.Model> listRegularModels(com.hp.hpl.jena.ontology.OntModel ontModel)