info.sswap.impl.empire.model
Class ProviderImpl

java.lang.Object
  extended by info.sswap.impl.empire.model.ModelImpl
      extended by info.sswap.impl.empire.model.ElementImpl
          extended by info.sswap.impl.empire.model.IndividualImpl
              extended by info.sswap.impl.empire.model.NodeImpl
                  extended by info.sswap.impl.empire.model.EmpireGeneratedNodeImpl
                      extended by info.sswap.impl.empire.model.ProviderImpl
All Implemented Interfaces:
com.clarkparsia.empire.SupportsRdfId, SSWAPElement, SSWAPIndividual, SSWAPModel, SSWAPNode, SSWAPProvider

public abstract class ProviderImpl
extends EmpireGeneratedNodeImpl
implements SSWAPProvider

Record describing a Provider in SSWAP. This object is created based on the data read from the underlying semantic web data. In general, if the information is missing from that graph, the corresponding method will return null reference.

Author:
Blazej Bulka

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.clarkparsia.empire.SupportsRdfId
com.clarkparsia.empire.SupportsRdfId.BNodeKey, com.clarkparsia.empire.SupportsRdfId.RdfKey<T>, com.clarkparsia.empire.SupportsRdfId.URIKey
 
Constructor Summary
ProviderImpl()
           
 
Method Summary
 void addProvidesResource(SSWAPResource resource)
          Adds a resource that is provided by this provider to the list.
(package private)  boolean belongsToProvidersDomain(java.net.URI uri)
          Checks whether the following URI (usually a Resource URI) belongs to this provider's "security domain"; that is, whether the resource is assumed to be provided by this provider just because of its URI and not because it is listed explicitly in the PDG.
 void dereference()
          Dereferences this node, by first calling dereference() on the source model (if there is one; in case there is no source model, this method immediately returns).
abstract  java.net.URI getAboutURI()
          Gets the URI pointing to a human-readable description of this provider.
abstract  java.net.URI getMetadata()
          Gets the URI containing the machine-readable metadata for this provider.
abstract  java.lang.String getName()
          Gets the name of the provider.
abstract  java.lang.String getOneLineDescription()
          Gets one line description of the provider.
 PDG getPDG()
          Gets the PDG that defines this provider
abstract  java.util.List<ResourceImpl> getProvidesResourceList()
          Empire-generated method that returns a list of implementations for SSWAPResource connected to this PDG by sswap:providesResource predicate.
 java.util.Collection<SSWAPResource> getProvidesResources()
          Gets the information about all the resources provided by this provider.
abstract  void setAboutURI(java.net.URI aboutURI)
          Sets the URI pointing to a human-readable description of this provider.
abstract  void setMetadata(java.net.URI metadata)
          Sets the URI pointing to the machine-readable metadata for this provider.
abstract  void setName(java.lang.String name)
          Sets the name of the provider.
abstract  void setOneLineDescription(java.lang.String oneLineDescription)
          Sets one line description of the provider.
 void setProvidesResource(java.util.Collection<SSWAPResource> resources)
          Sets the information about all the resources provided by this provider.
abstract  void setProvidesResourceList(java.util.List<ResourceImpl> providesResourceData)
          Empire-generated method for setting a list of implementations of SSWAPResource that will be connected to this PDG by sswap:providesResource predicate.
 void validate()
          Verifies whether the underlying RDF data conforms to SSWAP syntax and requirements.
 
Methods inherited from class info.sswap.impl.empire.model.EmpireGeneratedNodeImpl
ensureProperView, ensureProperView, isEmpireGenerated, listFromImpl, listToImpl, persist, refresh, setSourceModel, toListImpl
 
Methods inherited from class info.sswap.impl.empire.model.NodeImpl
asSSWAPGraph, asSSWAPObject, asSSWAPProvider, asSSWAPResource, asSSWAPSubject, getID, isDereferenced, isSSWAPGraph, isSSWAPObject, isSSWAPProvider, isSSWAPResource, isSSWAPSubject
 
Methods inherited from class info.sswap.impl.empire.model.IndividualImpl
addComment, addIgnoredProperty, addIgnoredType, addLabel, addProperty, addProperty, addProperty, addProperty, addProperty, addType, asIndividual, assertType, clearProperty, clearProperty, closeWorld, equals, getDeclaredType, getDeclaredTypes, getIgnoredProperties, getIgnoredTypes, getInferredIndividual, getProperties, getProperties, getProperty, getType, getTypes, hashCode, hasValue, hasValue, isCompatibleWith, isIndividual, isOfType, removeProperty, removeProperty, removeType, setDefaultParameterValues, setProperty, setProperty, setProperty, setProperty, setProperty, setSourceModel
 
Methods inherited from class info.sswap.impl.empire.model.ElementImpl
asBoolean, asDouble, asInteger, asList, asLiteral, asString, getComment, getJenaResource, getLabel, isAnonymous, isList, isLiteral
 
Methods inherited from class info.sswap.impl.empire.model.ModelImpl
addImport, assertModel, assertSourceModel, checkProfile, dereference, doClosure, getAllDependentObjects, getDependentObject, getDocument, getExpressivity, getImports, getInputStream, getNsPrefixMap, getReasoningService, getSourceModel, getTypeSignature, getURI, hasSourceModel, hasSourceModelWithEntityManager, rdfIdEquals, rdfIdHashCode, refreshSiblings, removeImport, removeNsPrefix, serialize, serialize, setDereferenced, setNsPrefix, setURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.sswap.api.model.SSWAPNode
asSSWAPGraph, asSSWAPObject, asSSWAPProvider, asSSWAPResource, asSSWAPSubject, getID, isSSWAPGraph, isSSWAPObject, isSSWAPProvider, isSSWAPResource, isSSWAPSubject
 
Methods inherited from interface info.sswap.api.model.SSWAPIndividual
addProperty, addProperty, addProperty, addProperty, addType, clearProperty, getDeclaredType, getDeclaredTypes, getInferredIndividual, getProperties, getProperties, getProperty, getType, getTypes, hasValue, hasValue, isAnonymous, isCompatibleWith, isOfType, removeProperty, removeProperty, removeType, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from interface info.sswap.api.model.SSWAPElement
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getLabel, isIndividual, isList, isLiteral
 
Methods inherited from interface info.sswap.api.model.SSWAPModel
addImport, checkProfile, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, getURI, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix
 
Methods inherited from interface com.clarkparsia.empire.SupportsRdfId
getRdfId, setRdfId
 

Constructor Detail

ProviderImpl

public ProviderImpl()
Method Detail

dereference

public void dereference()
                 throws DataAccessException
Description copied from class: NodeImpl
Dereferences this node, by first calling dereference() on the source model (if there is one; in case there is no source model, this method immediately returns). In case, this node is empire-generated, it also forces Empire to refresh/populate the object with the data read from the source model.

Specified by:
dereference in interface SSWAPModel
Overrides:
dereference in class NodeImpl
Throws:
DataAccessException - when trying to access the underlying data source while dereferencing

getName

public abstract java.lang.String getName()
Gets the name of the provider. A valid description of the provider must include the information about the name. (The invalid graphs that do not provide information about the provider, will cause this method to return null.)

Specified by:
getName in interface SSWAPProvider
Returns:
name of the provider (or null for invalid graphs)

setName

public abstract void setName(java.lang.String name)
Sets the name of the provider. A valid name of the provider must not be null.

Specified by:
setName in interface SSWAPProvider
Parameters:
name - the name of the provider (must not be null).

getOneLineDescription

public abstract java.lang.String getOneLineDescription()
Gets one line description of the provider.

Specified by:
getOneLineDescription in interface SSWAPProvider
Returns:
one line description of the provider (or null if not available).

setOneLineDescription

public abstract void setOneLineDescription(java.lang.String oneLineDescription)
Sets one line description of the provider.

Specified by:
setOneLineDescription in interface SSWAPProvider
Parameters:
oneLineDescription - the new one line description of the provider, or null if the current description is to be removed.

getAboutURI

public abstract java.net.URI getAboutURI()
Gets the URI pointing to a human-readable description of this provider. This URI should be dereferenceable if not null.

Specified by:
getAboutURI in interface SSWAPProvider
Returns:
URI pointing to a human-readable description, or null if there is no such description for the provider.

setAboutURI

public abstract void setAboutURI(java.net.URI aboutURI)
Sets the URI pointing to a human-readable description of this provider. This URI should be dereferenceable or null.

Specified by:
setAboutURI in interface SSWAPProvider
Parameters:
aboutURI - URI pointing to a human-readable description of this provider, or null if there is no such description for the provider.

getMetadata

public abstract java.net.URI getMetadata()
Gets the URI containing the machine-readable metadata for this provider. This URI should be dereferenceable or null.

Specified by:
getMetadata in interface SSWAPProvider
Returns:
URI pointing to a machine-readable metadata for this provider, or null if there is no metadata for this provider.

setMetadata

public abstract void setMetadata(java.net.URI metadata)
Sets the URI pointing to the machine-readable metadata for this provider. This URI should be dereferenceable or null.

Specified by:
setMetadata in interface SSWAPProvider
Parameters:
metadata - URI pointing to a machine-readable metadata for this provider, or null if there is no metadata for this provider.

addProvidesResource

public void addProvidesResource(SSWAPResource resource)
Adds a resource that is provided by this provider to the list.

Specified by:
addProvidesResource in interface SSWAPProvider
Parameters:
resource - a SSWAPResource that is provided by this provider. (The object may not be dereferenced, since the only information stored in a PDG about the provided resource is the resource's URI).

setProvidesResource

public void setProvidesResource(java.util.Collection<SSWAPResource> resources)
Sets the information about all the resources provided by this provider.

Specified by:
setProvidesResource in interface SSWAPProvider
Parameters:
resources - a set of SSWAPResource that are provided by this provider. (The objects may not be dereferenced, since the only information stored in a PDG about the provided resource is the resource's URI).

getProvidesResources

public java.util.Collection<SSWAPResource> getProvidesResources()
Gets the information about all the resources provided by this provider.

Specified by:
getProvidesResources in interface SSWAPProvider
Returns:
a collection of SSWAPResource objects, which are not dereferenced (the information about them is stored in different documents).

getProvidesResourceList

public abstract java.util.List<ResourceImpl> getProvidesResourceList()
Empire-generated method that returns a list of implementations for SSWAPResource connected to this PDG by sswap:providesResource predicate.

Returns:
a list of ResourceImpl objects (may be empty or null, if there are no sswap:providesResource predicates in this PDG).

setProvidesResourceList

public abstract void setProvidesResourceList(java.util.List<ResourceImpl> providesResourceData)
Empire-generated method for setting a list of implementations of SSWAPResource that will be connected to this PDG by sswap:providesResource predicate.

Parameters:
providesResourceData - a list of ResourceImpl objects

belongsToProvidersDomain

boolean belongsToProvidersDomain(java.net.URI uri)
Checks whether the following URI (usually a Resource URI) belongs to this provider's "security domain"; that is, whether the resource is assumed to be provided by this provider just because of its URI and not because it is listed explicitly in the PDG. In order for a URI to belong to the provider's security domain, the URI has to have the same scheme (protocol) and host as the provider. Moreover, the resource's path on the host must either have the same directory as the provider, or be located in one of the subdirectories of the provider (directly or indirectly)

Parameters:
uri - the URI to be checked whether it belongs to the provider's domain
Returns:
true if the Provider belongs to the "security domain" as described above; false otherwise

validate

public void validate()
              throws ValidationException
Description copied from interface: SSWAPModel
Verifies whether the underlying RDF data conforms to SSWAP syntax and requirements.

Specified by:
validate in interface SSWAPModel
Overrides:
validate in class ModelImpl
Throws:
ValidationException - if the data violates SSWAP syntax or requirements

getPDG

public PDG getPDG()
Description copied from interface: SSWAPProvider
Gets the PDG that defines this provider

Specified by:
getPDG in interface SSWAPProvider
Returns:
PDG the PDG to which this Provider belongs


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