Skip to main content
Jump to: navigation, search

Difference between revisions of "Higgins/ModelAPIs"

(The model for attribute models)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}
 +
[[Image:Higgins_logo_76Wx100H.jpg|right]]
 
=Problem=
 
=Problem=
 
Today, IdAS defines a set of special interfaces for accessing a context's model elements.  There are a number of problems with these interfaces:
 
Today, IdAS defines a set of special interfaces for accessing a context's model elements.  There are a number of problems with these interfaces:
# They are 'fixed' in nature.  The only way to represent extra information about the model of context elements is to revise these interfaces.  For example, say there's a need to associate an image with the attribute called “http://example.com/some/name/space#telephoneNumber” (this image might be used by a management UI).  To make that association we need a new method like IAttributeModel.getManagementImage().   
+
# They are 'fixed' in nature.  The only way to represent extra information about the model of context elements is to revise these interfaces.  For example, say there's a need to associate an image with the attribute called <nowiki>http://example.com/some/name/space#telephoneNumber</nowiki> (this image might be used by a management UI).  To make that association we need a new method like IAttributeModel.getManagementImage().   
 
## Even if we felt like it's ok to revise the current I*Model interfaces, we do not know what kinds of information will need to be associated with the models of elements in a context.  It may be the case that some people will have needs that we think are unworthy of revising the interfaces for.  For example, say someone wants to associate an astrological symbol to each different attribute model.  Does that mean we should add a new IAttributeModel.getAstrologicalSymbol()?
 
## Even if we felt like it's ok to revise the current I*Model interfaces, we do not know what kinds of information will need to be associated with the models of elements in a context.  It may be the case that some people will have needs that we think are unworthy of revising the interfaces for.  For example, say someone wants to associate an astrological symbol to each different attribute model.  Does that mean we should add a new IAttributeModel.getAstrologicalSymbol()?
# There is no way to update a context's model.  We have a need to be able to add models for new node types, attribute types and so-on. We also need to be able to change existing models (such as changing the cardinality of an attribute).  Also, we may need to remove models.
+
# There is no way to update a context's model.  We have a need to be able to add models for new entity types, attribute types and so-on. We also need to be able to change existing models (such as changing the cardinality of an attribute).  Also, we may need to remove models.
 
# We cannot look up a model with partial information.  For example, say I know there's an attribute with the word "telephoneNumber" in its ID, but I don't know the entire ID.  It would be nice to be able to have a way to find what I need without enumerating through the entire set of attribute models.
 
# We cannot look up a model with partial information.  For example, say I know there's an attribute with the word "telephoneNumber" in its ID, but I don't know the entire ID.  It would be nice to be able to have a way to find what I need without enumerating through the entire set of attribute models.
  
 
=Proposal=
 
=Proposal=
It may be better to move away from the existing special interfaces for the purpose of defining the model of elements, but instead simply re-use the existing interfaces that are used to access normal information within a Context (nodes and their attributes).
+
It may be better to move away from the existing special interfaces for the purpose of defining the model of elements, but instead simply re-use the existing interfaces that are used to access normal information within a Context (entities and their attributes).
  
Following is a proposal which shows how these model nodes might look.  To illustrate the proposal, we start by showing how an instance of a person looks (nothing new) and then examining the model nodes that govern instances of nodes and attributes:
+
Following is a proposal which shows how these model entities might look.  To illustrate the proposal, we start by showing how an instance of a person looks (nothing new) and then examining the model entities that govern instances of entities and attributes:
  
 
==A person==
 
==A person==
Example of an instance of a person node.
+
Example of an instance of a person entity.
* Java type: some impl of INode. The context provider implements this class
+
* Java type: some impl of IEntity. The context provider implements this class
* getNodeID() returns: the contextually unique ID for this person
+
* getEntityID() returns: the contextually unique ID for this person
* getAttributes() returns: typical attributes about this person (things like a homeAddress and phoneNumber)
+
* getAttributes() returns: typical attributes about this person (things like a full name and email address)
* getType() returns: an identifier for this person's model node.  assume it's called “http://example.com/some/name/space#Person”
+
* getType() returns: an identifier for this person's entity class.  assume it's called <nowiki>http://example.com/class#Person</nowiki>
* getTypeNode() returns: some impl of INode, assume it returns a PersonModel.class
+
** Note that getType is only a convenience for getTypeEntity().getEntityID()
 +
* getTypeEntity() returns: some impl of IEntity, assume it returns a PersonClass.class
  
==A person's model==
+
==A person's entity class==
Now, say we look at the “person model” node we saw above (we got this either by calling INode.getTypeNode(), or INode.getType() followed by IContext.getNode(NodeID)), we see (NOTE: this node is a model element):
+
Now, say we look at the “<nowiki>http://example.com/class#Person</nowiki>” entity we saw above (we got this either by calling IEntity.getTypeEntity(), or IEntity.getType() followed by IContext.getEntity(EntityID)), we see (NOTE: this entity represents the class definition of a person):
* Java type: some impl of INode – This is implemented by the context provider.  We can assume it's a PersonModel.class.
+
* Java type: some impl of IEntity – This is implemented by the context provider.  We can assume it's a PersonClass.class.
* getNodeID() returns: the contextually unique ID for this node.  This is the same value we got when calling INode.getType() on the person instance above, so in this case it would be “http://example.com/some/name/space#Person”.
+
* getEntityID() returns: the contextually unique ID for this entity.  This is the same value we got when calling IEntity.getType() on the person instance above, so in this case it would be <nowiki>http://example.com/class#Person</nowiki>.
 
* getAttributes() returns: the following and other attributes:
 
* getAttributes() returns: the following and other attributes:
** http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes:  This attribute has values which are pointers to various attribute model nodesFor example, a value might point at the “http://example.com/some/name/space#telephoneNumber” attribute model node, and another one might point at the “http://example.com/some/name/space#homeAddress” attribute model node.
+
** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>:  This attribute has complex values, each of which represent a valid attribute for this type of entityEach value has the following literal elements:
*** Note that the full list of valid attributes for this type of node must be discovered by looking at this list as well as the list of all this node model's supertypes.  We can talk about possible shortcuts to get them all at once.
+
*** <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki> = <attribute type uri like <nowiki>http://example.com/prop#fullname</nowiki>>
** http://www.eclipse.org/higgins/ontologies/2006/higgins#supertype:  This attribute would point at another node model node.  If person is derived from something like “http://example.com/some/name/space#Mammal” it would point at that.  If person is at the top of it's node type hierarchy in this context, this attribute would point at a well-known node model node that defines INode in general (that would be called “http://www.eclipse.org/higgins/ontologies/2006/higgins#Node”)
+
*** <nowiki>http://www.w3.org/2002/07/owl#minCardinality</nowiki> = <minimum cardinality for values of this attribute as it applies to the person class.>
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeModel”
+
*** <nowiki>http://www.w3.org/2002/07/owl#maxCardinality</nowiki> = <maximum cardinality for values of this attribute as it applies to the person class.>
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeModel”This object would be implemented by Higgins and thus would be the same for all context providers.
+
*** Note that the full list of valid attributes for this type of entity must be discovered by looking at this list as well as the list of all this entity class's supertypes (see the <nowiki>http://www.w3.org/2000/01/rdf-schema#subClassOf</nowiki> attribute).  We can talk about possible shortcuts to get them all at once.
 +
** <nowiki>http://www.w3.org/2000/01/rdf-schema#subClassOf</nowiki>:  This has a single, literal value which names the supertype of person.  If person is derived from something like <nowiki>http://example.com/class#Mammal</nowiki> it would name that.  If person is at the top of it's entity type hierarchy in this context, this attribute would name the well-known entity class entity that defines IEntitys in general (that would be called <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity</nowiki>)
 +
