SMILA (incubation) API documentation

org.eclipse.smila.ontology.internal
Class SesameOntologyAgent

java.lang.Object
  extended by org.eclipse.smila.ontology.internal.SesameOntologyAgent
All Implemented Interfaces:
ManagementAgent

public class SesameOntologyAgent
extends java.lang.Object
implements ManagementAgent

Management agent for the Sesame Ontology service. Use to import/export RDF files into repositories, clear repositories or get statistical information about repositories.

Author:
jschumacher

Constructor Summary
SesameOntologyAgent(SesameOntologyManager ontology)
          create instance.
 
Method Summary
 java.lang.String clear(java.lang.String repositoryName)
          clear repository.
 java.lang.String exportRDF(java.lang.String repositoryName, java.lang.String filename)
          export ontology contents as RDF file.
 java.util.List<java.lang.String> getContexts(java.lang.String repositoryName)
          get context IDs of repository.
 java.util.Map<java.lang.String,java.lang.String> getNamespaces(java.lang.String repositoryName)
          get namespaces defined in repository.
 java.util.List<java.lang.String> getRepositoryNames()
           
 long getSize(java.lang.String repositoryName)
          get number of statements in repository.
 java.lang.String importRDF(java.lang.String repositoryName, java.lang.String filename, java.lang.String baseUri)
          import RDF file into repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SesameOntologyAgent

public SesameOntologyAgent(SesameOntologyManager ontology)
create instance.

Parameters:
ontology - managed ontology manager.
Method Detail

getRepositoryNames

public java.util.List<java.lang.String> getRepositoryNames()
Returns:
names of configured repositories.

getSize

public long getSize(java.lang.String repositoryName)
get number of statements in repository.

Parameters:
repositoryName - name of repository.
Returns:
number of statements in repository, or -1 if no repository with this name exists

getContexts

public java.util.List<java.lang.String> getContexts(java.lang.String repositoryName)
get context IDs of repository.

Parameters:
repositoryName - name of repository.
Returns:
context names in repository, of an empty list if no contexts are defined.

getNamespaces

public java.util.Map<java.lang.String,java.lang.String> getNamespaces(java.lang.String repositoryName)
get namespaces defined in repository.

Parameters:
repositoryName - name of repository.
Returns:
map of namespace prefixes to URIs, of an empty map if no contexts are defined.

clear

public java.lang.String clear(java.lang.String repositoryName)
clear repository. This removes all statements. Other data (namespaces etc.) may remain.

Parameters:
repositoryName - name of repository.
Returns:
message to display.

importRDF

public java.lang.String importRDF(java.lang.String repositoryName,
                                  java.lang.String filename,
                                  java.lang.String baseUri)
import RDF file into repository.

Parameters:
repositoryName - name of repository
filename - path to RDF file. Must be absolute or relative to working directory of SMILA runtime.
baseUri - base URI of ontology (default namespace), used to resolve relative URIs in RDF file. Should always be specified, or unexptected results may occur.
Returns:
message to display.

exportRDF

public java.lang.String exportRDF(java.lang.String repositoryName,
                                  java.lang.String filename)
export ontology contents as RDF file.

Parameters:
repositoryName - name of repository
filename - path to RDF file. Must be absolute or relative to working directory of SMILA runtime.
Returns:
message to display.

SMILA (incubation) API documentation