|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.api.model.SSWAP
public class SSWAP
Main factory for the creation of SSWAP objects (most elements in the API are just interfaces).
Note about naming of the methods: all the create*()
methods
create objects without accessing the Internet or dereferencing URIs;
e.g., the createRDG
method creates a new Resource
Description Graph (RDG
) ready to be hosted on the web. All
get*()
methods attempt to dereference argument URIs as
appropriate and return objects that reflect the existing representation on
the web. For example, the getRDG
method attempts to return an
object that corresponds to an RDG
hosted at its URI. In case the
underlying data does not exist, the behavior of a get*()
method
depends on the specific method. Methods like getRDG
or
getPDG
will always return an object if possible (if
undereferenced and there is no underlying data a later
dereference()
will fail).
Most methods will throw a runtime DataAccessException
if the
requested class cannot be instantiated, for example due to an I/O or parsing
error. As in all Java, other runtime exceptions are possible. Common practice
is to catch all runtime exceptions in an outermost main program try/catch
block to handle unexpected runtime errors.
Lower-level objects are created by their super class, e.g., see
SSWAPDocument
.
SSWAPProtocol
,
SSWAPDocument
,
DataAccessException
Constructor Summary | |
---|---|
SSWAP()
|
Method Summary | ||
---|---|---|
static PDG |
createPDG(java.net.URI providerURI,
java.lang.String name,
java.lang.String oneLineDescription)
Creates a PDG with the specified values. |
|
static SSWAPProvider |
createProvider(java.net.URI providerURI)
Creates an object representing a SSWAPProvider. |
|
static RDG |
createRDG(java.net.URI resourceURI,
java.lang.String name,
java.lang.String oneLineDescription,
SSWAPProvider provider)
Creates a new RDG |
|
static RDG |
createRDG(java.net.URI resourceURI,
java.lang.String name,
java.lang.String oneLineDescription,
java.net.URI providerURI)
Creates a new RDG |
|
static SSWAPResource |
createResource(java.net.URI resourceURI)
Gets a SSWAPResource that is defined in the RDG that exists at the specified URI (the resource should have the same URI as the RDG). |
|
static RQG |
createRQG(java.net.URI resourceURI)
Creates a basic RQG from scratch. |
|
static SSWAPDocument |
createSSWAPDocument()
Creates an empty SSWAPDocument. |
|
static SSWAPDocument |
createSSWAPDocument(java.net.URI uri)
Creates an empty SSWAPModel. |
|
static Cache |
getCache()
Gets a cache used to store ontology terms that were retrieved from the network. |
|
static PDG |
getPDG(java.net.URI providerURI)
Creates an object representing an PDG. |
|
static RDG |
getRDG(java.net.URI uri)
Creates an object representing an RDG. |
|
static
|
getResourceGraph(java.io.InputStream is,
java.lang.Class<T> clazz)
Creates a SSWAPDocument graph from its serialization in an input stream. |
|
static
|
getResourceGraph(java.io.InputStream is,
java.lang.Class<T> clazz,
java.net.URI uri)
Creates a SSWAPDocument graph from its serialization in an input stream. |
|
static RQG |
getRQG(java.io.InputStream is)
Reads an RQG from an input stream. |
|
static VersionInformation |
getVersionInformation()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SSWAP()
Method Detail |
---|
public static RDG createRDG(java.net.URI resourceURI, java.lang.String name, java.lang.String oneLineDescription, java.net.URI providerURI) throws DataAccessException
resourceURI
- the URI of the SSWAPResource (and the RDG itself)name
- the name of the resourceoneLineDescription
- the one line description of the resourceproviderURI
- the URI of the provider
DataAccessException
- runtime error if the class cannot be createdpublic static RDG createRDG(java.net.URI resourceURI, java.lang.String name, java.lang.String oneLineDescription, SSWAPProvider provider) throws DataAccessException
resourceURI
- the URI of the SSWAPResource (and the RDG itself)name
- the name of the resourceoneLineDescription
- the one line description of the resourceprovider
- the SSWAPProvider for this RDG
DataAccessException
- runtime error if the class cannot be createdpublic static SSWAPResource createResource(java.net.URI resourceURI) throws DataAccessException
resourceURI
- the URI of the resource (and the containing RDG)
DataAccessException
- runtime error if the class cannot be createdpublic static RDG getRDG(java.net.URI uri) throws DataAccessException
uri
- the URI of the RDG
DataAccessException
- runtime error if the class cannot be createdpublic static RQG getRQG(java.io.InputStream is) throws DataAccessException
is
- the input stream containing the representation of the RQG
DataAccessException
- runtime error if the class cannot be created (e.g., I/O error or malformed data that cannot be parsed)public static RQG createRQG(java.net.URI resourceURI) throws DataAccessException
resourceURI
- the URI of the resource in the RQG; may be null for anonymous resources
DataAccessException
- runtime error if the class cannot be createdpublic static <T extends SSWAPDocument> T getResourceGraph(java.io.InputStream is, java.lang.Class<T> clazz) throws DataAccessException
SSWAPResource
will be a blank node. This is usually
inappropriate for anything other than a RQG
; for other
graphs see getResourceGraph(InputStream, Class, URI)
.
T
- the template parameter that specifies the type of
SSWAPDocument graph to be created (e.g., RQG).is
- the input stream from which the contents of the graph should
be readclazz
- the Java Class object that identifies the type of
SSWAPDocument graph (and provides the instantiation for the
template parameter; e.g., RQG.class)
DataAccessException
- runtime error if the class cannot be created (including I/O
error or malformed data that cannot be parsed)getResourceGraph(InputStream, Class, URI)
public static <T extends SSWAPDocument> T getResourceGraph(java.io.InputStream is, java.lang.Class<T> clazz, java.net.URI uri) throws DataAccessException
SSWAPResource
is set to the URI argument.
T
- the template parameter that specifies the type of
SSWAPDocument graph to be created (e.g.,
PDG, RDG, RIG, or RRG.
.- Parameters:
is
- the input stream from which the contents of the graph should
be readclazz
- the Java Class object that identifies the type of
SSWAPDocument graph (and provides the instantiation for the
template parameter; e.g., RDG.class, RIG.class, etc.)uri
- the URI to dereference to obtain the graph
- Returns:
- the created SSWAPDocument graph
- Throws:
DataAccessException
- runtime error if the class cannot be created (including I/O
error or malformed data that cannot be parsed)
public static PDG getPDG(java.net.URI providerURI) throws DataAccessException
providerURI
- the URI of the PDG
DataAccessException
- runtime error if the class cannot be createdpublic static PDG createPDG(java.net.URI providerURI, java.lang.String name, java.lang.String oneLineDescription) throws DataAccessException
providerURI
- the URI of the providername
- the name of the provideroneLineDescription
- a one-line description of the PDG
DataAccessException
- runtime error if the class cannot be createdpublic static SSWAPProvider createProvider(java.net.URI providerURI) throws DataAccessException
providerURI
- URI of the SSWAPProvider (and at the same time of the PDG for that SSWAPProvider)
DataAccessException
- runtime error if the class cannot be createdpublic static SSWAPDocument createSSWAPDocument() throws DataAccessException
DataAccessException
- runtime error if the class cannot be createdpublic static SSWAPDocument createSSWAPDocument(java.net.URI uri) throws DataAccessException
uri
- the URI of the SSWAP model
DataAccessException
- runtime error if the class cannot be createdpublic static VersionInformation getVersionInformation()
public static Cache getCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |