Quick links: Tutorial - Examples - Files - Symbols.
Classes: Hierarchy - Index - List - Members.
Namespaces: Index - base - cs - display.
Cette page est disponible en français.

CoGXML Format

Introduction

XML language (eXtensible Markup Language) allows representation of structured data. An XML document is a tree like representation of objects. It can be considered as valid and well formed. Valid means that it is in accordance to a DTD (Document Type Definition). A DTD is used to define the structure and the type of the tags of an XML document. To be valid, the XML document must respect the definitions set up in its DTD.
The CoGXML format allows representation of conceptual graphs in the format of XML documents. The defined DTD allows representation of supports (a support is a set of partially ordered concept types, relation types, nested types, signature of relation types and conformity relations), representation of graphs (connexe or non connexe, simple or nested) and representation of rules.
What was called CGXML in previous versions of Cogitant, is now called CoGXML. Originally, they were 2 formats named CGXML, both allowing represention of conceptual graphs in XML documents (http://tockit.sourceforge.net/cgxml/). However the formats were differen. Therefore to avoid confusion, CGXML was renamed CoGXML.

General look of a GoGXML file

As any XLM files, a CoGXML file contains an XML header specifying the XML version and the DTD associated. Then comes the <CoGXML> tag. This tag contains declarations of supports, graphs and rules. The GoGXML file is ended by a </CoGXML> tag.

<?xml version="1.0"?>
<!DOCTYPE cogxml PUBLIC "-//COGITANT//CoGXML Format Specification 1.3//EN" "http://cogitant.sourceforge.net/cogxml.dtd">
<cogxml>
.../...
</cogxml>

The objects of the model are represented by different tags and attributes. The CoGXML format offers the possibility to locate information concerning objects ( for example : concept type, relation type, nesting type) thanks to an explicit labelling and identifying system. As show in the example below, concerning the description of objects linked to concept types, the relation of order between concept types can be described either by a set of tags order having attributes id1 and id2 (identifiers of concept types) or by a set of tags order having attributes label1 and label2. The later example is describing the concept types by their full name.

<order id1="c1" id2="c0"/>
<order label1="Action" label2="T"/>

As in any XML files, predefined entities allow representations of special characters so they are not mistaken with tags. Characters such as & < > ' and " have to be represented respectively by &amp; &lt; &gt; &apos; and &quot;.

Look of a CoGXML support

A support is made of a set of partially ordered concept types, a set of partially ordered relation types, a set of partially ordered nesting types, signatures of relation types and a conformity relation.

<!DOCTYPE cogxml PUBLIC "-//COGITANT//CoGXML Format Specification 1.3//EN" "http://cogitant.sourceforge.net/cogxml.dtd">

As a system can use several supports, an identifier is given to each support via the name attribute.

<support name="Bucolic">

Look of a CoGXML set of partially ordered concept types

A set of partially ordered concept types is represented by the element conceptTypes in which are included elements ctype and order. The ctype elements describe identifiers and labels of all concept types in the set. ctype contains the attributes id (identifiers in the CoGXML file) and label (label of concept types). As an option, a ctype element can contain a translation element which stores translations of concept types in different languages. The language used is indicated in the lang attribute and the actual translation is given in the label attribute. Another optional attribute is descr. it allows to describe the language used.
The order elements define a relation of order between concept types in specifying pairs of which the first element in less than the second. The order elements are optional and are not found if elements of a set are not comparable. Every order element contains either the id1 et id2 attributes (identifiers of concept types) or the label1 et label2 attributes (labels of concept types).

<conceptTypes>
<ctype id="c0" label="Universal"/>
<ctype id="c1" label="Action"/>
<ctype id="c2" label="Attribute">
<translation lang="fr" label="Attribut"/>
</ctype>
<ctype id="c3" label="Boat">
<translation lang="fr" label="Bateau"/>
</ctype>
<ctype id="c4" label="Bucolic">
<translation lang="fr" label="Bucolique"/>
</ctype>
<ctype id="c5" label="Couple"/>
<ctype id="c6" label="Entity">
<translation lang="fr" label="Entité"/>
</ctype>
<ctype id="c7" label="Fish">
<translation lang="fr" label="Pêcher"/>
</ctype>
<ctype id="c8" label="Lake">
<translation lang="fr" label="Lac"/>
</ctype>
<ctype id="c9" label="Living being">
<translation lang="fr" label="Être vivant"/>
</ctype>
<ctype id="c10" label="Painting">
<translation lang="fr" label="Tableau"/>
</ctype>
<ctype id="pers" label="Person">
<translation lang="fr" label="Personne"/>
</ctype>
<ctype id="c12" label="Place">
<translation lang="fr" label="Lieu"/>
</ctype>
<ctype id="c13" label="Scene">
<translation lang="fr" label="Scène"/>
</ctype>
<ctype id="c14" label="Sleep">
<translation lang="fr" label="Dormir"/>
</ctype>
<ctype id="c15" label="Think">
<translation lang="fr" label="Penser"/>
</ctype>
<ctype id="c16" label="Truit">
<translation lang="fr" label="Truite"/>
</ctype>
<order id1="c1" id2="c0"/>
<order id1="c2" id2="c0"/>
<order id1="c6" id2="c0"/>
<order id1="c15" id2="c1"/>
<order id1="c14" id2="c1"/>
<order id1="c7" id2="c1"/>
<order id1="c4" id2="c2"/>
<order id1="c13" id2="c6"/>
<order id1="c5" id2="c6"/>
<order id1="c3" id2="c6"/>
<order id1="c12" id2="c6"/>
<order id1="c10" id2="c6"/>
<order id1="c9" id2="c6"/>
<order id1="pers" id2="c9"/>
<order id1="c16" id2="c9"/>
<order id1="c8" id2="c12"/>
</conceptTypes>

In one file, all order elements must be defined in the same manner.

<conceptTypes>
<ctype id="c0" label="Universal"/>
<ctype id="c1" label="Action"/>
<ctype id="c2" label="Attribute">
<translation lang="fr" label="Attribut"/>
</ctype>
<ctype id="c3" label="Boat">
<translation lang="fr" label="Bateau"/>
</ctype>
<ctype id="c4" label="Bucolic">
<translation lang="fr" label="Bucolique"/>
</ctype>
<ctype id="c5" label="Couple"/>
<ctype id="c6" label="Entity">
<translation lang="fr" label="Entité"/>
</ctype>
<ctype id="c7" label="Fish">
<translation lang="fr" label="Pêcher"/>
</ctype>
<ctype id="c8" label="Lake">
<translation lang="fr" label="Lac"/>
</ctype>
<ctype id="c9" label="Living being">
<translation lang="fr" label="Être vivant"/>
</ctype>
<ctype id="c10" label="Painting">
<translation lang="fr" label="Tableau"/>
</ctype>
<ctype id="pers" label="Person">
<translation lang="fr" label="Personne"/>
</ctype>
<ctype id="c12" label="Place">
<translation lang="fr" label="Lieu"/>
</ctype>
<ctype id="c13" label="Scene">
<translation lang="fr" label="Scène"/>
</ctype>
<ctype id="c14" label="Sleep">
<translation lang="fr" label="Dormir"/>
</ctype>
<ctype id="c15" label="Think">
<translation lang="fr" label="Penser"/>
</ctype>
<ctype id="c16" label="Truit">
<translation lang="fr" label="Truite"/>
</ctype>
<order label1="Action" label2="Universal"/>
<order label1="Attribute" label2="Universal"/>
<order label1="Entity" label2="Universal"/>
<order label1="Think" label2="Action"/>
<order label1="Sleep" label2="Action"/>
<order label1="Fish" label2="Action"/>
<order label1="Bucolic" label2="Attribute"/>
<order label1="Scene" label2="Entity"/>
<order label1="Couple" label2="Entity"/>
<order label1="Boat" label2="Entity"/>
<order label1="Place" label2="Entity"/>
<order label1="Painting" label2="Entity"/>
<order label1="Living being" label2="Entity"/>
<order label1="Person" label2="Living being"/>
<order label1="Truit" label2="Living being"/>
<order label1="Lake" label2="Place"/>
</conceptTypes>

Look of a CoGXML set of partially ordered relation types

A set of partially ordered relation types is represented by the tag relationTypes in which are included tags rtype and order. The rtype tag describe the identifier and the label of a relation types and its signature in the set (the signature is optional). The signature property can be described either by the idSignature attribute or by the labelSignature attribute. The tag rtype also contains id and label attributes. Translation in different languages are indicated in a similar way as for concept types, using the translation element.
The order tags define a relation of order between relation types in specifying pairs of which the first element in less than the second. These tags are optional and are not found if elements of a set are not comparable.

<relationTypes>
<rtype id="r0" label="agent" idSignature="c1 c9"/>
<rtype id="r1" label="attr" idSignature="c6 c2"/>
<rtype id="r2" label="in" idSignature="c6 c12">
<translation lang="fr" label="dans"/>
</rtype>
<rtype id="r3" label="object" idSignature="c1 c6">
<translation lang="fr" label="objet"/>
</rtype>
<rtype id="r4" label="on" idSignature="c6 c12">
<translation lang="fr" label="sur"/>
</rtype>
<rtype id="r5" label="weight" idSignature="c6 float">
<translation lang="fr" label="poids"/>
</rtype>
<rtype id="r6" label="name" idSignature="c6 string">
<translation lang="fr" label="nom"/>
</rtype>
<rtype id="r7" label="age" idSignature="c9 integer">
<translation lang="fr" label="age"/>
</rtype>
<rtype id="r8" label="loc" idSignature="c1 c12">
<translation lang="fr" label="lieu"/>
</rtype>
<rtype id="r9" label="desc" idSignature="c0 literal"/>
</relationTypes>

In one file, all order tags must be defined in the same manner.

<relationTypes>
<rtype id="r0" label="agent" labelSignature="Action Living\ being"/>
<rtype id="r1" label="attr" labelSignature="Entity Attribute"/>
<rtype id="r2" label="in" labelSignature="Entity Place">
<translation lang="fr" label="dans"/>
</rtype>
<rtype id="r3" label="object" labelSignature="Action Entity">
<translation lang="fr" label="objet"/>
</rtype>
<rtype id="r4" label="on" labelSignature="Entity Place">
<translation lang="fr" label="sur"/>
</rtype>
<rtype id="r5" label="weight" labelSignature="Entity float">
<translation lang="fr" label="poids"/>
</rtype>
<rtype id="r6" label="name" labelSignature="Entity string">
<translation lang="fr" label="nom"/>
</rtype>
<rtype id="r7" label="age" labelSignature="Living\ being integer">
<translation lang="fr" label="age"/>
</rtype>
<rtype id="r8" label="loc" labelSignature="Action Place">
<translation lang="fr" label="lieu"/>
</rtype>
<rtype id="r9" label="desc" labelSignature="Universal literal">
</rtype>
</relationTypes>

Concerning the definition of the relation type signature by the concept type labels (attribute labelSignature), if a concept type label contains one or more spaces, those spaces will have to be preceded by antislash. In fact, spaces are used to separate different concept type labels, in the attribute value labelSignature, therefore inside a concept type label, spaces have been replaced by escape characters. As a consequence, all occurrences of the antislash character would have to be protected by another antislash. If some types of a signature are conjunctive types, primitive types that compose the conjunctive type are separated by ;.

<rtype id="r0" label="agent" labelSignature="Action Living\ being"/>

Look of a CoGXML set of partially ordered nesting types

A set of partially ordered nesting types is represented by the tag nestingTypes in which are included tags ntype and order. The ntype tag describes the identifiers and the labels of nesting types in the set. The ntype tag also contains id and label attributes. Translations in different languages are indicated in a similar way as for other types of support. The order tags define a relation of order between nesting types in specifying pairs of which the first element in less than the second. These tags are optional and are not found if elements of a set are not comparable. Every order element contains either the id1 and id2 attributes or the label1 et label2 attributes.

<nestingTypes>
<ntype id="n0" label="Description"/>
<ntype id="n1" label="Component">
<translation lang="fr" label="Composant"/>
</ntype>
<ntype id="n2" label="Representation">
<translation lang="fr" label="Représentation"/>
</ntype>
<order id1="n1" id2="n0"/>
<order id1="n2" id2="n0"/>
</nestingTypes>

In one file, all order tags must be defined in the same manner.

<nestingTypes>
<ntype id="n0" label="Description"/>
<ntype id="n1" label="Component">
<translation lang="fr" label="Composant"/>
</ntype>
<ntype id="n2" label="Representation">
<translation lang="fr" label="Représentation"/>
</ntype>
<order label1="Component" label2="Description"/>
<order label1="Representation" label2="Description"/>
</nestingTypes>

Look of the CoGXML conformity relation

The conformity relation is represented by pairs made of an individual marker and an identifier of concept type. This means that a marker has for mimimum concept type, the specified concept type.
The marker tag contains the following attributes: id, label as well as idType or labelType depending on the type of representation. idType et labelType attributes are optional, this allowing declaration of an individual marker that would be not link to any concept types. If the declaration does not conform to the model, they may be benefits in not using the individual marker type, in the phase of the construction of the support.

<conformity>
<marker id="m0" label="Peter" idType="pers">
<translation lang="fr" label="Pierre"/>
</marker>
<marker id="m1" label="A" idType="c10"/>
<marker id="m2" label="Parker" idType="pers"/>
<marker id="m3" label="B" idType="c10"/>
</conformity>

<conformity>
<marker id="m0" label="Peter" labelType="Person">
<translation lang="fr" label="Pierre"/>
</marker>
<marker id="m1" label="A" labelType="Painting"/>
<marker id="m2" label="Parker" labelType="Person"/>
<marker id="m3" label="B" labelType="Painting"/>
</conformity>

Look of a CoGXML graph

A graph is made of a set of concept vertices, relation vertices and edges linking relation vertices and concept vertices.

<?xml version="1.0"?>
<!DOCTYPE cogxml PUBLIC "-//COGITANT//CoGXML Format Specification 1.1//EN" "http://cogitant.sourceforge.net/cogxml.dtd">
<cogxml>

In order to differentiate the different vertices, an unique identifier is given to every vertex. This can be done manually by the person keying in the graphs or automatically by a software saving or communicating with graphs. ??? .
The id attribute identifies the graph. Two other attributes are available: nature indicates the nature of the graph and set to group graphs by family or theme.

<graph id="g12" nature="fact" set="example">

Concept vertices of a graph

The concept vertices of a conceptual graph are represented by concept tag containing the following attributes:

<concept id="cn13" idType="pers" coreferenceClass="x1"></concept>
<concept id="cn14" idType="c14"></concept>
<concept id="cn15" idType="pers"></concept>
<concept id="cn16" idType="c7"></concept>
<concept id="cn17" idType="c8"></concept>

Concerning the representation of typed and nested graphs, the list of nestings contained in a concept summit must be represented by pairs of (nesting type and identifier of nested graph). The nesting tag with the idType or labelType attributes (identifier or label of nesting type) and the nestGraph attribute (identifier of the nested graph) describe the nesting type and the nested graph. The definition of the nested graph must come before the use of its identifier.

<concept id="cn10" idType="c5">
<nesting idType="n1" nestGraph="g12"/>
</concept>

relation vertices of a graph

The relation vertices of a conceptual graph are represented by relation tags containing the following attributes:

<relation id="rn18" idType="r0"/>
<relation id="rn19" idType="r0"/>
<relation id="rn20" idType="r2"/>

Set of edges

Edges linking relation vertices with concept vertices of a conceptual graph are represented by edge tags including the following attributes:

<edge label="1" rid="rn18" cid="cn14"/>
<edge label="2" rid="rn18" cid="cn13"/>
<edge label="1" rid="rn19" cid="cn16"/>
<edge label="2" rid="rn19" cid="cn15"/>
<edge label="1" rid="rn20" cid="cn16"/>
<edge label="2" rid="rn20" cid="cn17"/>

Look of a CoGXML rule

The rule of a conceptual graph is represented by a rule tag. Each rule has an identifier indicated by the id attribute.

<?xml version="1.0"?>
<!DOCTYPE cogxml PUBLIC "-//COGITANT//CoGXML Format Specification 1.1//EN" "http://cogitant.sourceforge.net/cogxml.dtd">
<cogxml>
<rule id="regle1">

A rule is made of three parts: the hypothesis graph, the conclusion graph and the links between these two graphs (anchorage points).
The hypothesis is recognised by the hypt tag. The hypt tags surround the graph description and tags.

<hypt>
<graph id="hypothese">
<concept id="cn1" idType="c9"></concept>
<concept id="cn2" idType="c9"></concept>
<concept id="cn3" idType="c9"></concept>
<relation id="rn4" idType="r9"/>
<relation id="rn5" idType="r9"/>
<edge label="1" rid="rn4" cid="cn1"/>
<edge label="2" rid="rn4" cid="cn2"/>
<edge label="1" rid="rn5" cid="cn2"/>
<edge label="2" rid="rn5" cid="cn3"/>
</graph>
</hypt>

The conclusion is recognised by the conc tag surrounding the graph description and tags.

<conc>
<graph id="conclusion">
<concept id="cn1" idType="c9"></concept>
<concept id="cn2" idType="c9"></concept>
<relation id="rn3" idType="r4"/>
<edge label="1" rid="rn3" cid="cn1"/>
<edge label="2" rid="rn3" cid="cn2"/>
</graph>
</conc>

The third part identify the anchorage points. It is identified by the conPts tags which surround couple tags. It lits pairs of vertice identifiers (generic concept) in which the first identifier in idC1 represent the vertice of the hypothesis graph and the second identifier idC2 represents a vertice of the conclusion graph. These pairs of vertices identify the anchorage points of the rule.

<conPts>
<couple idC1="cn1" idC2="cn1"/>
<couple idC1="cn3" idC2="cn2"/>
</conPts>

Rules and nested graphs

The hypothesis and/or the conclusion of a rule can contain nested graphs. In which case, the level 0 graph must be the last one declared in the hypothesis section and in the conclusion section. The rule below samples/xml/bucolic/nestedrule.xml) can be interpreted as follows: if a painting x represents a scene that can be described by an entity made of a person y who is sleeping, then the painting x is bucolic and the person y is thinking. Please note that the section ConnectionPoints which contains the pairs of identifiers of vertices. Those identifiers must be coherent with the structure of the hypothesis graphs and the conclusion graphs.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cogxml PUBLIC "-//COGITANT//CoGXML Format Specification 1.3//EN" "http://cogitant.sourceforge.net/cogxml.dtd">
<cogxml app="cogitant 5.1.91">
<rule id="nrule">
<hypt>
<graph id="hy1">
<concept id="cn10" idType="c11"/>
<concept id="cn11" idType="c14"/>
<relation id="rn12" idType="r0"/>
<edge label="1" rid="rn12" cid="cn11"/>
<edge label="2" rid="rn12" cid="cn10"/>
</graph>
<graph id="hy2">
<concept id="cn7" idType="c6">
<nesting idType="n1" nestGraph="hy1"/>
</concept>
</graph>
<graph id="hy3">
<concept id="cn4" idType="c13">
<nesting idType="n0" nestGraph="hy2"/>
</concept>
</graph>
<graph id="hy4">
<concept id="cn1" idType="c10">
<nesting idType="n2" nestGraph="hy3"/>
</concept>
</graph>
</hypt>
<conc>
<graph id="co1">
<concept id="cn10" idType="c11"/>
<concept id="cn11" idType="c15"/>
<relation id="rn12" idType="r0"/>
<edge label="1" rid="rn12" cid="cn11"/>
<edge label="2" rid="rn12" cid="cn10"/>
</graph>
<graph id="co2">
<concept id="cn7" idType="c6">
<nesting idType="n1" nestGraph="co1"/>
</concept>
</graph>
<graph id="co3">
<concept id="cn4" idType="c13">
<nesting idType="n0" nestGraph="co2"/>
</concept>
</graph>
<graph id="co4">
<concept id="cn1" idType="c10">
<nesting idType="n2" nestGraph="co3"/>
</concept>
<concept id="cn13" idType="c4"/>
<relation id="rn14" idType="r1"/>
<edge label="1" rid="rn14" cid="cn1"/>
<edge label="2" rid="rn14" cid="cn13"/>
</graph>
</conc>
<conPts>
<couple idC1="cn10" idC2="cn10"/>
<couple idC1="cn1" idC2="cn1"/>
</conPts>
</rule>
</cogxml>

