1 1 Context Expressions and Logic 2 1.1 Overview 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 UCM provides two distinct usage of ContextValues in a ContextGraph: The ability to associate ContextValues to objects The ability to resolve objects by expressing ContextValues for a specific business situation These two provisions in UCM are referred to as “assigned context” and “applied context” (respectively above). The mechanism to facilitate these is based on well know predicate logic. Within UCM’s predicate logic, a set of ContextClauses are specified to support assignment and application of ContextValues. These Clauses are encompassed within a ContextExpression. This section uses the following ContextGraph as an example. The letters represent Ids of ContextNodes from a fictitious ID scheme from “Letters.org”: D B E C F A I H G J 20 21 22 23 24 25 26 The metadata for this ContextGraph is as follows: Note: need to add to ContextGraph meta data. URNUUID = URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26 Version = 1.0 ContextNodeIDSchemeURI = http://www.letters.org ContextNodeIDShemeAgencyName = Letters 27 1.2 Context Clauses 28 29 The following is a UML logical sketch diagram of ContextExpressions: ContextExpression ContextClause 2 +contextgraphid +contextgraphversion 1 1 1 SimpleContextClause +predicate +contextnodeid 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 CompoundContextClause +operand There are two concrete types of ContextClauses – SimpleContextClause and CompoundContextClause. A CompoundContextClause provides for an arbitrarily complex ContextClause through recursion. A ContextExpression contains a single ContextClause. A ContextExpression also contains the ID and version of the ContextGraph to which it refers. A ContextExpression has the following lexical notation: [<ContextGraph URNUUID>”,”<ContextGraph version>”,”<ContextClause>] Note: grammar to be defined formally. A SimpleContextClause is a ContextClause with one predicate and one ContextNode ID. A predicate has the following possible values (with notation): Equal to (=) Not equal to (!=) Greater than (>) Less than (<) Greater than or equal to (>=) Less than or equal to (<=) A SimpleContextClause has the following lexical notation: (<predicate>”,”<ContextNode ID>) A CompoundContextClause is a ContextClause with two (referred to as “first” and “second”) ContextClauses (either SimpleContextClause or CompoundContextClause) and one operand. An operand has the following possible values (with notation): Intersection (&&) Union (||) Exclusion (!) 67 68 69 70 71 A CompoundContextClause has the following lexical notation: ((<ContextClause>)<operand>(<ContextClause>)) 72 1.3 Assigned Context and Contextualized 73 74 75 76 77 78 79 80 81 82 Assigning context is the action of specifying a ContextExpression as part of an object. This object is called a Contextualized object, or simply, a “Contextualized”. An example of a Contextualized is a Business Information Entity (BIE). Other types of objects may be Contextualized. The semantics of the predicates and operands are determined by the usage of the ContextClauses (assigned or applied). Assigning context is accomplished by defining a ContextExpression whose ContextClause can be resolved to a set of ContextValues in a specific ContextGraph through processing, and specifying the ContextExpression as an intrinsic part of the Contextualized. Contextualized +ContextExpression «BIE» 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 The set of ContextValues which can be resolved from the ContextExpression’s ContextClause indicates which ContextValues are relevant to the Contextualized. A Contextualized must contain one ContextExpression. The following are the semantics of the predicate values within a SimpleContextClause when assigning context: Equal to (=) - The Contextualized is associated with the ContextNode ID. The following ContextExpression with a SimpleContextClause indicates that the Contextualized is assigned with ContextValues C: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(=,C)] Greater than (>) - The Contextualized is associated with all ContextValues of all ancestor ContextNodes of the ContextNode ID. 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 The following ContextExpression with a SimpleContextClause indicates that the Contextualized is assigned with ContextValues A,B,G: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(>,H)] Less than (<) - The Contextualized is associated with all ContextValues of all child ContextNodes of the ContextNode ID. The following ContextExpression with a SimpleContextClause indicates that the Contextualized is assigned with ContextValues I,J: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(<,H)] Greater than or equal to (>=) - The Contextualized is associated with all ContextValues of all ancestor ContextNodes of the ContextNode ID and the ContextValue of the ContextNode ID. The following ContextExpression with a SimpleContextClause indicates that the Contextualized is assigned with ContextValues A,B,G,H: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(>=,H)] Less than or equal to (<=) - The Contextualized is associated with all ContextValues of all child ContextNodes of the ContextNode ID and the ContextValue of the ContextNode ID. The following ContextExpression with a SimpleContextClause indicates that the Contextualized is assigned with ContextValues H,I,J: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(<=,H)] The following are the semantics of the operand values of a CompoundContextClause when assigning context: Intersection (&&) - The Contextualized is associated with all ContextValues which are common to the two ContextClauses. The following ContextExpression with a CompoundContextClause indicates that the Contextualized is assigned with ContextValues H: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0, (=,H)&&(<=,B)] Union (||) - The Contextualized is associated with all ContextValues specified in the two ContextClauses. The following ContextExpression with a CompoundContextClause indicates that the Contextualized is assigned with ContextValues H,C,D,E,F: 149 150 151 152 153 154 155 156 157 158 159 160 [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(=,H)||(<=,C)] Exclusion (!) - The Contextualized is associated with all ContextValues specified in the first ContextClause minus the ContextValues specified in the second ContextClause. The following ContextExpression with a CompoundContextClause indicates that the Contextualized is assigned with ContextValues C,E,F: [URN:UUID: f224def0-7a77-45fc-8806-682ba7e31f26,1.0,(<=,C)!(=D)] 161 1.4 Applying Context 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 Note: no examples in this section yet of resolved Contextualizeds. The application of context for a specific business situation is the action of resolving a set of Contextualized objects from a set of ContextExpression. The application of context is accomplished by defining a single ContextExpression and processing its ContextClause over the identified ContextGaph. A ContextClause for applied context acts a query, and is resolved into a set of Contextualizeds. The following are the semantics of the predicate values of a SimpleContextClause when applying context: Equal to (=) - The set of Contextualizeds which are associated with the ContextValue of the ContextNode ID. Not Equal to (!=) - The set of Contextualizeds which are not associated with the ContextValue of the ContextNode ID. Greater than (>) - The set of Contextualizeds which are associated with all ContextValues of all ancestor ContextNodes of the ContextNode ID. Less than (<) - The set of Contextualizeds which are associated with all ContextValues of all child ContextNodes of the ContextNode ID. Greater than or equal to (>=) - The set of Contextualizeds which are associated with all ContextValues of all ancestor ContextNodes and the ContextValue of the ContextNode ID. 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 Less than or equal to (<=) - The set of Contextualizeds which are associated with all ContextValues of all child ContextNodes and the ContextValue of the ContextNode ID. The following are the semantics of the operand values of a CompoundContextClause when applying context: Intersection (&&) - The set of Contextualizeds which are members of both sets of resolved Contextualizeds from the two ContextClauses. Union (||) - The set of Contextualizeds which are members of either set of resolved Contextualized from the two ContextClauses. Exclusion (!) - The set of Contextualizeds which are members of the set of resolved Contextualized from the first ContextClause minus the members of the set of resolved Contextualized from the second ContextClause.