* getType() returns: the well-known identifier <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>
 +
* getTypeEntity() returns: an implementation of IEntity which represents <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>A default object would be implemented by Higgins, but could be overridden by context providers which wish to add additional capabilities.
  
==The "top" node model==
+
==The "top" entity class==
Ok, now let's look at the instance of the node called “http://www.eclipse.org/higgins/ontologies/2006/higgins#Node”.  This is simply the top-level model definition for all node model hierarchies.  Thus it contains model definitions for things common to all nodes:
+
Ok, now let's look at the instance of the entity called <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity</nowiki>.  This is simply the top-level class definition for all entity class hierarchies.  Thus it contains class definitions for things common to all entities:
* Java type: an impl of INode (maybe we'll call it Node.class).  This is implemented by Higgins and is always the same
+
* Java type: an impl of IEntity (maybe we'll call it Entity.class).  This is implemented by Higgins and is always the same
* getNodeID() returns: the unique ID for this node.  This is “http://www.eclipse.org/higgins/ontologies/2006/higgins#Node”
+
* getEntityID() returns: the unique ID for this entity.  This is <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity</nowiki>
 
* getAttributes() returns: the following attributes:
 
* getAttributes() returns: the following attributes:
** http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypesOnly one value exists at this point, and that is “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeID”
+
** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>In the base higgins definition of the top entity class, only one value exists at this point, and that is:
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeModel”
+
*** <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki> = <nowiki>http://www.eclipse.org/higgins/ontologies/2006/higgins#EntityID</nowiki>
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeModel”This object would be implemented by Higgins and thus would be the same for all context providers.
+
*** <nowiki>http://www.w3.org/2002/07/owl#minCardinality</nowiki> = 1
 +
*** <nowiki>http://www.w3.org/2002/07/owl#maxCardinality</nowiki> = 1
 +
* getTypeEntity() returns: an implementation of IEntity which represents <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>A default object would be implemented by Higgins, but could be overridden by context providers which wish to add additional capabilities.
  
==The model for node models==
+
==The definition for entity classes==
What defines a node model node?  This does:
+
What defines an entity class entity?  This does:
* Java type: an impl of INode.  Higgins will provide a default class called NodeModel.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins NodeModel.class), as long as it contains the “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes” and its values mentioned below.  A context provider is free to add more values to the “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes” attribute.
+
* Java type: an impl of IEntity.  Higgins will provide a default class called EntityClass.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins EntityClass.class), as long as it contains the <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki> and its values mentioned below.  A context provider is free to override and add more values here.
* getNodeID() returns: the unique ID for this node.  This is “http://www.eclipse.org/higgins/ontologies/2006/higgins#NodeModel”
+
* getEntityID() returns: the unique ID for this entity.  This is <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>
 
* getAttributes() returns: the following attributes:
 