CoGXML DTD

To refer to the CoGXML DTD when creating files in this format, please use the following syntax:

<!DOCTYPE CoGXML PUBLIC "-//COGITANT//CoGXML Format Specification 1.4//EN" "http://cogitant.sourceforge.net/cogxml.dtd">

The latest version of the DTD can be fount at : http://cogitant.sourceforge.net/cogxml.dtd
The format is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<!-- 

DTD CoGXML 1.5

This DTD allow representation of a support, representation of a conceptual graph and representation of graph rules.

To apply this DTD, use the following syntax:
<!DOCTYPE CoGXML PUBLIC "-//COGITANT//CoGXML Format Specification 1.4//EN" "http://cogitant.sourceforge.net/cogxml.dtd">

This file is part of Cogitant which is a library facilitating construction of applications using conceptual graphs.  It is under GPL licence.
http://cogitant.sourceforge.net
Cogitant version 5.2.91 - Last change of the DTD : 2011-04-18

-->

<!-- Attribute Extensions of standard tags. -->

<!ENTITY % cogxmlExtensions "">

<!ENTITY % supportExtensions "">
<!ENTITY % conceptTypesExtensions "">
<!ENTITY % relationTypesExtensions "">
<!ENTITY % nestingTypesExtensions "">
<!ENTITY % conformityExtensions "">
<!ENTITY % bannedTypesExtensions "">
<!ENTITY % allBannedExtensions "">
<!ENTITY % supportObjectExtensions "">
<!ENTITY % ctypeExtensions "">
<!ENTITY % rtypeExtensions "">
<!ENTITY % ntypeExtensions "">
<!ENTITY % markerExtensions "">
<!ENTITY % orderExtensions "">
<!ENTITY % bannedTypeExtensions "">
<!ENTITY % modulesExtensions "">
<!ENTITY % moduleExtensions "">

