info.sswap.impl.empire.model
Class JenaModelFactory

java.lang.Object
  extended by info.sswap.impl.empire.model.JenaModelFactory

public class JenaModelFactory
extends java.lang.Object

A factory that reads and creates Jena models in this implementation. It ensures that all models are read and initialized in the same way.

Author:
Blazej Bulka

Nested Class Summary
private static class JenaModelFactory.ErrorHandler
          An internal error handler for errors encountered while parsing the model
 
Field Summary
private static JenaModelFactory instance
          A singleton instance
 
Constructor Summary
private JenaModelFactory()
           
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model createEmptyModel()
          Creates an empty model
static JenaModelFactory get()
          The getter for the singleton instance
 com.hp.hpl.jena.rdf.model.Model getModel(java.io.InputStream is)
          Gets a model read from an input stream
 com.hp.hpl.jena.rdf.model.Model getModel(java.io.InputStream is, java.lang.String format)
           
private  com.hp.hpl.jena.rdf.model.RDFReader getReader(com.hp.hpl.jena.rdf.model.Model m, java.lang.String format)
          Gets a reader for the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static JenaModelFactory instance
A singleton instance

Constructor Detail

JenaModelFactory

private JenaModelFactory()
Method Detail

get

public static JenaModelFactory get()
The getter for the singleton instance

Returns:
sole instance of the JenaModelFactory

getReader

private com.hp.hpl.jena.rdf.model.RDFReader getReader(com.hp.hpl.jena.rdf.model.Model m,
                                                      java.lang.String format)
Gets a reader for the model. For maximum performance, the reader is set to ignore redefinition of identifiers.

Parameters:
m - the model for which the reader should be created
Returns:
the reader

createEmptyModel

public com.hp.hpl.jena.rdf.model.Model createEmptyModel()
Creates an empty model

Returns:
the empty model

getModel

public com.hp.hpl.jena.rdf.model.Model getModel(java.io.InputStream is)
                                         throws DataAccessException
Gets a model read from an input stream

Parameters:
is - the input stream from which the model should be read
Returns:
the read model
Throws:
DataAccessException

getModel

public com.hp.hpl.jena.rdf.model.Model getModel(java.io.InputStream is,
                                                java.lang.String format)
                                         throws DataAccessException
Throws:
DataAccessException


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.