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

Here's another proposal. In it, we've basically removed IProperty and IMetadata as the types are redundant. The only thing that might seem odd here is that a metadata element IS an IAttribute, and thus can itself have metadata (as can it's values).  Is that bad? As usual, it is the CP's model which will allow/disallow metadata at any given point, so in that way, it seems fine -- maybe some CP will actually allow metadata on metadata or metadata on a metadata element's value.  I'll try to follow this with a proposal where metadata is constrained to be only simple values
 
Proposal 2: (does not yet include replace methods)
/**
 * 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 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 IHasMetadata {
 public Iterator getMetadataSet() throws IdASException;
 public IMetadata getMetadata(URI metadataID) throws IdASException;
 IAttribute addMetadata(URI type) throws IdASException, InvalidTypeException;
 IAttribute addMetadata(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;
}


>>> "Jim Sermersheim" <jimse@xxxxxxxxxx> 5/2/07 10:50 PM >>>
From what I've gathered, we want metadata on the Context, Digital Subject, Attribute, Attribute Values, and even elements of complex Attribute Values.
 
One unresolved issue is how to get the HOWL to represent metadata on an Attribute as a whole.  Of course, some CPs will not be able to represent metadata at all these levels, and as usual, they'll fail if people try to add it where not supported.
 
Anyway, if we do this, we'll need to make a few changes to IdAS.  Today, the only thing below an IDigitalSubject that has metadata is IAttribute. Further, the only difference between an IAttribute and an IProperty was that IAttribute had medatata. It's easy to add metadata to IPropertyValue. It's more tricky to add it to elements of a complex attribute (as those are just IPropertys).
 
We could say that all IPropertys have metadata, but oops, IMetadata is an IProperty (IMetadata doesn't even add functionality -- it's just a marker interface).  I don't think we want metadata on metadata. If we want to continue to allow metadata to be essentially the same as other properties (multi-valued, simple or complex), then we'll need to tease apart the notion of properties with metadata and properties without.
 
I started writing up what this would take and it's a major PITA due to lack of generics. This is because I'm making metadata just as robust as attributes except with no metadata on the metadata, no metadata on the metadata's values, no metadata on the metadata's value's elements (when the value is complex).  Basically, I'll have to duplicate APIs all the way down.  One set having metadata all the way down, and one without.
 
maybe I need sleep.
 
proposal 1
IValue (Same methods as today's IPropertyValue)
ISimpleValue implements IValue  (same methods as today's ISimpleValue)
IComplexValue implements IHasTypedValues (same methods as today's IComplexValue)
 
ITypedValues (same methods as today's IProperty but contains IValue and sub-interfaces)
ITypedValue implements ITypedValues (same methods as today's ISingleValuedProperty)
IHasTypedValues (like other IHas* but contains ITypedValues)
 
IMetadata implements ITypedValues {
 public IMetadataModel getMetadataModel();
}
ISingleValuedMetadata implements IMetadata, ITypedValue {} 
 
// Can't do this -- need to implement some kind of ITypedValueWithMetadata as well as IHasMetadata.  Meaning, need to build a sibling class hierarchy for IValue and sub interfaces, ITypedValues and sub interfaces.
IProperty implements ITypedValues, IHasMetadata (same methods as today's IProperty)
ISingleValuedProperty implements  IProperty {} (same as today's ISingleValuedProperty)
 
IAttribute implements ITypedValues, IHasMetadata (same methods as today's IProperty)
 public IAttributeModel getAttributeModel();
}
ISingleValuedAttribute implements IMetadata, ITypedValue {}
 
IPropertyValue implements IHasMetadata (same methods as today's IPropertyValue)
ISimpleValue implements IPropertyValue  (same methods as today's ISimpleValue)
IComplexValue implements IHasProperties (same methods as today's IComplexValue)
 

Back to the top