Specification_DAGChapter_04152009

2
UN/CEFACT Context Methodology
Technical Specification
3
Working Draft
1
4
5
DAG Chapter 6 Only
[15 April 2009]
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 1 of 15
6
Table of Contents
7
8
1
STATUS OF THIS DOCUMENT ........................................................................... 2
9
10
2 UN/CEFACT UNIFIED CONTEXT METHODOLOGY TECHNICAL
SPECIFICATION PROJECT TEAM PARTICIPANTS ............................................. 3
11
3
INTRODUCTION..................................................................................................... 3
12
4
OBJECTIVES ........................................................................................................... 4
13
5
OVERVIEW .............................................................................................................. 5
14
6
GRAPH THEORY FOUNDATION ....................................................................... 6
15
6.1
Mathematical Directed Acyclic Graph ............................................................... 6
16
6.1.1
Notations Used For DAG................................................................................ 6
17
6.1.2
Key DAG Concepts ........................................................................................ 7
18
6.2
Context Scheme Directed Acyclic Graph ........................................................... 7
19
6.2.1
Notations Used For Context Scheme DAG .................................................... 8
20
6.2.2
Context Scheme DAG Propeties ..................................................................... 8
21
6.2.3
ContextNodes and DAG Edges ...................................................................... 8
22
23
6.2.4 ContextValues within a Context Scheme DAG ........... Error! Bookmark not
defined.
24
6.2.5
ContextPath ................................................................................................... 10
25
6.2.6
Context Scheme DAG Lifecycle .................................................................. 15
26
7
X................................................................................................................................ 15
27
1 Status of this Document
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 2 of 15
28
29
30
2 UN/CEFACT Unified Context Methodology
Technical Specification Project Team
Participants
31
32
3 Introduction
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 3 of 15
33
4 Objectives
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 4 of 15
34
5 Overview
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 5 of 15
35
6 Graph Theory Foundation
36
The foundation of this specification is a mathematical graph.
37
38
39
Specifically, this specification is based on a Directed Acyclic Graph [DAG]. A DAG has
many applications in event processing, expression evaluation, game theory, sorting
algorithms, parser algorithms, etc.
40
41
While a DAG is a mathematical construct, it defines no semantics. This specification
imposes semantics on a DAG to realize Context Schemes.
42
6.1 Mathematical Directed Acyclic Graph
43
44
45
46
This section provides a terse explanation of key DAG concepts and base terminology. For
in depth discussion of graphs, much has been written. Refer to the reference section of
the specification. We identify and discuss the base concepts of a DAG which are relevant
to this specification, which uses a mathematical DAG as its foundation.
47
48
49
50
A Directed Acyclic Graph is a specific form of a graph. In a DAG, vertices (or nodes) are
directionally connected by edges (or lines) and following any edge along its direction,
from a given vertex, the same vertex can never be reached (no cycles, acyclic). Edges
directionally connect two vertices.
51
6.1.1 Notations
52
53
54
While there is no best drawing of a graph, they are usually represented using dots to
represent vertices and lines, or arcs, to represent edges. Arrows are usually used to show
orientation of directed edges.
55
This specification uses this notation to exemplify graphs:
56
A vertex is represented by ellipse:
57
58
59
An edge is represented arrow, which identifies the direction. The end of the arrow
without the arrow head is the edge source and the end with the arrow is the edge target.
60
UN/CEFACT Context Methodology Technical Specification
Copyright © UN/CEFACT 2009
. All Rights Reserved.
Page 6 of 15
Working Draft
61
62
63
2009-01-26
Technically, a DAG is purely mathematical, and vertices within a DAG do not require a
value, or label, of any sort. However, a simple text label within a vertex is used to
exemplify a value of a vertex and facilitate the discussion:
X
64
65
66
A sequence, or path, of connected vertices is represented in textual form by combining
text labels of vertices with the characters “->”, such as “X->Y->Z”.
67
6.1.2 Key DAG Concepts
2
1
3
4
5
6
7
8
68
69
70
71
72
A source node (or root node), is a vertex connected to zero edge sources (1, 2, 3, and 4).
A sink node (or leaf node), is a vertex connected to zero edge targets (4, 6, and 8). Note
that (4) is both a source node and a sink node. Vertexes, which are neither a source node
nor sink node (5) have no special term beyond just ‘vertex’.
73
74
A directed path is a sequence of one or more vertices connected by edges (1, 4, 1->6, 2>5->7, 3->5->7->8, 5->7).
75
76
77
Note that there is no requirement for a vertex to be connected by edges. A DAG may
have one or more source vertices and one or more sink vertices, but must have at least
one Vertex.
78
6.2 Context Directed Acyclic Graph
79
80
81
Industry has utilized graphs, in general, for approaches to knowledge and semantics for
years as a semantic network [SEMANTICNET]. This section specifies the terminology
and approach for leveraging the special form of a mathematical graph, a DAG, as the
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 7 of 15
Working Draft
2009-01-26
82
83
foundation for semantics to facilitate Context Schemes. Since a DAG is both acyclic and
directed, this dictates the approach at the semantic layer also.
84
85
We refer to the use of a mathematical DAG for the foundation of Context Schemes as a
Contextual DAG, or CDAG.
86
6.2.1 Notations
87
6.2.1.1 CDAG Notation
88
89
Notations for a CDAG utilize the notations for a mathematical DAG and is the primary
notation used in this section.
90
6.2.1.2 UML
91
92
This section utilizes UML as sketch where useful to facilitate the discussion. The
following UML packages are utilized:
un::unece::uncefact::ucm::dag
DAG classifiers
un::unece::uncefact::ucm::cdag
CDAG classifiers
93
The CDAG package has dependency on the DAG package.
94
6.2.2 CDAG Propeties
95
<versioning, etc>
96
6.2.3 ContextNode and ContextEdge as Node and Edge
97
DAG nodes and edges have consistent entities in a CDAG.
98
99
100
A ContextNode is a vertex in a mathematical DAG, while a ContextEdge is an edge in a
mathematical DAG. A CDAG contains one or more ContextNodes, and contains zero or
more ContextEdges.
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 8 of 15
Working Draft
2009-01-26
101
102
103
104
105
Further following a mathematical DAG, a source node (or root node), is referred to as a
RootContextNode and a sink node (or leaf node) is referred to as a LeafContextNode. A
ContextNode which is neither a RootContextNode nor LeafContextNode has no special
term beyond just ‘ContextNode’.
106
6.2.4 ContextValue
107
A CDAG introduces a ContextValue. A ContextNode contains one ContextValue.
108
109
110
111
112
A ContextValue is abstract, and may be realized as either a code (in a code list) or some
form of identifier. Either way, the ContextValue has optional metadata for indicating
information about the code or identifier, such as the owning agency, version of the code
list, etc. This section does not elaborate on these realizations.
113
114
115
We provide the following UML sketch depicting the core structural concepts of a CDAG.
Note that these relationships to not explicitly depict the base constraints of a DAG, such
as acyclicness. Key points about this sketch:
116
117

