|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SSWAPModel
The most abstract interface in the SSWAP Java API. Represents any fragment
represented by the underlying RDF data (model). When created, a
SSWAPModel
may represent only the URI to a concept (e.g.,
a URI to a resource) rather than the actual RDF data stored at that URI.
Such a SSWAPModel
is called "not dereferenced" (i.e., its
isDereferenced()
method returns false). In order to actually
retrieve the data and populate the model, it is necessary to call the
dereference()
method. This is usually done automatically by the
API when it first uses a non-dereferenced model to satisfy a particular task.
For objects that are not dereferenced, the only available methods are
getURI()
, isDereferenced()
, and
dereference()
. All other methods should not be called (there is
no data for them yet), and in general, most of them will return null in such
a case.
It is possible for a SSWAP model to be already dereferenced when created.
This typically occurs when an underlying source has already been dereferenced
(e.g., a PDG
), and then a method to retrieve an object within
that source of data is called (e.g., getProvider()
to get
provider data that is already present within that PDG
).
Method Summary | |
---|---|
void |
addImport(java.net.URI uri)
Adds an import to the list of OWL imports of this model. |
boolean |
checkProfile(Expressivity expressivity)
Checks whether the model fits a particular expressivity profile (e.g., OWL2 DL) |
void |
dereference()
If the object is not dereferenced, it dereferences it. |
void |
dereference(java.io.InputStream is)
Dereferences the object (if it is not yet dereferenced) but it reads the data from the given stream, rather than trying to to retrieve the URI of this object. |
int |
doClosure()
For every URI in the model, do successive HTTP GETs and read in the model. |
SSWAPDocument |
getDocument()
Retrieves the document that contains this SSWAPModel |
java.util.Collection<java.lang.String> |
getImports()
Gets the list of OWL imports in this model (the top-level only). |
java.io.InputStream |
getInputStream()
Get input stream suitable for reading the serialized model. |
java.util.Map<java.lang.String,java.lang.String> |
getNsPrefixMap()
Gets the map of currently defined namespace prefixes. |
ReasoningService |
getReasoningService()
Gets the reasoning service associated with the underlying RDF data |
java.util.Collection<java.net.URI> |
getTypeSignature(java.net.URI type)
Get the terms that comprise the definition of a URI term. |
java.net.URI |
getURI()
Get the URI. |
boolean |
isDereferenced()
Returns whether this object represents a dereferenced content stored under the URI, or is it just the URI. |
void |
removeImport(java.net.URI uri)
Removes an import from the list of imports |
void |
removeNsPrefix(java.lang.String prefix)
Removes a namespace prefix. |
void |
serialize(java.io.OutputStream os)
Serializes the contents of this object to the specified stream as RDF/XML. |
void |
serialize(java.io.OutputStream os,
RDFRepresentation representation,
boolean commentedOutput)
Serializes the contents of this object to the specified stream. |
void |
setNsPrefix(java.lang.String prefix,
java.net.URI uri)
Sets a namespace prefix that will be used in serialization of this model. |
void |
validate()
Verifies whether the underlying RDF data conforms to SSWAP syntax and requirements. |
Method Detail |
---|
java.net.URI getURI()
boolean isDereferenced()
java.io.InputStream getInputStream()
void serialize(java.io.OutputStream os)
os
- output streamvoid serialize(java.io.OutputStream os, RDFRepresentation representation, boolean commentedOutput)
os
- output streamrepresentation
- the representation, in which the contents should be written (e.g., RDF/XML).commentedOutput
- true, if the output should contain comments about various standard sections of an RDG (valid only for
RDF/XML)void dereference() throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, DataAccessException
java.lang.IllegalStateException
- if the object has already been dereferenced.
java.lang.IllegalArgumentException
- if this object does not have an URI, or the URI does not form a valid URL
DataAccessException
- if an error occurred while trying to read the data (e.g., the data source is unavailable or it is impossible to parse)void dereference(java.io.InputStream is) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, DataAccessException
is
- the input stream from which the data should be read instead of establishing a network connection
java.lang.IllegalStateException
- if the object has already been dereferenced.
java.lang.IllegalArgumentException
- if this object does not have an URI, or the URI does not form a valid URL
DataAccessException
- if an error occurred while trying to read the data (e.g., the data source is unavailable or it is impossible to parse)int doClosure()
void validate() throws ValidationException
ValidationException
- if the data violates SSWAP syntax or requirementsboolean checkProfile(Expressivity expressivity)
expressivity
- expressivity profile
ReasoningService getReasoningService()
void setNsPrefix(java.lang.String prefix, java.net.URI uri)
prefix
- the prefixuri
- the corresponding URIvoid removeNsPrefix(java.lang.String prefix)
prefix
- the prefix to be removed.java.util.Map<java.lang.String,java.lang.String> getNsPrefixMap()
java.util.Collection<java.lang.String> getImports()
void addImport(java.net.URI uri)
uri
- the URI of the import to be addedvoid removeImport(java.net.URI uri)
uri
- the import to be removedSSWAPDocument getDocument()
java.util.Collection<java.net.URI> getTypeSignature(java.net.URI type)
type
- URI to a resource or subject of RDF statements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |