8.4.1 Non-Property type elements: graph, object, role, relationship
Non-Property types all have a similar structure for their own
element and its slot sub-elements. Let us look first at the main element and its
attributes:
<graph
description="A WatchApplication diagram defines the state automaton that implements a logical watch or a watch application."
id="Graph_ClockApplication_sysadmin_3150525787"
type="Graph_ClockApplication_sysadmin_3150525787"
typeName="WatchApplication">
The
description attribute contains the text
from the Description field of the Graph Tool etc. The
id attribute is used when referring to
this type elsewhere in the XML file: it need only be unique. The
type and
typeName attributes are used to name
the type, and to recognize it as matching an existing type, so the XML import
will update that type.
A type in an XML file is recognized as matching an
existing type of the same meta-type if either of the following is true: the
type attribute exactly matches the
internal name of the existing type, or the
typeName attribute matches the
user-visible name of the existing type. The GOPPRR meta-type names, e.g. Object,
may not be used as values for either attribute.
In general, we expect the
type attribute to be used only for
files exported from MetaEdit+. As internal type names are unique, they are also
used as the value of the id attribute
when exporting from MetaEdit+. For files created in other programs, simply
supply the typeName attribute, and any
unique string for the id attribute.
Each property in a type is represented with a
slot element providing information
about that slot, and containing a
property sub-element with the
definition of the property type (or an
href reference to it).
<slot
id="a0hedn"
name="Application name"
unique="false">
<property ...> ...
</property>
</slot>The slot
id is the internal name of the slot: it
can be composed of letters and numbers, but must begin with a letter. If
omitted, MetaEdit+ will create naïve names p1, p2 etc., but if imported
types are edited and re-imported, there is a possibility that the naïve
name will clash with an earlier name. The
name attribute is the local name of
that property in this type, and
unique
specifies whether values of the property must be unique over all instances of
this type (checked only when manually creating new
instances).