info.sswap.impl.empire.model
Interface SourceModel

All Superinterfaces:
SSWAPDocument, SSWAPModel
All Known Implementing Classes:
PDGImpl, ProtocolImpl, RDGImpl, RIGImpl, RQGImpl, RRGImpl, SourceModelImpl

public interface SourceModel
extends SSWAPDocument

Common interface for all SSWAP Models that have their own underlying Jena model.

Author:
Blazej Bulka

Method Summary
 void addDependentModel(ModelImpl dependentModel)
          Adds a dependent SSWAP Model to this source model (i.e., a SSWAP model that is created based on the information read from the Jena model)
 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 is in one of the expressivity profiles
 void dereference()
          Attempts to populate the model with data by retrieving it from the URI of the model.
 void dereference(java.io.InputStream is)
          Attempts to populate the model with data by retrieving it from the given stream.
 void dereference(com.hp.hpl.jena.rdf.model.Model model)
          Attempts to populate the model with data retrieved from the given Jena model.
 int doClosure()
          For every URI in the model, do an HTTP GET and read in the model.
 com.hp.hpl.jena.rdf.model.Model getClosedWorldModel()
          Gets the model that is used to close the worlds for specific parts of this model (but the statements from the closed world model should not "pollute" the main model).
 com.hp.hpl.jena.rdf.model.Model getClosureModel()
          Gets the Jena model containing the closure.
 SSWAPModel getDependentModel(java.net.URI uri)
          Returns the dependent model, identified by its URI, for this source model
 java.util.Collection<SSWAPModel> getDependentModels(java.net.URI uri)
          Returns all dependent models with the specified uri
 javax.persistence.EntityManager getEntityManager()
          Gets the Empire Entity manager that manages objects created based on the information from that Jena model
 java.util.Collection<java.lang.String> getImports()
          Gets the list of OWL imports in this model (the top-level only).
 com.hp.hpl.jena.rdf.model.Model getModel()
          Gets the underlying Jena 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 model.
 boolean isClosureEnabled()
          Returns information whether this source model will perform the closure to deliver terms to its reasoning service
 boolean isDereferenced()
          Returns information whether the source model is dereferenced (i.e., was populated with data).
 boolean isValueValidationEnabled()
          Returns information whether this source model performs validation of values for properties.
 void removeDependentModel(ModelImpl dependentModel)
          Removes a dependent SSWAP model from this source model
 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 setClosureEnabled(boolean enabled)
          Sets flag whether this source model will perform the closure to deliver terms to its reasoning service, or whether the reasoning service should solely rely on terms in this source model.
 void setEntityManager(javax.persistence.EntityManager entityManager)
          Sets the Empire Entity manager that manages objects created based on the information from that Jena model.
 void setMaxClosureBytes(long maxClosureBytes)
          Sets a model-specific byte limit for retrieving closure for this source model, or restores the system-wide limit.
 void setMaxClosureThreads(int maxClosureThreads)
          Sets a model-specific concurrent thread limit for retrieving closure for this source model, or restores the system-wide limit.
 void setMaxClosureTime(long maxClosureTime)
          Sets a model-specific time limit for retrieving closure for this source model, or restores the system-wide limit.
 void setModel(com.hp.hpl.jena.rdf.model.Model model)
          Replaces the underlying Jena model with another one.
 void setNsPrefix(java.lang.String prefix, java.net.URI uri)
          Sets a namespace prefix that will be used in serialization of this model.
 void setValueValidationEnabled(boolean validationEnabled)
          Turns on or off validation of values for properties in this model (i.e., values set via SSWAPIndividual.addProperty() and SSWAPIndividual.setProperty() methods)
 
Methods inherited from interface info.sswap.api.model.SSWAPDocument
createAnonymousDatatype, createAnonymousType, createIndividual, createIndividual, createIntersectionOf, createList, createLiteral, createTypedLiteral, createUnionOf, getDatatype, getPredicate, getType, newIndividual, newIndividual
 
Methods inherited from interface info.sswap.api.model.SSWAPModel
getDocument, getInputStream, getTypeSignature, getURI, validate
 

Method Detail

getModel

com.hp.hpl.jena.rdf.model.Model getModel()
Gets the underlying Jena model.

Returns:
the underlying Jena model.

getClosureModel

com.hp.hpl.jena.rdf.model.Model getClosureModel()
Gets the Jena model containing the closure. If the closure is not available, it will be computed.

Returns:
the closure

getClosedWorldModel

com.hp.hpl.jena.rdf.model.Model getClosedWorldModel()
Gets the model that is used to close the worlds for specific parts of this model (but the statements from the closed world model should not "pollute" the main model).

Returns:
the model where statements for closing the world are stored

setModel

void setModel(com.hp.hpl.jena.rdf.model.Model model)
Replaces the underlying Jena model with another one.

Parameters:
model - the new model.

getEntityManager

javax.persistence.EntityManager getEntityManager()
Gets the Empire Entity manager that manages objects created based on the information from that Jena model

Returns:
the Empire Entity manager

setEntityManager

void setEntityManager(javax.persistence.EntityManager entityManager)
Sets the Empire Entity manager that manages objects created based on the information from that Jena model.

Parameters:
entityManager - the Empire entity manager for the Jena model

addDependentModel

void addDependentModel(ModelImpl dependentModel)
Adds a dependent SSWAP Model to this source model (i.e., a SSWAP model that is created based on the information read from the Jena model)

Parameters:
dependentModel - the dependent model

removeDependentModel

void removeDependentModel(ModelImpl dependentModel)
Removes a dependent SSWAP model from this source model

Parameters:
dependentModel - the dependent model to be removed

isDereferenced

boolean isDereferenced()
Returns information whether the source model is dereferenced (i.e., was populated with data).

Specified by:
isDereferenced in interface SSWAPModel
Returns:
true if the model is dereferenced

dereference

void dereference()
Attempts to populate the model with data by retrieving it from the URI of the model.

Specified by:
dereference in interface SSWAPModel

dereference

void dereference(java.io.InputStream is)
Attempts to populate the model with data by retrieving it from the given stream.

Specified by:
dereference in interface SSWAPModel
Parameters:
is - the input stream to read the model contents

dereference

void dereference(com.hp.hpl.jena.rdf.model.Model model)
Attempts to populate the model with data retrieved from the given Jena model.

Parameters:
model - the Jena model that contains the data

getReasoningService

ReasoningService getReasoningService()
Gets the reasoning service associated with the model. (In this implementation, there is only one reasoning service object for each SourceModel; all dependent models for that SourceModel share that reasoning service).

Specified by:
getReasoningService in interface SSWAPModel
Returns:
the reasoning service for the model.

doClosure

int doClosure()
For every URI in the model, do an HTTP GET and read in the model. Assume RDF/XML. Iterate to 'degree' depth on new URIs thus read in. Closure obeys rules of self-definition. Returns the highest level of closure achieved.

Specified by:
doClosure in interface SSWAPModel
Returns:
highest (deepest) level of closure performed

serialize

void serialize(java.io.OutputStream os)
Serializes the contents of this object to the specified stream as RDF/XML.

Specified by:
serialize in interface SSWAPModel
Parameters:
os - output stream

serialize

void serialize(java.io.OutputStream os,
               RDFRepresentation representation,
               boolean commentedOutput)
Serializes the contents of this object to the specified stream.

Specified by:
serialize in interface SSWAPModel
Parameters:
os - output stream
representation - 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)

setNsPrefix

void setNsPrefix(java.lang.String prefix,
                 java.net.URI uri)
Sets a namespace prefix that will be used in serialization of this model.

Specified by:
setNsPrefix in interface SSWAPModel
Parameters:
prefix - the prefix
uri - the corresponding URI

removeNsPrefix

