Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] IdAS: metadata on attribute values

Another proposal would be where Metadata is constrained to being only made up of single, simple values.  This is much like what you see in XML.  The XML analogy would be that IdAS Attributes are like XML elements (can be simple or complex), while IdAS Metadata is like XML attributes (can only be simple, and single-valued).
 
The drawback here is that there are a number of aspects of IMetadataValue and IMetadata which duplicate ISimpleValue and IAttribute, but it's probably not so much as to become a huge maintenance worry.
 
Proposal 3
// Always single-valued.  Always simple type
public interface IMetadataValue extends IValue {
 public URI getType()throws IdASException; // The simple type (string, integer, etc.)
 public String getLexical() throws IdASException;
 public String getCanonical() throws IdASException;
 public Object getData() throws IdASException;
 void setData(Object data) throws IdASException;
}
 
public interface IMetadata {
 public URI getType() throws IdASException; // the metadata ID (creationTime, creatorName, etc.)
 public IMetadataValue getValue() throws IdASException;
 IMetadataValue setValue(URI type) throws IdASException, InvalidTypeException;
 IMetadataValue setValue(IMetadataValue copyFrom) throws IdASException;
 void remove() throws IdASException;
 public IMetadataModel getModel() throws IdASException;
}
 
public interface IHasMetadata {
 public Iterator getMetadataSet() throws IdASException; // Iterator of IMetadata
 public IMetadata getMetadata(URI metadataID) throws IdASException;
 IMetadata addMetadata(URI type) throws IdASException, InvalidTypeException;
 IMetadata addMetadata(IMetadata copyFrom) throws IdASException;
}
/**
 * not intended to be instantiated (only used as a super-interface)
 */
public interface IValue extends IHasMetadata {
 public boolean isSimple() throws IdASException;
 public URI getType()throws IdASException;
 void remove() throws IdASException;
}

public interface ISimpleValue extends IValue {
 public String getLexical() throws IdASException;
 public String getCanonical() throws IdASException;
 public Object getData() throws IdASException;
 void setData(Object data) throws IdASException;
}
 
public interface IComplexValue extends IValue, IHasAttributes {
}
 
public interface IAttribute extends IHasMetadata {
 public URI getType() throws IdASException;
 public Iterator getValues() throws IdASException;
 IValue addValue(URI type) throws IdASException, InvalidTypeException;
 IValue addValue(IValue copyFrom) throws IdASException;
 ISimpleValue addSimpleValue(URI type, Object data) throws IdASException, InvalidTypeException;
 IComplexValue addComplexValue(URI type) throws IdASException, InvalidTypeException;
 void remove() throws IdASException;
 public IAttributeModel getModel() throws IdASException;
 public boolean isSingleValued() throws IdASException;
}
 
public interface ISingleValuedAttribute extends IAttribute {
 public IValue getValue() throws IdASException;
}
 
public interface IHasAttributes
{
 public Iterator getAttributes() throws IdASException;
 public IAttribute getAttribute(URI attrID) throws IdASException;
 IAttribute addAttribute(URI type) throws IdASException, InvalidTypeException; 
 IAttribute addAttribute(IAttribute copyFrom) throws IdASException; 
}
 
public interface IDigitalSubject extends IHasMetadata, IHasAttributes
{
 public IContext getContext() throws IdASException;
 public String getUniqueID() throws IdASException;
 public URI getType() throws IdASException;
 void remove() throws IdASException; 
 void applyUpdates() throws IdASException; // this is moving to IContext
 public IDigitalSubjectModel getModel() throws IdASException;
}


<snip>

Back to the top