<!ENTITY % graphExtensions "">
<!ENTITY % environmentObjectExtensions "">
<!ENTITY % nodeExtensions "">
<!ENTITY % conceptExtensions "">
<!ENTITY % nestingExtensions "">
<!ENTITY % relationExtensions "">
<!ENTITY % edgeExtensions "">

<!ENTITY % ruleExtensions "">
<!ENTITY % positiveConstraintExtensions "">
<!ENTITY % negativeConstraintExtensions "">
<!ENTITY % conPtsExtensions "">
<!ENTITY % coupleExtensions "">

<!ENTITY % subPropExtensions "">


<!-- Document. -->

<!ELEMENT cogxml (support?, (graph | rule | positiveConstraint | negativeConstraint)*)>
<!ATTLIST cogxml
	app CDATA #IMPLIED
	%cogxmlExtensions;
>


<!-- Additional properties for each object of the model -->

<!ELEMENT subprop EMPTY>
<!ATTLIST subprop
	subid CDATA #REQUIRED
	%subPropExtensions;
>


<!-- Translation of an objet of the model. -->

<!ELEMENT translation EMPTY>
<!ATTLIST translation
	lang CDATA #REQUIRED
	label CDATA #REQUIRED
	descr CDATA #IMPLIED
>

<!-- Support.
	Add Attribute: if set to true, elements of the support are added to the
	previously loaded support. 
	If set to false (or not set at all), the elements of the support replace
	all previously loaded elements.-->
	
