TEI: Guidelines for Electronic Text Encoding and Interchange

P5 Version 4.10.2. Last updated on 4th September 2025, revision bcfa98f42

<graph>

<graph> (graph) encodes a graph, which is a collection of nodes, and arcs which connect the nodes. [20.1 Graphs and Digraphs]
Module nets — Graphs, Networks, and Trees
Attributes
type type⚓︎ describes the type of graph.
Derived from att.typed
Status Recommended
Suggested values include:
undirected
undirected graph
directed
directed graph
transitionNetwork
a directed graph with distinguished initial and final nodes
transducer
a transition network with up to two labels on each arc
Note

If type is specified as undirected, then the distinction between the to and from attributes of the arc tag is neutralized. Also, the adj attribute, rather than the adjFrom and adjTo attributes, should be used to encode pointers to the ends of the arcs. If type is specified as directed (or any other value which implies directionality), then the adjFrom and adjTo attributes should be used, instead of the adj attribute.

order order⚓︎ states the order of the graph, i.e., the number of its nodes.
Status Optional
Datatype teidata.count
size size⚓︎ states the size of the graph, i.e., the number of its arcs.
Status Optional
Datatype teidata.count
Note

One or more nodes and zero or more arcs in any order.

Example
<graph xml:id="cug1" type="undirected"
order="5" size="4"
rend="LABEL-PLACE bottom center NODE-FRAME none ARC solid line">

<label>Airline Connections in Southwestern USA</label>
<node xml:id="lax" degree="2">
<label>LAX</label>
</node>
<node xml:id="lvg" degree="2">
<label>LVG</label>
</node>
<node xml:id="phx" degree="3">
<label>PHX</label>
</node>
<node xml:id="tus" degree="1">
<label>TUS</label>
</node>
<node xml:id="cib" degree="0">
<label>CIB</label>
</node>
<arc from="#lax" to="#lvg"/>
<arc from="#lax" to="#phx"/>
<arc from="#lvg" to="#phx"/>
<arc from="#phx" to="#tus"/>
</graph>
Content model
<content>
<sequence>
<sequence minOccurs="0">
<elementRef key="label"/>
<classRef key="model.global"
minOccurs="0" maxOccurs="unbounded"/>

</sequence>
<alternate>
<sequence>
<sequence minOccurs="1"
maxOccurs="unbounded">

<elementRef key="node"/>
<classRef key="model.global"
minOccurs="0" maxOccurs="unbounded"/>

</sequence>
<sequence minOccurs="0"
maxOccurs="unbounded">

<elementRef key="arc"/>
<classRef key="model.global"
minOccurs="0" maxOccurs="unbounded"/>

</sequence>
</sequence>
<sequence>
<sequence minOccurs="1"
maxOccurs="unbounded">

<elementRef key="arc"/>
<classRef key="model.global"
minOccurs="0" maxOccurs="unbounded"/>

</sequence>
<sequence minOccurs="1"
maxOccurs="unbounded">

<elementRef key="node"/>
<classRef key="model.global"
minOccurs="0" maxOccurs="unbounded"/>

</sequence>
</sequence>
</alternate>
</sequence>
</content>
Schema Declaration
<rng:element name="graph">
<rng:ref name="att.global.attributes"/>
<rng:ref name="att.global.analytic.attributes"/>
<rng:ref name="att.global.change.attributes"/>
<rng:ref name="att.global.facs.attributes"/>
<rng:ref name="att.global.linking.attributes"/>
<rng:ref name="att.global.rendition.attributes"/>
<rng:ref name="att.global.responsibility.attributes"/>
<rng:ref name="att.global.source.attributes"/>
<rng:ref name="att.typed.attribute.subtype"/>
<rng:optional>
<rng:attribute name="type">
<rng:choice>
<rng:value>undirected</rng:value>
<rng:value>directed</rng:value>
<rng:value>transitionNetwork</rng:value>
<rng:value>transducer</rng:value>
<rng:ref name="teidata.enumerated"/>
</rng:choice>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:attribute name="order">
<rng:ref name="teidata.count"/>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:attribute name="size">
<rng:ref name="teidata.count"/>
</rng:attribute>
</rng:optional>
<rng:group>
<rng:group>
<rng:optional>
<rng:ref name="label"/>
<rng:zeroOrMore>
<rng:ref name="model.global"/>
</rng:zeroOrMore>
</rng:optional>
</rng:group>
<rng:choice>
<rng:group>
<rng:group>
<rng:oneOrMore>
<rng:ref name="node"/>
<rng:zeroOrMore>
<rng:ref name="model.global"/>
</rng:zeroOrMore>
</rng:oneOrMore>
</rng:group>
<rng:group>
<rng:zeroOrMore>
<rng:ref name="arc"/>
<rng:zeroOrMore>
<rng:ref name="model.global"/>
</rng:zeroOrMore>
</rng:zeroOrMore>
</rng:group>
</rng:group>
<rng:group>
<rng:group>
<rng:oneOrMore>
<rng:ref name="arc"/>
<rng:zeroOrMore>
<rng:ref name="model.global"/>
</rng:zeroOrMore>
</rng:oneOrMore>
</rng:group>
<rng:group>
<rng:oneOrMore>
<rng:ref name="node"/>
<rng:zeroOrMore>
<rng:ref name="model.global"/>
</rng:zeroOrMore>
</rng:oneOrMore>
</rng:group>
</rng:group>
</rng:choice>
</rng:group>
</rng:element>
element graph
{
 att.global.attributes,
 att.global.analytic.attributes,
 att.global.change.attributes,
 att.global.facs.attributes,
 att.global.linking.attributes,
 att.global.rendition.attributes,
 att.global.responsibility.attributes,
 att.global.source.attributes,
 att.typed.attribute.subtype,
 attribute type
 {
 "undirected"
 | "directed"
 | "transitionNetwork"
 | "transducer"
 | teidata.enumerated
 }?,
 attribute order { teidata.count }?,
 attribute size { teidata.count }?,
 (
 ( ( label, model.global* )? ),
 (
 ( ( ( node, model.global* )+ ), ( ( arc, model.global* )* ) )
 | ( ( ( arc, model.global* )+ ), ( ( node, model.global* )+ ) )
 )
 )
}

[English] [Deutsch] [Español] [Italiano] [Français] [日本語] [한국어] [中文]



TEI Guidelines P5 Version 4.10.2. Last updated on 4th September 2025, revision bcfa98f42. This page generated on 2025年09月04日T16:27:03Z.

AltStyle によって変換されたページ (->オリジナル) /