org.topbraid.core
Class TB

java.lang.Object
  extended by org.topbraid.core.TB

public class TB
extends java.lang.Object

The singleton entry object into the TopBraid data structures. Any TopBraid application must call init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences) to connect to TopBraid.

Author:
Holger Knublauch

Field Summary
static java.lang.String TBC_VERSION
          The current TBC version (number with digits only)
 
Constructor Summary
TB()
           
 
Method Summary
static IFileRegistry getFileRegistry()
          Gets the global file registry.
static IGraphRegistry getGraphRegistry()
          Gets the global graph registry.
static IOntModelRegistry getOntModelRegistry()
          Gets the global OntModel registry, which maintains all currently open OntModels (for all sessions).
static org.eclipse.core.runtime.Preferences getPreferences()
          Gets the global Preferences object that is available to store global user options.
static ISession getSession()
          Gets the current session, using the associated ISessionProvider.
static ISessionProvider getSessionProvider()
          Gets the ISessionProvider that has been specified in the init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences) call.
static void init(ISessionProvider sessionProvider, IOntModelRegistry ontModelRegistry, org.eclipse.core.runtime.Preferences preferences)
          Initializes the TopBraid platform.
static void initFileRegistry(IFileRegistry fileRegistry)
           
static void initGraphRegistry(IGraphRegistry graphRegistry)
           
static boolean isInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TBC_VERSION

public static final java.lang.String TBC_VERSION
The current TBC version (number with digits only)

See Also:
Constant Field Values
Constructor Detail

TB

public TB()
Method Detail

getFileRegistry

public static IFileRegistry getFileRegistry()
Gets the global file registry. The file registry maintains a mapping of all known files together with their base URIs. This global singleton can be changed by applications using initFileRegistry(IFileRegistry) as long as the init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences) method has not been called. The default value is an instanceof of FileRegistry.

Returns:
the IFileRegistry
See Also:
initFileRegistry(org.topbraid.core.registry.IFileRegistry)

getGraphRegistry

public static IGraphRegistry getGraphRegistry()
Gets the global graph registry. The graph registry maintains all currently open Jena graphs, and associates them with their base URI and source. The default value is an instance of GraphRegistry

Returns:
the IGraphRegistry
See Also:
initGraphRegistry(org.topbraid.core.registry.IGraphRegistry)

getOntModelRegistry

public static IOntModelRegistry getOntModelRegistry()
Gets the global OntModel registry, which maintains all currently open OntModels (for all sessions). The initial value is defined in the init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences) method.

Returns:
the IOntModelRegistry
See Also:
init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences)

getPreferences

public static org.eclipse.core.runtime.Preferences getPreferences()
Gets the global Preferences object that is available to store global user options.

Returns:
the Preferences or null

getSession

public static ISession getSession()
Gets the current session, using the associated ISessionProvider.

Returns:
the ISession (never null)

getSessionProvider

public static ISessionProvider getSessionProvider()
Gets the ISessionProvider that has been specified in the init(org.topbraid.core.session.ISessionProvider, org.topbraid.core.registry.IOntModelRegistry, org.eclipse.core.runtime.Preferences) call.

Returns:
the session provider (not null)

init

public static void init(ISessionProvider sessionProvider,
                        IOntModelRegistry ontModelRegistry,
                        org.eclipse.core.runtime.Preferences preferences)
Initializes the TopBraid platform.

Parameters:
sessionProvider - an ISessionProvider
ontModelRegistry - an IOntModelRegistry
preferences - a Preferences object or null

initFileRegistry

public static void initFileRegistry(IFileRegistry fileRegistry)

initGraphRegistry

public static void initGraphRegistry(IGraphRegistry graphRegistry)

isInitialized

public static boolean isInitialized()