<!ELEMENT support (conceptTypes, relationTypes?, nestingTypes?, conformity?, bannedTypes?, modules?, subprop*)>
<!ATTLIST support
	name CDATA #IMPLIED
	add (true|false) "false"
	%supportExtensions;
>

<!ELEMENT conceptTypes (ctype*, order*)>
<!ATTLIST conceptTypes
	%conceptTypesExtensions;
>

<!ELEMENT ctype (translation*, subprop*)>
<!ATTLIST ctype
	id ID #IMPLIED
	label CDATA #REQUIRED
	%supportObjectExtensions;
	%ctypeExtensions;
>

<!ELEMENT order EMPTY>
<!ATTLIST order
	id1 IDREF #IMPLIED
	id2 IDREF #IMPLIED 
	label1 CDATA #IMPLIED 
	label2 CDATA #IMPLIED
>

<!ELEMENT relationTypes (rtype*, order*)>
<!ATTLIST relationTypes
	%relationTypesExtensions;
>

<!ELEMENT rtype (translation*, subprop*)>
<!ATTLIST rtype
	id ID #IMPLIED
	label CDATA #REQUIRED 
	idSignature CDATA #IMPLIED
	labelSignature CDATA #IMPLIED
	%supportObjectExtensions;
	%rtypeExtensions;