ContextNode is not abstract since a given ContextNode is concrete as with
RootContextNode or a LeafContextNode
118
119

ContextValue is abstract with concrete classifiers for code or identifier. Metadata
for these, such as the owning agency, are not shown for simplicity.
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 9 of 15
Working Draft
2009-01-26
1
1
Source
ContextEdge
Target
1
*
1
ContextDAG
1
*
1
ContextNode
1
1..*
RootContextNode
ContextValue
1
LeafContextNode
1
Code
Identifier
120
121
6.2.5 ContextPath and Contextualizable
122
123
124
A ContextPath is a directed path in a mathematical DAG. A ContextPath is a sequence of
one or more ContextNodes. A ContextNode may participate in more than one
ContextPaths.
125
126
127
It is important to note that a CDAG by itself has no ContextPaths. A ContextPath is part
of a Contextualizable.
128
129
6.2.5.1 Contextualizables and PathScope
130
A Contextualizable is abstract, and is an entity that has one or more ContextPaths.
131
132
A ContextPath identifies semantic relevancy of a Contexualizable. A CCTS BIE is a
Contextualizable.
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 10 of 15
Working Draft
2009-01-26
133
134
135
136
137
For example, a Customer Information CCTS ABIE (which is a Contextualizable) may be
defined specifically for the OrderToCash business process. To formally indicate this
relevancy, a BusinessProcesses->OrderToCash ContextPath must be defined and be part
of the CCTS ABIE Contextualizable.
138
139
PathScope indicates the relevancy of an Contextualizable for a given ContextPath. There
are two kinds of PathScope:
140