* getAttributes() returns: the following attributes:
** http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes:  These values exists here (note that a context provider may add to this set of values):
+
** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>: Names the attributes (along with their min/max cardinality) valid for entity classes. These values exists here (note that a context provider may add to this set of values):
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes”
+
*** {<nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki> = <nowiki>http://www.eclipse.org/higgins/ontologies/2006/higgins#validAttributes</nowiki>, minCard = 0, maxCard = 0}
**** Note there's a subtlety here that may look confusing.  The attribute is called attributeTypes and this value is also called attributeTypes.  What we're saying is that this model (which defines what it means to be a node model – really a node model model to be precise) specifies that instances (like the model for person, or organization) can have an attribute called attributeTypes.  We could rename this value to something like “http://www.eclipse.org/higgins/ontologies/2006/higgins#nodeAttributeTypes” if that would make it more clear.
+
*** {<nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki> = <nowiki>http://www.w3.org/2000/01/rdf-schema#subClassOf</nowiki>, minCard = 0, maxCard = 1}
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#supertype”
+
* getType() returns: the well-known identifier <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>, or maybe null
**** This says that instances (like the model for person, or organization) can have an attribute called supertype. 
+
* getTypeEntity() returns this object, or maybe it should be null
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”
+
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”.  This object would be implemented by Higgins and thus would be the same for all context providers.
+
** alternately, this could be null if we just tell people there is no such thing and teach them conceptually what it is.
+
  
==The model for model elements==
+
==An attribute definition==
Finally, here's the model for model elements:
+
Now for fun, let's look at what defines an attribute, and follow that.  We'll take the example of <nowiki>http://example.com/prop/fullname</nowiki>:
* Java type: an impl of INode called ModelModel. This is implemented by Higgins and is always the same.
+
* Java type: an impl of IEntity. This is created by the context provider.
* getNodeID() returns: the unique ID for this nodeThis is “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”
+
* getEntityID() returns: the unique ID for this entityIn this case it's <nowiki>http://example.com/prop/fullname</nowiki>
 
* getAttributes() returns: the following attributes:
 
* getAttributes() returns: the following attributes:
** http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes:  This only has:
+
** <nowiki>http://www.w3.org/2000/01/rdf-schema#range</nowiki>:  Each value would be the identifier of an entity which represents a permitted data type for the value(s) of attribute instances that this attribute definition describes.  An example might be <nowiki>http://www.w3.org/2001/XMLSchema#string</nowiki>, but could also point at any other value data type (for simple types) or entity class (for complex types).
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes”
+
** <nowiki>http://www.w3.org/2000/01/rdf-schema#subPropertyOf</nowiki>:  This attribute would point at another attribute definition entity.  If fullname is derived from something like <nowiki>http://example.com/prop#name</nowiki> it would point at that.  If fullname is at the top of it's attribute type hierarchy in this context, this attribute would be absent.
**** This says that instances (the nodes for NodeModel, attributeModel, and valueModel) have an attribute called attributeTypes
+
** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>:  This is the list of (metadata) attributes valid for this attribute. If no attributes are valid, this attr is not populated.
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”
+
* getType() returns: the well-known identifier <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki>
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”.  This object would be implemented by Higgins and thus would be the same for all context providers.
+
* getTypeEntity() returns: an implementation of IEntity representing <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki>.  This object would be implemented by Higgins and thus would be the same for all context providers.
Note the recursive nature of getType and getTypeNode above.  We could instead return null or throw some well-known exception.
+
  
==An attribute model==
+
==The definition for attribute definitions==
Now for fun, let's look at an attribute's model, and follow that.  We'll take the example of “http://example.com/some/name/space#homeAddress”:
+
And here's that the entity identified by <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki> looks like:
* Java type: an impl of INode. This is created by the context provider.
+
* Java type: an impl of IEntity. Higgins will provide a default class called AttributeDefinition.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins AttributeDefinition.class), as long as it contains the <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki> and its values mentioned below.  A context provider is free to add more values to the <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki> attribute.
* getNodeID() returns: the unique ID for this nodeIn this case it's “http://example.com/some/name/space#homeAddress”
+
* getEntityID() returns: the unique ID for this entityThis is <nowiki>http://www.w3.org/2000/01/rdf-schema#Property</nowiki>
 
* getAttributes() returns: the following attributes:
 
* getAttributes() returns: the following attributes:
** http://www.eclipse.org/higgins/ontologies/2006/higgins#valueTypesEach value would be the identifier of a model node which represents a permitted data type for the value(s) of attribute instances that this attribute model defines.  An example might be ** ** “http://www.w3.org/2001/XMLSchema#string ”, but could also point at any other value model.
+
** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>These values represent the types of attributes allowed on an attribute definition entity (note that a context provider may add to this set of values):
** http://www.eclipse.org/higgins/ontologies/2006/higgins#maxCardinality: holds a value which represents the maximum values that can be placed on instances of attributes that this attribute model defines.
+
*** <nowiki>http://www.w3.org/2000/01/rdf-schema#range</nowiki>
** http://www.eclipse.org/higgins/ontologies/2006/higgins#minCardinality: holds a value which represents the minimum values that can be placed on instances of attributes that this attribute model defines.
+
*** <nowiki>http://www.w3.org/2000/01/rdf-schema#subPropertyOf</nowiki>
** http://www.eclipse.org/higgins/ontologies/2006/higgins#supertype:  This attribute would point at another attribute model node.  If homeAddress is derived from something like “http://example.com/some/name/space#postalAddress” it would point at that.  If homeAddress is at the top of it's node type hierarchy in this context, this attribute would point at a well-known attribute model node that defines IAttributes in general (assume that would be called “http://www.eclipse.org/higgins/ontologies/2006/higgins#TopAttribute”)
+
*** <nowiki>http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes</nowiki>
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#AttributeModel”
+
* getType() returns: the well-known identifier <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#AttributeModel”.  This object would be implemented by Higgins and thus would be the same for all context providers.
+
* getTypeEntity() returns: an implementation of IEntity representing <nowiki>http://www.w3.org/2002/07/owl#Class</nowiki>.  This object would be implemented by Higgins and thus would be the same for all context providers.
  
==The model for attribute models==
+
Then of course we have data value definitionsAgain from the bottom-up, here's an entity that describes a value type called <TODO: finish this>
And here's that the node identified by “http://www.eclipse.org/higgins/ontologies/2006/higgins#AttributeModel” looks like:
+
* Java type: an impl of INodeHiggins will provide a default class called AttributeModel.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins AttributeModel.class), as long as it contains the “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes” and its values mentioned below.  A context provider is free to add more values to the “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes” attribute.
+
* getNodeID() returns: the unique ID for this node.  This is http://www.eclipse.org/higgins/ontologies/2006/higgins#AttributeModel”
+
* getAttributes() returns: the following attributes:
+
** “http://www.eclipse.org/higgins/ontologies/2006/higgins#attributeTypes”:  These values represent the types of attributes allowed on an attribute model node (note that a context provider may add to this set of values):
+
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#valueTypes”
+
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#maxCardinality”
+
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#minCardinality”
+
*** “http://www.eclipse.org/higgins/ontologies/2006/higgins#supertype”
+
* getType() returns: the well-known identifier “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”
+
* getTypeNode() returns: an implementation of “http://www.eclipse.org/higgins/ontologies/2006/higgins#ModelModel”.  This object would be implemented by Higgins and thus would be the same for all context providers.
+
  
