org.topbraidcomposer.core.models
Class Imports

java.lang.Object
  extended by org.topbraidcomposer.core.models.Imports

public class Imports
extends java.lang.Object

A collection of utility methods for handling owl:imports.

Author:
Holger Knublauch

Constructor Summary
Imports()
           
 
Method Summary
static void addImport(org.eclipse.core.resources.IFile file, org.eclipse.core.runtime.IProgressMonitor monitor)
          Adds an import from a local file to the currently selected model.
static void addImport(java.net.URI importedURI, org.eclipse.core.runtime.IProgressMonitor monitor)
          Adds an import from a URL to the currently selected model.
static java.util.Set<java.net.URI> getMissingImports(com.hp.hpl.jena.ontology.OntModel ontModel)
          Tries to "guess" missing imports to get completely typed models.
static void removeImport(java.net.URI importedURI, boolean removeUsages, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Imports

public Imports()
Method Detail

addImport

public static void addImport(org.eclipse.core.resources.IFile file,
                             org.eclipse.core.runtime.IProgressMonitor monitor)
                      throws java.lang.Exception
Adds an import from a local file to the currently selected model. The input file must be registered in the FileRegistry.

Parameters:
file - the file to import from
Throws:
java.lang.Exception

addImport

public static void addImport(java.net.URI importedURI,
                             org.eclipse.core.runtime.IProgressMonitor monitor)
                      throws java.lang.Exception
Adds an import from a URL to the currently selected model. The URL is derived from a URI, i.e. the provided URI must be identical with the physical location.

Parameters:
importedURI - the URI to import from
Throws:
java.lang.Exception

getMissingImports

public static java.util.Set<java.net.URI> getMissingImports(com.hp.hpl.jena.ontology.OntModel ontModel)
Tries to "guess" missing imports to get completely typed models. The method suggests the namespaces of those untyped resources that are used in "critical" triples, such as rdfs:subClassOf or as predicate in a triple. For example, if an ontology uses dublin core properties without importing the corresponding namespace, then the system would suggest to import the DC namespace.

Parameters:
ontModel - the OntModel to analyze
Returns:
a Set of URI objects (often empty)

removeImport

public static void removeImport(java.net.URI importedURI,
                                boolean removeUsages,
                                org.eclipse.core.runtime.IProgressMonitor monitor)