|
Ric Holt
, Andy
Schürr, Susan
Elliott Sim, Andreas
Winter
Graph eXchange Language |
||
|
|
|||
![]() Background Introduction FAQ Examples Publications ![]() DTD XML Schema ![]() Graph Model Metaschema ![]() Tool Catalogue Downloads ![]() Change Requests Future GXL 1.1
|
GXL (1.0) Document Type Definition (Dagstuhl Edition, April 25, 2002) uncommented document type definition: gxl-1.0.dtd copyright by Andy SchuerrGXL has been developed to be an open standard. No licensing or other legal arrangements are required for its use, whether commercial and non-commercial. The specification of GXL is copyright by its authors, to allow control of its evolution. The specification can be reproduced and used without charge, but with explicit acknowledgement of its authors. --> <!-- Extensions --><!ENTITY % gxl-extension "" ><!ENTITY % graph-extension "" > <!ENTITY % node-extension "" > <!ENTITY % edge-extension "" > <!ENTITY % rel-extension "" > <!ENTITY % value-extension "" > <!ENTITY % relend-extension "" > <!ENTITY % gxl-attr-extension "" >
<!--
Extending GXL by redefining these macros facilitates specializations of GXL e.g. for graph transformation and graph drawing. Warning: Using extensions results
in a DTD that deviates from the predefined GXL standard. In general, extensions
are not supported by GXL tools and should be used with care.
<!-- Attribute values --><!ENTITY % val "locator | bool | int | float | string | enum | seq | set | bag | tup %value-extension;"> <!--
Additional data types can be adding by redefining %value-extension;.
<!-- gxl --><!ELEMENT gxl (graph* %gxl-extension;) ><!ATTLIST gxl xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" %gxl-attr-extension; > <!--
GXL uses XLink to refer to object possibly defined outside the current GXL document. This requires declaration of XLink namespace. The fixed xmlns:xlink attribute makes the prefix xlink available within the gxl element. The XLink attributes can now be used in GXL documents (including their definition in the DTD) as xlink:[attribute] XML requires all identifiers used in one document (not in one graph) to be disjoint. Consequently, identifiers must be unique across graphs in GXL documents containing multiple graphs. GXL forbids references between graph elements of different graphs in the same document except for type allocation and within locator attributes. Further elements may be added to GXL documents by redefining %gxl-extension;. Further attributes of GXL documents can be added by redefining %gxl-attr-extension;. --> <!-- type --><!ELEMENT type EMPTY><!ATTLIST type xlink:type (simple) #FIXED "simple" xlink:href CDATA #REQUIRED > <!--
There are restrictions on what the correspendences that can be established using the type entity; in other words, the type entity cannot be used to create relationships arbitrarily between any entity in the instance graph and any entity in the schema. Specifically, GXL requires type elements associated with a
--> <!-- graph --><!ELEMENT graph (type? , attr* , ( node | edge | rel )* %graph-extension;) ><!ATTLIST graph id ID #REQUIRED role NMTOKEN #IMPLIED edgeids ( true | false ) "false" hypergraph ( true | false ) "false" edgemode ( directed | undirected | defaultdirected | defaultundirected) "directed" %graph-attr-extension; > <!--
A graph may link to its schema, which is accessible by following the xlink:href link defined in its (optional) type element. GXL requires that the resource which is accessible by this link is a schema graph document (i.e. a GXL graph matching the GXL meta schema). A graph contains a possibly empty list of attributes, and a possibly empty list of nodes, edges, or relations. A role may be specified for graph, for example, if it is a component of a hierarchical graph. The edgeids attribute is true for graphs where edges and relations possess their own identifiers, it is "false" for graphs without edge or relation identifiers. The hypergraph parameter allows the existence of hyperedges if its value is "true". Hyperedges are general relationships which connect an arbitrary number of elements instead of two elements (in the case directed or undirected edges). The edgemode attribute indicates how the edges or hyperedges of the current graph are interpreted. edgemode = "directed" or edgemode = "undirected" indicates that all edges and hyperedges are interpreted as directed or undirected edges. In this case, overwriting the interpretation of specific edges and relations is impossible. If edgemode = "defaultdirected" or edgemode = "defaultundirected", it is possible to overwrite the interpretation of edge orientations for specific edges and relations. By redefining %graph-extension; further
sub-elements may be added to graph
elements. Further attributes of graphs can be added by redefining %graph-attr-extension;.
<!-- node --><!ELEMENT node (type? , attr*, graph* %node-extension;) ><!ATTLIST node id ID #REQUIRED %node-attr-extension; > <!--
A node may link to its node type, using the xlink:href link defined in its (optional) type element. GXL requires the target element to define a node type in the corresponding schema graph. Finally, a node has a node unique identifier id. Graph elements associated to a node, represent graphs on a lower level of hierarchy. A node can be associated with multiple child graphs. Their structure has to follow the graph class specifying the type of the sub graph. By redefining %node-extension; further
sub elements may be added to node elements.
Further attributes of node elements can be added by redefining %node-attr-extension;.
<!-- edge --><!ELEMENT edge (type?, attr*, graph* %edge-extension;) ><!ATTLIST edge id ID #IMPLIED from IDREF #REQUIRED to IDREF #REQUIRED fromorder CDATA #IMPLIED toorder CDATA #IMPLIED isdirected ( true | false ) #IMPLIED %edge-attr-extension; > <!--
An edge may link to its edge type, which is accessible by following the xlink:href link defined in its (optional) type element. GXL requires the target element to define an edge type in the corresponding schema graph. Edges may have an edgeid (mandatory for graphs with edgeids = "true"). Each edge contains a possibly empty list of attributes, and an optional list of graphs. The two graph elements (node, edge, relation) connected by an edge are accessed by following the reference defined in the from- and to-attributes. GXL only allows from/to connections within the same GXL graph element, including components of hierarchical graphs. Those edges point from the graph element referenced in the from attribute to the graph element referenced in the to attributes. In graphs where edges must be traverse in a fixed order, the ordering of incidences is recorded using the fromorder and toorder attributes. The order of incidence on the entity that the edge came from is given by the fromorder, and the order of incidence on the entity that the edge is going to is given toorder attribute. Since incidence information is stored on the edges (and relends), the collection of values in the fromorder and toorder attributes of all edges (and endorder attributes of all relends) incident to a node must define a proper ordering of these incidences. The values of fromorder and toorder are required to be numbers. The isdirected attribute is used to specify an edgemode (directed or undirected) for an edge where it does not conflict with the edgemode attribute of the surrounding graph element. If surrounding graph has been set to edgemode = "directed" or edgemode = "undirected" the edge orientation MUST follow this specification. If edgemode = "defaultdirected" or edgemode = "defaultundirected", this predefined orientation can overwritten using the isdirected attribute. Graph elements are associated with an edge to represent graphs on a lower level of hierarchy. An edge can be associated with multiple child graphs. Their structure has to follow the graph class specifying the type of the sub graph. By redefining %edge-extension; further
sub-elements may be added to edge elements.
Further attributes of edge elements can be added by redefining %edge-attr-extension;.
<!-- rel --><!ELEMENT rel (type? , attr*, graph*, relend* %rel-extension;) ><!ATTLIST rel id ID #IMPLIED isdirected ( true | false ) #IMPLIED %rel-attr-extension; > <!--
A rel may link to its rel type, which is accessible by following the xlink:href relend defined in its (optional) type element. GXL requires that the element which is accessible by this xlink defines a relation type in the corresponding schema graph. Relations may possess an edge id. Each rel contains a possibly empty list of attributes, an optional list of graphs, and a possibly empty list of incident relation ends (relend). These relends are often also called "tentacles" (or "columns" by a database designer). GXL distinguishes between incoming and outgoing relends. Further sub-elements may be added to relation elements, by redefining %rel-extension; . The isdirected attribute is used to specify an edgemode (directed or undirected) for a relation where it does not conflict with the edgemode attribute of the surrounding graph element. If the surrounding graph has been set to edgemode = "directed" or edgemode = "undirected" the relation orientation must follow this specification. If edgemode = "defaultdirected" or edgemode = "defaultundirected", this predefined orientation can be overwritten using the isdirectedattribute. Please note, that graphs are directed by default while relations are undirected by default. Thus, we recommend to define the edgemode for relations explicitly. Graph elements associated to a relation, represent graphs on a lower level of hierarchy. An relation can be associated with multiple child graphs. Their structure has to follow the graph class specifying the type of the sub graph. By redefining %rel-extension; further
sub-elements may be added to rel elements.
Further attributes (of relation elements) can be added by redefining
%rel-attr-extension;.
<!-- relend --><!ELEMENT relend (attr* %relend-extension;) ><!ATTLIST relend target IDREF #REQUIRED role NMTOKEN #IMPLIED direction ( in | out | none) #IMPLIED startorder CDATA #IMPLIED endorder CDATA #IMPLIED %relend-attr-extension; > <!--
A relend may have its own attributes (e.g. for layout data on the instance level). Further sub-elements may be added to relend elements by redefining %relend-extension; . A single relend element defines an incidence together with its optional role (name/tentacle/relend name) and direction according the covering relation element. Although the role attribute is defined as optional, the GXL Validator expects that all relation ends have a role and prints an error otherwise. GXL distinguishes between incoming and outgoing relends. Relends with direction = "in" model tentacles pointing into the relation, and relends with direction = "out" model tentacles pointing out of the relation. Missing direction value or direction = "none" indicates undirected tentacles. A direction attribute is required for relends contained in a relation element with isdirected = "true". They are ignored for those relends contained in a relation element with isdirected ="false". The same holds for those relations whose orientation is inherited from the surrounding graph element. The target attribute refers to those graph elements which are incident to the parent rel. To facilitate relations between edges and rel's the references are not restricted to node elements only. Here GXL provides node, edge and rel elements. The ordering of relends according their target (association end) is given by the endorder attribute. The ordering of relends according their incident relation (association start) is given by the startorder attribute. The incidence order for a given node is given in by the collection of all endorder attributes of relends (and fromorder and toorder attributes of edges) incident to a the node; these attributes together must define a proper ordering of incidences. Analogously, all values of startorder attributes of relends incident to a given relation have to define a proper ordering. The values of startorder and endorder must be numbers. Further attributes (of relend elements) can be added by redefining
%relend-attr-extension;.
<!-- attr --><!ELEMENT attr (attr*, (%val;)) ><!ATTLIST attr id ID #IMPLIED name NMTOKEN #REQUIRED kind NMTOKEN #IMPLIED > <!--
The kind attribute is provided to distinguish between different
varieties of attributes, for example, to mark attributes as derived.
GXL also optionally supports direct access to attributes by unique attribute
identifiers.
<!-- locator --><!ELEMENT locator EMPTY ><!ATTLIST locator xlink:type (simple) #FIXED "simple" xlink:href CDATA #REQUIRED > <!--
<!-- atomic values --><!ELEMENT bool (#PCDATA) ><!ELEMENT int (#PCDATA) > <!ELEMENT float (#PCDATA) > <!ELEMENT string (#PCDATA) > <!--
DIGIT ::= "0" | ... | "9" NONZERODIGIT ::= "1" | ... | "9" DIGITS ::= DIGIT+ INT ::= ["+"|"-"]("0" | NONZERODIGIT DIGIT*) FLOAT ::= ["+"|"-"] (( DIGITS [ "." DIGITS ] ) | ("." DIGITS) [("E" | "e") ["+"|"-"] DIGITS]
<!-- enumeration value --><!ELEMENT enum (#PCDATA) ><!--
<!-- composite values --><!ELEMENT seq (%val;)* ><!ELEMENT set (%val;)* > <!ELEMENT bag (%val;)* > <!ELEMENT tup (%val;)* > <!--
<!-- (S. Sim, A. Winter - April 17, 2001) --> |
||
|
|||
|
July 17, 2002
[change log] |
|
||