patternLibrary is the root element for describing a library of patterns.
patternLibrary can contain 0 or 1 header elements where meta-data about the patternLibrary can be recorded (e.g. author, creation date). The patternLibrary element must contain 1 or more pattern elements which make up the patternLibrary.
ontology has 2 attributes: id and label. id doesn't currently serve any purpose, but eventually it could be a uuid. Label is just a pretty name for the ontology, which will probably be the ontology name plus version number.
ontology can contain 0 or more class elements OR just content. The idea is that if that the ontology can actually be included in the pattern so that the document is complete. Alternatively the ontology elelemnt can hold information about the ontology. This is where a URI for the ontology could be placed.
pattern is the main element and can be used to represent an uninstantiated pattern and a instantiated pattern. That is, a pattern editor could produce a pattern that has as its root a pattern element. When this pattern is matched the detailed pattern match information (e.g. which data element matched a particular node) can also have a pattern element as its root (the pattern here would be just those edge/nodes that matched). pattern has 3 attributes: id, uri and label. We see the current use of id will be to give a unique id to a pattern for the document. This is likely to a unique id from the application that developed the pattern currently. In the future it should be a uuid. URI is the URI pointer to the pattern if it exists. URI could be used in the context of documents which don't necessarily include the pattern, just reference it. Label is just a pretty name for the pattern, which could include version information.
pattern can contain 0 or more header elements. This is designed to allow for pattern meta-data to be included (e.g. author, creation date). The pattern can also contain 0 or 1 ontology elements, where the ontology used for the patternLibrary can be given (either the actual ontology or a reference). The pattern must contain 0 or 1 body elements where the pattern nodes and edges are actually given. A pattern may also conatin 0 or more property elements. Property elements are currently a catch all placeholder for extra information about the pattern.
header is designed to hold meta-data (e.g. creation-date, author). This can be specified using free-text, or using other xml elements. We can forsee user placing Dublin Core and other meta-data standard elements eventually within this element.
body conatins the body of the graph. The body element can contain 1 or more node elements and 0 or more edge elements. That is the minimum body for a graph is 1 node.
A node element can have 2 attributes: id (required) and label. The id is aunique identifer within a document and is required. It will be likely used to record an application specific node id for now. Eventually it should be a uuid. Label is just a pretty name for the node, which is what visualizers will use when displaying the node.
A node element can contain 6 different types of elements in the following sequence: instanceOf, value, position, dimension, properties, origin. instanceOf is is class information about the node (a node can be an instanceOf multiple classes). The value element is where the pattern match information is recorded. Position and dimension are visualizer specfic information. Properties are a catch all placeholder for extra information about the node.
Catch all for extra information. Can conatin anything -- text or other elements.
Cardinality decribes the minimum and maximum number of items that can be the value for an element. In patternML this is used mainly to dfine graphs where the cardinality is attached as a property of the node, allowing the user to specify that a min/max number of nodes of this type can occur. This capability allows n-m relations to be modelled.
An edge can have 6 attributes: id (required), label, relname, from (required), to (required) and directed. The edge id is a unique identifier -- probably application specific for now but will eventually be a uuid. Label is a pretty string. Relname is the name (string) of the link that this edge represents. From is a reference to the id of the node where the edge comes from,; to is a reference to the id of the node where the edge goes to. If the edge is undirected, it doesn't matter which is put where. The final attribute is directed -- this is a boolean. Edges can't be bi-directional, only directed or undirected.
An edge element can contain 4 different types of elements in the following sequence: position, dimension, properties,origin. All are optional. Origin (0 or more allowed) allows a node/edge defined in another pattern to be referenced in this pattern. Position and dimension are visualizer specfic information. Properties are a catch all placeholder for extra information about the node.
A class element can have 2 attributes: id (required) and label. id is the unique id of a class and will be application specific for now. Eventually it'll be a uuid. Label is a pretty string name of the class.
A class element can conatin 0 or more subclassOf elements that define the superclasses of this class.
A subClassOf element has one attribute classid, (required) that is the reference to the id of the superclass. This will be an id in the document - -appplication specific for now but eventually will be a uuid. A subClassOf element must be empty (i.e can not contain any elements or text)
An instanceOf element has one attribute, classid(required,) that is the reference to the id of the class that the element is an instance of. This will be an id in the document -- appplication specific for now but eventually will be a uuid.
An instanceOf element can contain 0 or 1 origin elements. An Origin element here would be used to refer to the class that the node is an instance of, where the class is defined in another pattern.
A position element has 3 optional attributes - x,y,z, which are the screen position of the center of the object. A position element must be empty (i.e can not contain any elements or text). x,y, and z are going to be application specific depending on the coordinate system used by each application, but are of use to visualizers that use the same coordinate system
A dimension element has 3 optional attributes - width, height and depth. A dimension element must be empty (i.e can not contain any elements or text). width, height and depth are the screen dimensions of the object. These are going to be application specific depending on the coordinate system used by each application, but are of use to visualizers that use the same coordinate system
An origin element has 2 attributes patternId and referenceId (both required). An origin element must be empty (i.e can not contain any elements or text). An origin element is used to reference an object that is defined elsewhere. The patternId is a unique identifier of the pattern where the object is defined (unique to a document/application for now -- uuid eventually). The referenceId is a unique identifier of the object in the pattern where the object is defined (unique to a document/application for now -- uuid eventually).
A value element is used to hold the match between the object and a data object. Currently this element can hold anything - text or elements, allowing different ways of recording the data element that matched.