>

<!ELEMENT nestingTypes (ntype*, order*)>
<!ATTLIST nestingTypes
	%nestingTypesExtensions;
>

<!ELEMENT ntype (translation*, subprop*)>
<!ATTLIST ntype
	id ID #IMPLIED
	label CDATA #REQUIRED
	%supportObjectExtensions;
	%ntypeExtensions;
>

<!ELEMENT conformity (marker*)>
<!ATTLIST conformity
	%conformityExtensions;
>

<!ELEMENT marker (translation*, subprop*)>
<!ATTLIST marker
	id ID #IMPLIED
	label CDATA #REQUIRED
	idType IDREF #IMPLIED
	labelType CDATA #IMPLIED
	%supportObjectExtensions;
	%markerExtensions;
>

<!ELEMENT bannedTypes (bannedType | allBanned)*>
<!ATTLIST bannedTypes
	%bannedTypesExtensions;
>

<!ELEMENT bannedType (type*)>
<!ATTLIST bannedType
	%bannedTypeExtensions;
>
<!ELEMENT allBanned (type*)>
<!ATTLIST allBanned
	%allBannedExtensions;
>
<!ELEMENT type EMPTY>
<!ATTLIST type
	id CDATA #IMPLIED
	label CDATA #IMPLIED
>	