Then of course we have value modelsAgain from the bottom-up, here's a node that describes a value type called <TODO: finish this>
+
= TODO =
 +
* Need model element(s) for data typesThese should follow what is seen at http://www.w3.org/TR/xmlschema-2
  
<TODO need to be able to specify min/max cardinality on each attributeType associated with a specific node model so we can preserve the ability to say "person nodes must have at least one surname attribute value, and may have a telephone number" without causing all instances of surname to be min=1
+
[[Category:Higgins IdAS]]

Latest revision as of 09:36, 16 December 2008

{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}

Higgins logo 76Wx100H.jpg

Problem

Today, IdAS defines a set of special interfaces for accessing a context's model elements. There are a number of problems with these interfaces:

  1. They are 'fixed' in nature. The only way to represent extra information about the model of context elements is to revise these interfaces. For example, say there's a need to associate an image with the attribute called http://example.com/some/name/space#telephoneNumber (this image might be used by a management UI). To make that association we need a new method like IAttributeModel.getManagementImage().
    1. Even if we felt like it's ok to revise the current I*Model interfaces, we do not know what kinds of information will need to be associated with the models of elements in a context. It may be the case that some people will have needs that we think are unworthy of revising the interfaces for. For example, say someone wants to associate an astrological symbol to each different attribute model. Does that mean we should add a new IAttributeModel.getAstrologicalSymbol()?
  2. There is no way to update a context's model. We have a need to be able to add models for new entity types, attribute types and so-on. We also need to be able to change existing models (such as changing the cardinality of an attribute). Also, we may need to remove models.
  3. We cannot look up a model with partial information. For example, say I know there's an attribute with the word "telephoneNumber" in its ID, but I don't know the entire ID. It would be nice to be able to have a way to find what I need without enumerating through the entire set of attribute models.