void removeNsPrefix(java.lang.String prefix)
Removes a namespace prefix. (The prefixes are used in serialization of this model.)

Specified by:
removeNsPrefix in interface SSWAPModel
Parameters:
prefix - the prefix to be removed.

getNsPrefixMap

java.util.Map<java.lang.String,java.lang.String> getNsPrefixMap()
Gets the map of currently defined namespace prefixes. (These prefixes are used in serialization of this model.)

Specified by:
getNsPrefixMap in interface SSWAPModel
Returns:
the map mapping prefixes to corresponding URIs

getImports

java.util.Collection<java.lang.String> getImports()
Gets the list of OWL imports in this model (the top-level only).

Specified by:
getImports in interface SSWAPModel
Returns:
a collection of uris of the imports

addImport

void addImport(java.net.URI uri)
Adds an import to the list of OWL imports of this model. Adding a URI to the list of imports does not trigger the import itself (use doClosure()) for that purpose.

Specified by:
addImport in interface SSWAPModel
Parameters:
uri - the URI of the import to be added

removeImport

void removeImport(java.net.URI uri)
Removes an import from the list of imports

Specified by:
removeImport in interface SSWAPModel
Parameters:
uri - the import to be removed

getDependentModel

SSWAPModel getDependentModel(java.net.URI uri)
Returns the dependent model, identified by its URI, for this source model

Parameters:
uri -
Returns:
the dependent model

getDependentModels

java.util.Collection<SSWAPModel> getDependentModels(java.net.URI uri)
Returns all dependent models with the specified uri

Parameters:
uri - the uri
Returns:
collection of dependent models

checkProfile

boolean checkProfile(Expressivity expressivity)
Checks whether the model is in one of the expressivity profiles

Specified by:
checkProfile in interface SSWAPModel
Parameters:
expressivity - the expressivity to be checked
Returns:
true if the model is in the given expressivity profile

setMaxClosureBytes

void setMaxClosureBytes(long maxClosureBytes)
Sets a model-specific byte limit for retrieving closure for this source model, or restores the system-wide limit. Note: if closure has been computed for this model, calling this method has no effect

Parameters:
maxClosureBytes - the new model-specific byte limit for closure for this model, or -1 to restore the system-wide limit

setMaxClosureTime

void setMaxClosureTime(long maxClosureTime)
Sets a model-specific time limit for retrieving closure for this source model, or restores the system-wide limit. Note: if closure has been computed for this model, calling this method has no effect

Parameters:
maxClosureTime - the new model-specific time limit (in ms) for closure for this model, or -1 to restore the system-wide limit

setMaxClosureThreads

void setMaxClosureThreads(int maxClosureThreads)
Sets a model-specific concurrent thread limit for retrieving closure for this source model, or restores the system-wide limit. Note: if closure has been computed for this model, calling this method has no effect

Parameters:
maxClosureThreads - the new model-specific concurrent thread limit for closure for this model, or -1 to restore the system-wide limit

isValueValidationEnabled

boolean isValueValidationEnabled()
Returns information whether this source model performs validation of values for properties.

Returns:
true if the validation for the values is enabled.

setValueValidationEnabled

void setValueValidationEnabled(boolean validationEnabled)
Turns on or off validation of values for properties in this model (i.e., values set via SSWAPIndividual.addProperty() and SSWAPIndividual.setProperty() methods)

Parameters:
validationEnabled - true if the values should be validated, false if the validation should be turned off

isClosureEnabled

boolean isClosureEnabled()
Returns information whether this source model will perform the closure to deliver terms to its reasoning service

Returns:
true, if the source model will perform closure, false otherwise

setClosureEnabled

void setClosureEnabled(boolean enabled)
Sets flag whether this source model will perform the closure to deliver terms to its reasoning service, or whether the reasoning service should solely rely on terms in this source model. Changing this flag has only effect if the reasoning service has not yet been initialized.

Parameters:
enabled -


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