<!ELEMENT modules (module*)>
<!ATTLIST modules
	%modulesExtensions;
>

<!ELEMENT module (conceptTypes, relationTypes?, nestingTypes?)>
<!ATTLIST module
	id ID #IMPLIED
	label CDATA #REQUIRED
	%moduleExtensions;
>


<!-- Graph -->

<!ELEMENT graph (concept*, relation*, edge*, subprop*)>
	<!-- Attributes pointer and pointerMarker are forbidden when nature
	is not "individual". -->
<!ATTLIST graph
	id ID #REQUIRED
	nature CDATA #IMPLIED
	set CDATA #IMPLIED 
	pointer IDREF #IMPLIED 
	pointerMarker CDATA #IMPLIED 
	%environmentObjectExtensions;
	%nodeExtensions;
	%graphExtensions;
>

<!ELEMENT concept (type*, value?, nesting*, subprop*)>
	<!-- If the concept type is conjunctive, idType and labelType attributes
	are not stated but "type" elements are nested in the "concept"
	element.
	For an untyped value, idDatatype attribute has to be used with an empty
	value. -->
<!ATTLIST concept
	id ID #REQUIRED
	idType CDATA #IMPLIED
	labelType CDATA #IMPLIED
	idDatatype CDATA #IMPLIED
	coreferenceClass CDATA #IMPLIED
	referent (generic|individual|variable|value|genericvalue) "generic"
	idMarker CDATA #IMPLIED
	labelMarker CDATA #IMPLIED
	%nodeExtensions;
	%conceptExtensions;