Implied
141

Explicit
142
143
144
145
146
Explicit indicates that the Contextualizable is relevant only as far as the sequence of
ContextValues defined in the ContextPath. It indicates nothing is being said about any
further children of the last ContextNode in the ContextPath. Implied indicates that the
Contextualizable is relevant to all ContextValues defined in the ContextPath and
downward to all children and subchildren within the CDAG.
147
148
149
150
(Note that while a ContextPath does not have to include a SinkContextNode, if one is
included the PathScope has no meaning (and is actually not required). Note also that a
ContextPath must include one RootContextNode, so there are no PathScope values to
characterize relevancy “upward” in the graph.)
151
152
153
154
155
156
In the following example there are 5 different ABIE definitions, which are identified with
a uuid attribute, all representing Customer Information. The ABIE 791 has been
associated to the CDAG by declaring a BusinessProcesses->OrderToCash ContextPath
(in red) with a PathScope “Explicit”, indicating this CustomerInfo ABIE is relevant to the
OrderToCash business process and nothing more. It is not necessarily indicating it has
semantic relevance to the Execution History, etc.
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 11 of 15
Working Draft
2009-01-26
«ACC»
CustomerInfo
-uuid : Integer = 789
+firstName
+lastName
+middleName
+customerNumber
«Based On»
«Based On»
«Based On»
«Based On»
«ABIE»
CustomerInfo
-uuid : Integer = 790
+firstName : String
+middleName : String
+lastName : String
+customerNumber : String
DesignToRelease
«ABIE»CustomerInfo
-uuid : Integer = 791
+firstName : String
+lastName : String
+customerNumber : String
«ABIE»
CustomerInfo
-uuid : Integer = 792
+customerNumber : String
«ABIE»CustomerInfo
-uuid : Integer = 793
+customerNumber : Integer
PathScope=
Explicit
CreateOrderForCustomer
BusinessProcesses
OrderToCash
Steps
GetAllCutomerOders
UpdateOrder
ExecutionHistory
157
158
159
160
161
162
163
Adjusting the association and PathScope to the following example indicates that the
CustomerInfo ABIE has been associated to the CDAG by delaring a BusinessProcesses>OrderToCash->Steps ContextPath and “Implied” path scope, indicating that this
CustomerInfo ABIE is now relevant to all steps in the OrderToCash business process.
The Implied PathScope is essentially a convenience indicator which eliminates listing all
possible paths beyond a specific ContextNode.
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 12 of 15
Working Draft
2009-01-26
«ACC»
CustomerInfo
-uuid : Integer = 789
+firstName
+lastName
+middleName
+customerNumber
«Based On»
«Based On»
«Based On»
«Based On»
«ABIE»
CustomerInfo
-uuid : Integer = 790
+firstName : String
+middleName : String
+lastName : String
+customerNumber : String
DesignToRelease
«ABIE»CustomerInfo
-uuid : Integer = 791
+firstName : String
+lastName : String
+customerNumber : String
«ABIE»
CustomerInfo
-uuid : Integer = 792
+customerNumber : String
«ABIE»CustomerInfo
-uuid : Integer = 793
+customerNumber : Integer
PathScope=
Implied
CreateOrderForCustomer
BusinessProcesses
OrderToCash
Steps
GetAllCutomerOders
UpdateOrder
ExecutionHistory
164
165
6.2.5.2 ContextPath and Semantic Precision via ContextValues
166
167
168
A ContextPath represents variation semantic precision. By altering the ContextValues
(via their ContextNodes) within a ContextPath, a change in understanding granularity is
realized.
169
170
171
172
173
174
Increasing ContextValues within a ContextPath in the direction of a ContextEdge
(extending the path) increases semantic precision, while decreasing ContextValues
(reducing the path) in the opposite direction of a ContextEdge decreases semantic
precision. Therefore, a RootContextNode within a ContextPath provides the most
imprecise point of understanding within the path, while the ‘ending’ ContextNode
provides the most precise understanding within the path.
175
176
177
178
179
180
181
182
In the above CDAG examples, the BusinessProcesses RootContextNode is the most
imprecise point of understanding. It provides a general point of understanding for nothing
more than business processes. Taking into account the OrderToCash ContextNode as part
of a ContextPath, a more comprehensive and increase in precision of understanding is
achieved by realizing which specific business process is under consideration. Further, the
CDAG organizes steps and execution history in this process. Also taking into account
within a ContextPath the Steps and CreateOrderForCustomer ContextNodes, a significant
increase in precision of understanding realized as to the relevancy of the ABIE.
183
184
In order to declare maximum semantic within a CDAG, a ContextPath must include one
SouceContextNode. This has the desirable, and required, side effect of avoiding
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 13 of 15
Working Draft
185
186
187
2009-01-26
ambiguity which would be imposed by including ContextNodes associated with multiple
ContextEdge targets. There is, however, no requirement to include a SinkContextNode.
Valid ContextPaths using the above example are:
188

