wiki:ApertureDataObject

Version 9 (modified by sauermann, 19 years ago) (diff)

--

DataObject

ToDo: the getMetadata method should probably return some kind of RDF statement container (the same interface that will be used in Extractor) instead of a Map with key-value pairs, the keys of which are specific to the type of DataObject/DataSource.

Leo about TODO: ok with me to return an RDFMap

ChangeLog:

  • 'Metadata' is one word, hence getMetadata, not getMetaData.
  • TODO: what is the semantics and use of getParent() and getChildren()?

Java Interface

/**
 * A general interface for data objects. A data object consists of an identifier,
 * binary content and metadata. The object is used primarily to extract 
 * information from datasources. For the extraction, both the InputStream 
 * returned by getContent() and
 * the RDF metadata returned by getMetadata() are important.
 * In structured data sources that are not file-based, the getContent() method
 * will return null, and all structured data of the object are represented
 * in the getMetadata object.
 * 
 */
public interface DataObject {

        /**
         * Gets the data object's primary identifier.
         * 
         * @return An identifier for this data object.
         */
        public URI getID();

        /**
         * Gets the DataSource from which this DataObject conceptually originated.
         * 
         * @return The DataSource from which this DataObject conceptually originated.
         */
        public DataSource getDataSource();
    
        /**
         * Gets the data object's parent, if any.
         * 
         * @return the parent DataObject, or null when this DataObject has no parent.
         */
        public DataObject getParent();
    
        /**
         * Gets the data object's children, if any. This may be null to indicate that there
         * are no children. 
         */
        public Iterator<DataObject> getChildren();

    
        /**
         * Get the source-specific metadata and data.
         * The used keys and values and implementation-dependent. 
         * For java1.4 compability reasons, the map is untyped.
         * It is already titled RDFMap to reflect our ideas regarding RDF
         * 
         * @return The scheme-specific metadata.
         */
        public RDFMap getMetadata();

}