info.sswap.impl.empire.model
Class SubjectImpl

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.SubjectImpl
All Implemented Interfaces:
com.clarkparsia.empire.SupportsRdfId, SSWAPElement, SSWAPIndividual, SSWAPModel, SSWAPNode, SSWAPSubject
Direct Known Subclasses:
TranslatedSubjectImpl

public abstract class SubjectImpl
extends EmpireGeneratedNodeImpl
implements SSWAPSubject

Implementation of SSWAPSubject. This abstract class contains a few abstract methods whose implementation will be automatically provided by Empire at run-time.

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
 
Field Summary
private  java.util.Set<GraphImpl> graphs
           
 
Constructor Summary
SubjectImpl()
          The default constructor
 
Method Summary
(package private)  void addGraph(SSWAPGraph graph)
           
 void addObject(SSWAPObject object)
          Adds a new object for this SSWAPSubject (i.e., existing objects are preserved, and the added object is appended).
private  void detachExistingObjects()
           
 SSWAPGraph getGraph()
          Gets the graph to which this subject belongs.
 java.util.Collection<SSWAPGraph> getGraphs()
          Gets the graphs to which this subject belongs.
abstract  java.util.List<ObjectImpl> getMapsToEmpireList()
          Gets a list of SSWAPObject implementations that are all connected to this SSWAPSubject by sswap:mapsTo predicate.
 java.util.List<ObjectImpl> getMapsToList()
           
 SSWAPObject getObject()
          Gets the object, onto which this subject is mapped.
 java.util.Collection<SSWAPObject> getObjects()
          Gets all the objects, onto which this subject is mapped.
(package private)  void removeGraph(SSWAPGraph graph)
           
abstract  void setMapsToEmpireList(java.util.List<ObjectImpl> mapsToList)
          Sets a list of SSWAPObject implementations that will all be connected to this SSWAPSubject by sswap:mapsTo predicate.
 void setObject(SSWAPObject object)
          Sets a new SSWAPObject for this SSWAPSubject.
 void setObjects(java.util.Collection<SSWAPObject> objects)
          Maps this subject onto the provided collection
 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, dereference, 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, 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
 

Field Detail

graphs

private java.util.Set<GraphImpl> graphs
Constructor Detail

SubjectImpl

public SubjectImpl()
The default constructor

Method Detail

getGraph

public SSWAPGraph getGraph()
Description copied from interface: SSWAPSubject
Gets the graph to which this subject belongs. (In case it belongs to more than one graph, it returns the first one.)

Specified by:
getGraph in interface SSWAPSubject
Returns:
the graph to which this subject belongs or null, if it does not belong to any graph

getGraphs

public java.util.Collection<SSWAPGraph> getGraphs()
Description copied from interface: SSWAPSubject
Gets the graphs to which this subject belongs.

Specified by:
getGraphs in interface SSWAPSubject
Returns:
a collection of graphs.

addGraph

void addGraph(SSWAPGraph graph)

removeGraph

void removeGraph(SSWAPGraph graph)

getObject

public SSWAPObject getObject()
Description copied from interface: SSWAPSubject
Gets the object, onto which this subject is mapped. If the subject is mapped onto more than one object, the first object is returned.

Specified by:
getObject in interface SSWAPSubject
Returns:
the SSWAPObject for this subject (a dereferenced object).

getObjects

public java.util.Collection<SSWAPObject> getObjects()
Description copied from interface: SSWAPSubject
Gets all the objects, onto which this subject is mapped.

Specified by:
getObjects in interface SSWAPSubject
Returns:
a collection of SSWAPObjects for this subject (all of them are dereferenced).

setObject

public void setObject(SSWAPObject object)
Description copied from interface: SSWAPSubject
Sets a new SSWAPObject for this SSWAPSubject. If the subject has currently any other mappings, they will be removed.

Specified by:
setObject in interface SSWAPSubject
Parameters:
object - the new SSWAPObject

addObject

public void addObject(SSWAPObject object)
Description copied from interface: SSWAPSubject
Adds a new object for this SSWAPSubject (i.e., existing objects are preserved, and the added object is appended).

Specified by:
addObject in interface SSWAPSubject
Parameters:
object - the object to be added

setObjects

public void setObjects(java.util.Collection<SSWAPObject> objects)
Description copied from interface: SSWAPSubject
Maps this subject onto the provided collection

Specified by:
setObjects in interface SSWAPSubject
Parameters:
objects - Collection of SSWAPObjects to be associated with (mapped from) this SSWAPSubject

detachExistingObjects

private void detachExistingObjects()

getMapsToEmpireList

public abstract java.util.List<ObjectImpl> getMapsToEmpireList()
Gets a list of SSWAPObject implementations that are all connected to this SSWAPSubject by sswap:mapsTo predicate.

Returns:
a list of SSWAPObject implementations. The list may be either empty or null, if there are no such objects.

getMapsToList

public java.util.List<ObjectImpl> getMapsToList()

setMapsToEmpireList

public abstract void setMapsToEmpireList(java.util.List<ObjectImpl> mapsToList)
Sets a list of SSWAPObject implementations that will all be connected to this SSWAPSubject by sswap:mapsTo predicate.

Parameters:
mapsToList - a list of SSWAPObject implementations. The list may be either empty or null, if there are no such objects.

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


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