Proposal

It may be better to move away from the existing special interfaces for the purpose of defining the model of elements, but instead simply re-use the existing interfaces that are used to access normal information within a Context (entities and their attributes).

Following is a proposal which shows how these model entities might look. To illustrate the proposal, we start by showing how an instance of a person looks (nothing new) and then examining the model entities that govern instances of entities and attributes:

A person

Example of an instance of a person entity.

  • Java type: some impl of IEntity. The context provider implements this class
  • getEntityID() returns: the contextually unique ID for this person
  • getAttributes() returns: typical attributes about this person (things like a full name and email address)
  • getType() returns: an identifier for this person's entity class. assume it's called http://example.com/class#Person
    • Note that getType is only a convenience for getTypeEntity().getEntityID()
  • getTypeEntity() returns: some impl of IEntity, assume it returns a PersonClass.class

A person's entity class

Now, say we look at the “http://example.com/class#Person” entity we saw above (we got this either by calling IEntity.getTypeEntity(), or IEntity.getType() followed by IContext.getEntity(EntityID)), we see (NOTE: this entity represents the class definition of a person):

  • Java type: some impl of IEntity – This is implemented by the context provider. We can assume it's a PersonClass.class.
  • getEntityID() returns: the contextually unique ID for this entity. This is the same value we got when calling IEntity.getType() on the person instance above, so in this case it would be http://example.com/class#Person.
  • getAttributes() returns: the following and other attributes:
    • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes: This attribute has complex values, each of which represent a valid attribute for this type of entity. Each value has the following literal elements:
      • http://www.w3.org/2000/01/rdf-schema#Property = <attribute type uri like http://example.com/prop#fullname>
      • http://www.w3.org/2002/07/owl#minCardinality = <minimum cardinality for values of this attribute as it applies to the person class.>
      • http://www.w3.org/2002/07/owl#maxCardinality = <maximum cardinality for values of this attribute as it applies to the person class.>
      • Note that the full list of valid attributes for this type of entity must be discovered by looking at this list as well as the list of all this entity class's supertypes (see the http://www.w3.org/2000/01/rdf-schema#subClassOf attribute). We can talk about possible shortcuts to get them all at once.
    • http://www.w3.org/2000/01/rdf-schema#subClassOf: This has a single, literal value which names the supertype of person. If person is derived from something like http://example.com/class#Mammal it would name that. If person is at the top of it's entity type hierarchy in this context, this attribute would name the well-known entity class entity that defines IEntitys in general (that would be called http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity)
  • getType() returns: the well-known identifier http://www.w3.org/2002/07/owl#Class
  • getTypeEntity() returns: an implementation of IEntity which represents http://www.w3.org/2002/07/owl#Class. A default object would be implemented by Higgins, but could be overridden by context providers which wish to add additional capabilities.

The "top" entity class