BusinessProcesses
189

BusinessProcesses->OrderToCash
190

BusinessProcesses->OrderToCash->ExecutionHistory
191

BusinessProcesses->OrderToCash->Steps
192

BusinessProcesses->OrderToCash->Steps->CreateOrderForCustomer
193
However, the following ContextPaths using the above example are invalid:
194

Steps
195

OrderToCash->Steps->CreateOrderForCustomer
196

ExecutionHistory
197

UpdateOrder
198
6.2.5.3 ContextPaths within Contexualizables
199
200
201
A Contextualizable contains one or more ContextPaths representing union of its complete
semantic relevancy. ContextPaths may contain the same intersecting ContextValue
representing different semantics as in the following example CDAG:
US Tax Rates
North Carolina
Texas
Travis County
Austin
US State Capitals
Raleigh
Mecklenburg County
202
203
204
205
206
In this example, a Population ABIE has been defined by restricting a Population ACC to
only include, and provide the typing for, the men and women property terms (no
children) which has the following two ContextPaths declared as shown, indicating
semantic relevance to Austin both for the context of state capitals via an Explict
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 14 of 15
Working Draft
207
208
2009-01-26
ContextPath, and also for semantic relevancy to Austin and Travis County for the context
of US Tax rates via an Implied ContextPath.
Contextualizable
+ContextPath : String
«ACC»
Population
-uuid : Integer = 789
+men
+women
+children
«Based On»
«ABIE»
Population
+ContextPath : String = US Tax Rate ->Texas ->Austin [Impled]
+ContextPath : String = US State Capitals ->Austin [Explicit]
-uuid : Integer = 792
+men : Integer
+women : Integer
209
210
211
This example does not indicate that the ABIE is semantically relevant to Raleigh for any
context.
212
6.2.6 CDAG Lifecycle
213
X
214
7 X
215
216
REFERENCES FOR SECTION 6
217
DAG
218
Directed Acyclic Graph, WikiPedia, http://en.wikipedia.org/wiki/Directed_acyclic_graph
219
[SEMANTICNET]
220
Semantic Network / Semantic Nets, WikiPedia, http://en.wikipedia.org/wiki/Semantic_network
UN/CEFACT – XXXX Technical Specification
Copyright © UN/CEFACT 2002. All Rights Reserved.
Page 15 of 15