info.sswap.ontologies.data.api
Interface Data


public interface Data

The data package standardizes a simple interface to arbitrary data for semantic Web services.

The package works in concert with the data ontology at http://sswapmeet.sswap.info/data. The ontology allows "the data itself" to be either a literal or to reside at a URI, whereby the data is retrieved by dereferencing the URI and reading the input stream. When data resides at a URI, it is commonly either the URI of a SSWAPSubject, or the object (property value) of the data:hasData predicate.

In the first case where the data is literal, the data is instantiated as the value to a datatype property. The data ontology has a super-property called data:literalData that should be used as the root property for all data literal properties. Users may rdfs:subPropertyOf data:literalData to make specific properties as they need. This API (Application Programming Interface) relies on SSWAP's transaction-time reasoning to map every such subproperty instance to an instance of data:literalData. The API then operates on instances of data:literalData to retrieve the data.

The second case is where the data is to be dereferenced from the individual itself. To signify this, the resource should belong to the type data:DataFormat, and in most cases, to a domain-specific subClass (e.g., seq:FASTA) of this marker class. In the absence of a data:literalData superproperty, the data is considered to be at the URI.

In simple (and recommended) cases, the SSWAPSubject itself is typed to some data format. Using this class on the subject returns the data.

Author:
Damian Gessler
See Also:
Directory, RDG, RIG, SSWAPIndividual, SSWAPSubject

Method Summary
 java.util.Set<java.net.URI> getAccessors()
          Return a set of URIs of declared accessors for the data.
 java.util.Set<SSWAPType> getFormats()
          Get explicit and inferred subTypes of data:DataFormat
 SSWAPIndividual getIndividual()
           
 java.util.Set<java.net.URI> getParsers()
          Return a set of URIs for declared parsers for the data.
 java.util.Set<java.net.URI> getSerializers()
          Return a set of URIs for declared serializers for the data.
 java.util.Set<java.net.URI> getValidators()
          Return a set of URIs for declared validators for the data.
 java.io.InputStream readData()
          Read the current data element (either a literal or by dereferencing the individual itself).
 void writeData(java.io.InputStream inputStream)
           
 

Method Detail

readData

java.io.InputStream readData()
                             throws java.io.IOException,
                                    DataException
Read the current data element (either a literal or by dereferencing the individual itself). Caller should close the input stream when done reading.

Returns:
InputStream a stream to read the data
Throws:
java.io.IOException - on any stream error
DataException - on data error such as parsing, validating, etc.

writeData

void writeData(java.io.InputStream inputStream)
               throws java.io.IOException,
                      DataException
Parameters:
inputStream - the stream to read for writing the data to the current data element
Throws:
java.io.IOException - on any stream error
DataException - on data error such as validating, serializing, etc.

getFormats

java.util.Set<SSWAPType> getFormats()
Get explicit and inferred subTypes of data:DataFormat

Returns:
a set of all data types for which this individual belongs.

getAccessors

java.util.Set<java.net.URI> getAccessors()
Return a set of URIs of declared accessors for the data. An accessor is a agent for access to the data; it may be a simple read and stream of the underlying data, or it may wrap user authentication and authorization. Specifics of how an accessor is invoked and how it accesses the data are local to the specific accessor and not specified here.

Accessors are determined by the values of the data:hasAccessor property.

Returns:
a set of unique URIs of declared accessors

getParsers

java.util.Set<java.net.URI> getParsers()
Return a set of URIs for declared parsers for the data. A parser should read the data (given some format) and return it as a more manageable object. Specifics of how a parser is invoked to read the data, how it parses the data, and what it returns are local to the specific parser and not specified here.

Parsers are determined by the values of the data:hasParser property.

Returns:
a set of unique URIs of declared parsers

getSerializers

java.util.Set<java.net.URI> getSerializers()
Return a set of URIs for declared serializers for the data. A serializer should write the data (given some format). Specifics of how a serializer is invoked to write the data and how it formats the data are local to the specific serializer and not specified here.

Serializer are determined by the values of the data:hasSerializer property.

Returns:
a set of URIs of declared serializers

getValidators

java.util.Set<java.net.URI> getValidators()
Return a set of URIs for declared validators for the data. A validator should test the data for conformity to a set of standards. Validators may be used both in reading and writing the data. Specifics of how a validator is invoked, how it validates the data, and what it returns are local to the specific validator and not specified here.

Validators are determined by the values of the data:hasValidator property.

Returns:
a set of unique URIs of declared validators

getIndividual

SSWAPIndividual getIndividual()
Returns:
the source SSWAPIndividual for this Data object


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