ubiware.rdf2bean.core
Class Storage

java.lang.Object
  extended by ubiware.rdf2bean.core.Storage

public class Storage
extends java.lang.Object


Constructor Summary
Storage(java.util.Set<java.lang.String> op)
           
 
Method Summary
 void add(java.lang.String rdfString)
          Adds the given RDF string to the storage.
 void addResource(RDFResource res)
          Adds the given RDFResource object to the storage.
 void addResources(java.util.Collection<? extends RDFResource> resourcesToBeAdded)
          Adds the given collection of RDFResource objects to the storage.
static Storage createStorageWithoutObjectProperties()
           
 void debugMe()
           
 boolean existsResourceWithThisURI(java.lang.String uri)
           
<T extends RDFResource>
java.util.Set<T>
getAllResourcesOfThisType(java.lang.Class<T> cl)
           
<T extends RDFResource>
T
getResourceOfThisTypeWithThisURI(java.lang.String uri, java.lang.Class<T> cl)
           
 java.lang.String getStringRepresentation()
           
 void read(java.lang.String rdfString)
          Initializes the storage from given RDF string.
 void read2(java.lang.String rdfString)
           
<T extends RDFResource>
void
register(java.lang.Class<T> cl, java.lang.String resourceURI)
           
static java.lang.String sanitize(java.lang.String rdfString)
          Helper method to fix S-APL code which is not RDF complaint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Storage

public Storage(java.util.Set<java.lang.String> op)
Method Detail

sanitize

public static java.lang.String sanitize(java.lang.String rdfString)
Helper method to fix S-APL code which is not RDF complaint.

Parameters:
rdfString - the String to be sanitized
Returns:
the sanitized String

read

public void read(java.lang.String rdfString)
          throws org.openrdf.repository.RepositoryException,
                 org.openrdf.query.MalformedQueryException,
                 org.openrdf.query.QueryEvaluationException,
                 java.lang.IllegalArgumentException,
                 java.lang.InstantiationException,
                 java.lang.IllegalAccessException,
                 java.lang.reflect.InvocationTargetException
Initializes the storage from given RDF string.

Parameters:
rdfString - the RDF added to the storage
Throws:
org.openrdf.repository.RepositoryException
java.lang.IllegalArgumentException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

read2

public void read2(java.lang.String rdfString)
           throws StorageException
Throws:
StorageException

add

public void add(java.lang.String rdfString)
         throws org.openrdf.repository.RepositoryException,
                org.openrdf.query.MalformedQueryException,
                org.openrdf.query.QueryEvaluationException,
                java.lang.InstantiationException,
                java.lang.IllegalAccessException,
                java.lang.reflect.InvocationTargetException
Adds the given RDF string to the storage.

Parameters:
rdfString - the RDF added to the storage
Throws:
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

register

public <T extends RDFResource> void register(java.lang.Class<T> cl,
                                             java.lang.String resourceURI)

getAllResourcesOfThisType

public <T extends RDFResource> java.util.Set<T> getAllResourcesOfThisType(java.lang.Class<T> cl)

getResourceOfThisTypeWithThisURI

public <T extends RDFResource> T getResourceOfThisTypeWithThisURI(java.lang.String uri,
                                                                  java.lang.Class<T> cl)

getStringRepresentation

public java.lang.String getStringRepresentation()
                                         throws org.openrdf.query.QueryEvaluationException,
                                                org.openrdf.repository.RepositoryException,
                                                org.openrdf.query.MalformedQueryException
Throws:
org.openrdf.query.QueryEvaluationException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException

existsResourceWithThisURI

public boolean existsResourceWithThisURI(java.lang.String uri)

addResource

public void addResource(RDFResource res)
Adds the given RDFResource object to the storage.

Parameters:
res - to be added

addResources

public void addResources(java.util.Collection<? extends RDFResource> resourcesToBeAdded)
Adds the given collection of RDFResource objects to the storage.

Parameters:
resourcesToBeAdded - to be added

debugMe

public void debugMe()

createStorageWithoutObjectProperties

public static Storage createStorageWithoutObjectProperties()