info.sswap.ontologies.data.api
Interface Directory


public interface Directory

A data:DataBundle from the data ontology is an individual with one or more data:hasData statements. A Directory is akin to a DataBundle, but allows for the possibility of zero data:hasData statements; a Directory is essentially a virtual directory of data (URIs), analogous to a file system directory of files.

The object of a data:hasData property (or its subproperties) is a data:DataFormat resource: this API wraps those objects as Data objects. Thus the model allows n-ary indirection on data reading and writing: a Directory built from a SSWAPIndividual may reference its multiple Data sources and sinks (for example, as multiple input files to a service or multiple output files, all bundled from a single data:DataBundle SSWAPSubject or SSWAPObject respectively).

If the source individual is itself of type data:DataFormat, then it too is included in the Directory.

Author:
Damian Gessler

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 getData().
 

Method Detail

getIndividual

SSWAPIndividual getIndividual()
The individual subject for the data:hasData statements.

Returns:
the source SSWAPIndividual for this Directory
See Also:
DataFactory.Directory(SSWAPIndividual)

getData

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. 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).

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

void setData()
             throws DataException
Build the Collection to be returned by 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.

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.