Ok, now let's look at the instance of the entity called http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity. This is simply the top-level class definition for all entity class hierarchies. Thus it contains class definitions for things common to all entities:

  • Java type: an impl of IEntity (maybe we'll call it Entity.class). This is implemented by Higgins and is always the same
  • getEntityID() returns: the unique ID for this entity. This is http://www.eclipse.org/higgins/ontologies/2008/6/higgins#Entity
  • getAttributes() returns: the following attributes:
    • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes: In the base higgins definition of the top entity class, only one value exists at this point, and that is:
      • http://www.w3.org/2000/01/rdf-schema#Property = http://www.eclipse.org/higgins/ontologies/2006/higgins#EntityID
      • http://www.w3.org/2002/07/owl#minCardinality = 1
      • http://www.w3.org/2002/07/owl#maxCardinality = 1
  • getTypeEntity() returns: an implementation of IEntity which represents http://www.w3.org/2002/07/owl#Class. A default object would be implemented by Higgins, but could be overridden by context providers which wish to add additional capabilities.

The definition for entity classes

What defines an entity class entity? This does:

  • Java type: an impl of IEntity. Higgins will provide a default class called EntityClass.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins EntityClass.class), as long as it contains the http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes and its values mentioned below. A context provider is free to override and add more values here.
  • getEntityID() returns: the unique ID for this entity. This is http://www.w3.org/2002/07/owl#Class
  • getAttributes() returns: the following attributes:
    • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes: Names the attributes (along with their min/max cardinality) valid for entity classes. These values exists here (note that a context provider may add to this set of values):
      • {http://www.w3.org/2000/01/rdf-schema#Property = http://www.eclipse.org/higgins/ontologies/2006/higgins#validAttributes, minCard = 0, maxCard = 0}
      • {http://www.w3.org/2000/01/rdf-schema#Property = http://www.w3.org/2000/01/rdf-schema#subClassOf, minCard = 0, maxCard = 1}
  • getType() returns: the well-known identifier http://www.w3.org/2002/07/owl#Class, or maybe null
  • getTypeEntity() returns this object, or maybe it should be null

An attribute definition

Now for fun, let's look at what defines an attribute, and follow that. We'll take the example of http://example.com/prop/fullname:

  • Java type: an impl of IEntity. This is created by the context provider.
  • getEntityID() returns: the unique ID for this entity. In this case it's http://example.com/prop/fullname
  • getAttributes() returns: the following attributes:
    • http://www.w3.org/2000/01/rdf-schema#range: Each value would be the identifier of an entity which represents a permitted data type for the value(s) of attribute instances that this attribute definition describes. An example might be http://www.w3.org/2001/XMLSchema#string, but could also point at any other value data type (for simple types) or entity class (for complex types).
    • http://www.w3.org/2000/01/rdf-schema#subPropertyOf: This attribute would point at another attribute definition entity. If fullname is derived from something like http://example.com/prop#name it would point at that. If fullname is at the top of it's attribute type hierarchy in this context, this attribute would be absent.
    • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes: This is the list of (metadata) attributes valid for this attribute. If no attributes are valid, this attr is not populated.
  • getType() returns: the well-known identifier http://www.w3.org/2000/01/rdf-schema#Property
  • getTypeEntity() returns: an implementation of IEntity representing http://www.w3.org/2000/01/rdf-schema#Property. This object would be implemented by Higgins and thus would be the same for all context providers.

The definition for attribute definitions

And here's that the entity identified by http://www.w3.org/2000/01/rdf-schema#Property looks like:

  • Java type: an impl of IEntity. Higgins will provide a default class called AttributeDefinition.class, but a context provider is free to return its own (which may or may not be a subclass of the Higgins AttributeDefinition.class), as long as it contains the http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes and its values mentioned below. A context provider is free to add more values to the http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes attribute.
  • getEntityID() returns: the unique ID for this entity. This is http://www.w3.org/2000/01/rdf-schema#Property
  • getAttributes() returns: the following attributes:
    • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes: These values represent the types of attributes allowed on an attribute definition entity (note that a context provider may add to this set of values):
      • http://www.w3.org/2000/01/rdf-schema#range
      • http://www.w3.org/2000/01/rdf-schema#subPropertyOf
      • http://www.eclipse.org/higgins/ontologies/2008/6/higgins#validAttributes
  • getType() returns: the well-known identifier http://www.w3.org/2002/07/owl#Class
  • getTypeEntity() returns: an implementation of IEntity representing http://www.w3.org/2002/07/owl#Class. This object would be implemented by Higgins and thus would be the same for all context providers.

Then of course we have data value definitions. Again from the bottom-up, here's an entity that describes a value type called <TODO: finish this>

TODO

Back to the top