>

<!ELEMENT value (#PCDATA)>
<!ATTLIST value >

<!ELEMENT nesting (subprop*)>
<!ATTLIST nesting
	idType CDATA #IMPLIED
	labelType CDATA #IMPLIED
	nestGraph CDATA #REQUIRED
	%nodeExtensions;
	%nestingExtensions;
>

<!ELEMENT relation (subprop*)>
<!ATTLIST relation
	id ID #REQUIRED
	idType CDATA #IMPLIED
	labelType CDATA #IMPLIED
	%nodeExtensions;
	%relationExtensions;
>

<!ELEMENT edge EMPTY>
<!ATTLIST edge
	rid IDREF #REQUIRED
	cid IDREF #REQUIRED
	label CDATA #REQUIRED
	%edgeExtensions;
>


<!-- Rule. -->

<!ELEMENT rule (hypt, conc, conPts, subprop*)>
<!ATTLIST rule
	id ID #REQUIRED
	%environmentObjectExtensions;
	%ruleExtensions;
>

<!ELEMENT hypt (graph*)>

<!ELEMENT conc (graph*)>

<!ELEMENT conPts (couple*)>
<!ATTLIST conPts
	%conPtsExtensions;
>

<!ELEMENT couple EMPTY>
<!ATTLIST couple
	idC1 IDREF #REQUIRED
	idC2 IDREF #REQUIRED
	%coupleExtensions;
>


<!-- Constraint. -->

<!ELEMENT positiveConstraint (condition, obligation, conPts, subprop*)>
<!ATTLIST positiveConstraint
	id ID #REQUIRED
	%environmentObjectExtensions;
	%positiveConstraintExtensions;
>

<!ELEMENT negativeConstraint (condition?, interdiction, conPts, subprop*)>
<!ATTLIST negativeConstraint
	id ID #REQUIRED
	%environmentObjectExtensions;
	%negativeConstraintExtensions;
>

<!ELEMENT condition (graph*)>

<!ELEMENT obligation (graph*)>

<!ELEMENT interdiction (graph*)>

Subsets of properties

As in XML, the CoGXML format imposes to define only one value for a given attribute in a given tag. However the CoGITaNT library allows several values for the same type of property, for a given object (see cogitant::PropertySet) if each value has a unique identifier. The set of properties is then sliped up in several subsets. Each subset is identified by an iSet. It is represented, in CoGXML format, by using <subprop> tags. Every <subprop> tag has a mandatory attribute (subid) which is the iSet. The other attributes represent the properties of corresponding property subsets. In CoGITaNT, this parcticality is used for backing up graphical properties of an element which do not correspond to CoGITaNT objects cogitant::CogitantObject.

Extension of the format

One of the particularities of the CoGXML DTD is to be able to easily add new attributes without changing the DTD structure. This facility applies to all objects in the format.
More precisely, xxxExtensions entities declared at the beginning of the DTE can be specified to represent characteristics of new tag attributes. For example, the following DTD, based on CoGXML, add the font attributes to concept vertices.

<!ENTITY % conceptExtensions
	"font CDATA #IMPLIED"
>

<!ENTITY % cogxmlDTD	PUBLIC
	"-//COGITANT/CoGXML Format Specification 1.1//EN"
	"http://cogitant.sourceforge.net/cogxml.dtd"
>
%cogxmlDTD;

A file using this DTD could contain declarations of concept vertices such as:

<concept id="cn2" idType="pers" coreferenceClass="x1" font="fixed"></concept>

Supplementary attributes are understood as properties of objects defined in the library. As such, the value of the font attribute will be accessible from similar call:

concept->properties()->readString("font");

The analysis tool provided with the library ignores DTD and does not check that attributes in files are in accordance with the ones declared in the DTD. For the same reasons, default values present in an DTD CoGXML extension will be ignored (and would have to be explicitly dealt within a program).