info.sswap.ontologies.data.impl
Class DirectoryImpl

java.lang.Object
  extended by info.sswap.ontologies.data.impl.DirectoryImpl
All Implemented Interfaces:
Directory

public class DirectoryImpl
extends java.lang.Object
implements Directory

Directory implementation.

Author:
Damian Gessler
See Also:
Directory

Field Summary
private  SSWAPType data_DataFormat
           
private  SSWAPPredicate data_hasData
           
private  java.util.HashSet<Data> dataSet
           
private  SSWAPIndividual sswapIndividual
           
 
Constructor Summary
DirectoryImpl(SSWAPIndividual sswapIndividual)
          Create a Directory from the subject individual.
 
Method Summary
 java.util.Collection<Data> getData()
          For every data:hasData statement on the subject individual (set at the DataFactory.Directory(SSWAPIndividual)), return a Collection of Data objects constructed from property instance values.
 SSWAPIndividual getIndividual()
          The individual subject for the data:hasData statements.
 void setData()
          Build the Collection to be returned by Directory.getData().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data_hasData

private SSWAPPredicate data_hasData

data_DataFormat

private SSWAPType data_DataFormat

sswapIndividual

private SSWAPIndividual sswapIndividual

dataSet

private java.util.HashSet<Data> dataSet
Constructor Detail

DirectoryImpl

public DirectoryImpl(SSWAPIndividual sswapIndividual)
              throws DataException
Create a Directory from the subject individual.

Parameters:
sswapIndividual - Individual for which to inspect for data:hasData properties.
Throws:
DataException - upon failure to internally setData()
Method Detail

getIndividual

public SSWAPIndividual getIndividual()
Description copied from interface: Directory
The individual subject for the data:hasData statements.

Specified by:
getIndividual in interface Directory
Returns:
the source SSWAPIndividual for this Directory
See Also:
DataFactory.Directory(SSWAPIndividual)

getData

public java.util.Collection<Data> getData()
Description copied from interface: Directory
For every data:hasData statement on the subject individual (set at the DataFactory.Directory(SSWAPIndividual)), return a Collection of Data objects constructed from property instance values. Include in this Collection the source individual itself if it belongs to the type data:DataFormat (the rdfs:range of data:hasData), even if it does not have the property explicitly reflexive on itself.

One may then use the Data.readData(), Data.writeData(java.io.InputStream), etc. methods on the Collection of indirectly referenced data.

A single Data object shall be returned per unique data:hasData individual. Consider the following case: an individual has two distinct subproperties of data:hasData, each with the same individual value. In this case, the relation of the super-property data:hasData to the individual value may appear one or more times--there being no logical difference between it being present once, twice, thrice, etc. In the following pseudo-code we see only one instance of the data:hasData property:

 :readFromThisFile rdfs:subPropertyOf data:hasData .
 :writeToThisFile rdfs:subPropertyOf data:hasData .
 :someInd :readFromThisFile :aFile .
 :someInd :writeToThisFile :aFile .
 
A reasoner will infer the single statement:
 :someInd data:hasData :aFile .
 
Similarly, even if :someInd had only one subproperty, (it) or the super-property relation may appear one or more times; there being no new inferences that could be derived given the number of times a statement re-occurs. (Re the Open World Assumption, cardinality restrictions are relevant only if the object of multiple instances of an object property are not necessarily equivalent. Lexical [URI] equivalence implies necessary logical equivalence).

Thus, this method shall return a single Data object per unique data:hasData statement, regardless of the actual number of instances observed. It may not be assumed that reasoning is used by the method (the method need make no assumption about reasoning on the SSWAPDocument).

Specified by:
getData in interface Directory
Returns:
Collection of Data objects from all unique data:hasData property statements and the presence of the type data:DataFormat on the subject individual itself, if applicable. The absence of any data:hasData properties on a non- data:DataFormat individual results in the return of an empty (but not null) collection.
See Also:
DataFactory.Directory(info.sswap.api.model.SSWAPIndividual)

setData

public void setData()
             throws DataException
Description copied from interface: Directory
Build the Collection to be returned by Directory.getData(). Relevant if the subject individual has changed. Called automatically (and does not need to be called explicitly prior) to calling getData on its first invocation.

Specified by:
setData in interface Directory
Throws:
DataException - Upon the presence of a data:hasData property, but a failure to extract its value and create a Data object.


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