Line 33 was replaced by line 33 |
- familiarity with [http://www.w3.org/TR/REC-rdf-syntax|RDF], [http://www.w3.org/TR/owl-guide/|OWL], and basic [http://en.wikipedia.org/wiki/First-order_logic|first-order logic] is assumed. |
+ familiarity with [RDF|http://www.w3.org/TR/REC-rdf-syntax], [OWL|http://www.w3.org/TR/owl-guide/], and basic [First-Order Logic|http://en.wikipedia.org/wiki/First-order_logic] is assumed. |
At line 34 added 1 line. |
+ !!! 2 Overview of Annotation Templates |
Lines 36-37 were replaced by line 37 |
- <a name="section2"></a> |
- <h2>2. Overview of Annotation Templates</h2> |
+ An annotation template consists of one or more __instantiation patterns__ for constructing OWL individuals from resources. Instantiation patterns are typically based on (or driven by) resource structure and content. |
At line 38 added 1 line. |
+ The simplest form of an instantiation pattern is: |
Lines 40-99 were replaced by lines 41-75 |
- <p> An annotation template consists of one or more <em><a |
- href="#pattern">instantiation patterns</a></em> for constructing OWL |
- individuals from resources. Instantiation patterns are typically based |
- on (or driven by) resource structure and content. |
- |
- <p> The simplest form of an instantiation pattern is: |
- |
- <pre> |
- <individual type="ont:C"/> |
- </pre> |
- |
- <p> This expression creates a single, unique instance of the |
- <code>C</code> class in the ontology refered to by <code>ont</code> |
- (assumed to be an ontology prefix defined in the annotation |
- header). The OWL document that results from running (executing) the |
- pattern is: |
- |
- <pre> |
- <rdf:RDF xmlns="local-ns" ...> |
- <owl:Ontology rdf:about=""> |
- <owl:imports rdf:resource="http://ontologies.org/ont"/> |
- </owl:Ontology> |
- |
- <ont:C rdf:ID="id1"/> |
- |
- </rdf:RDF> |
- </pre> |
- |
- <p> In this example, the pattern maps the resources given in the |
- annotation to a single OWL individual <a href="#1"/>[1]</a>. Note that |
- the identifier for the instance above is generated automatically as a |
- result of executing the pattern <a href="#2"/>[2]</a>. |
- |
- |
- <p> A more common use of templates is to relate data values in a |
- resource to class instances in the ontology. Assume we are annotating |
- a relational table labeled <code>R</code> with attributes |
- <code>x</code>, <code>y</code>, and <code>z</code> <a |
- href="#3"/>[3]</a>. The following pattern, which uses a |
- <code>foreach</code> attribute, creates an instance of class |
- <code>C</code> for every unique value of <code>x</code> in the |
- dataset. |
- |
- <pre> |
- <individual type="ont:C" foreach="R.x"/> |
- </pre> |
- |
- <p> This pattern can be read as "For each unique x value of R create |
- an instance of C." In this example, the term "R.x" is a <em><a |
- href="#variable">resource variable</a></em>. Executing this pattern |
- results in the following document, assuming there are <em>n</em> |
- unique values of <code>x</code> in <code>R</code> <a |
- href="#3">[4]</a>. As above, identifiers are generated as a result of |
- executing the pattern over <code>R</code>. |
- |
- <pre> |
- <rdf:RDF xmlns="local-ns" ...> |
- <owl:Ontology rdf:about=""> |
- <owl:imports rdf:resource="http://ontologies.org/ont"/> |
- </owl:Ontology> |
+ {{{ |
+ <individual type="ont:C"/> |
+ }}} |
+ |
+ This expression creates a single, unique instance of the {{C}} class in the ontology refered to by {{ont}} (assumed to be an ontology prefix defined in the annotation header). The OWL document that results from running (executing) the pattern is: |
+ |
+ {{{ |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about="">; |
+ <owl:imports rdf:resource="http://ontologies.org/ont"/> |
+ </owl:Ontology> |
+ |
+ <ont:C rdf:ID="id1"/> |
+ |
+ </rdf:RDF> |
+ }}} |
+ |
+ In this example, the pattern maps the resources given in the annotation to a single OWL individual[1]. Note that the identifier for the instance above is generated automatically as a result of executing the pattern[2]. |
+ |
+ A more common use of templates is to relate data values in a resource to class instances in the ontology. Assume we are annotating a relational table labeled {{R}} with attributes {{x}}, {{y}}, and {{z}}[3]. The following pattern, which uses a {{foreach}} attribute, creates an instance of class {{C}} for every unique value of {{x}} in the dataset. |
+ |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ }}} |
+ |
+ This pattern can be read as "For each unique x value of R create |
+ an instance of C." In this example, the term "R.x" is a __resource variable__. Executing this pattern results in the following document, assuming there are __n__ |
+ unique values of {{x}} in {{R}}[4]. As above, identifiers are generated as a result of |
+ executing the pattern over {{R}}. |
+ |
+ {{{ |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about=""> |
+ <owl:imports rdf:resource="http://ontologies.org/ont"/> |
+ </owl:Ontology> |
Lines 101-102 were replaced by lines 77-78 |
- <ont:C rdf:ID="id-val1"/> |
- <ont:C rdf:ID="id-val2"/> |
+ <ont:C rdf:ID="id-val1"/> |
+ <ont:C rdf:ID="id-val2"/> |
Line 104 was replaced by line 80 |
- <ont:C rdf:ID="id-valn"/> |
+ <ont:C rdf:ID="id-valn"/> |
Lines 106-107 were replaced by lines 82-83 |
- </rdf:RDF> |
- </pre> |
+ </rdf:RDF> |
+ }}} |
Line 109 was replaced by line 85 |
- <p> Note that this document has a different namespace than the |
+ Note that this document has a different namespace than the |
Lines 117-118 were replaced by lines 93-94 |
- <p> We use rules expressed in first-order logic to formalize how |
- instantiation patterns should be interpreted <a href="#5">[5]</a>. For |
+ We use rules expressed in first-order logic to formalize how |
+ instantiation patterns should be interpreted[5]. For |
Line 121 was replaced by line 97 |
- <pre> |
+ {{{ |
Line 123 was replaced by line 99 |
- </pre> |
+ }}} |
Lines 125-126 were replaced by lines 101-102 |
- <p> Here, the predicate <code>triple</code> asserts an RDF triple |
- (with subject, property, value), and <code>id_p1</code> is a (Skolem) |
+ Here, the predicate {{triple}} asserts an RDF triple |
+ (with subject, property, value), and {{id_p1}} is a (Skolem) |
Lines 128-130 were replaced by lines 104-106 |
- <code>id_p1</code> is meant to apply only within this rule, where p1 |
- stands for "pattern 1." We say in this case that each <code>x</code> |
- value of <code>R</code> constitues a particular <code>C</code>. |
+ {{id_p1}} is meant to apply only within this rule, where p1 |
+ stands for "pattern 1." We say in this case that each {{x}} |
+ value of {{R}} constitues a particular {{C}}. |
Line 132 was replaced by line 108 |
- <p> There are a number of additional features of instantiation |
+ There are a number of additional features of instantiation |
Line 140 was replaced by line 116 |
- <h3>3.1 Individuals</h3> |
+ !!3.1 Individuals |
Lines 142-150 were replaced by lines 118-122 |
- <p> <b>Iteration.</b> More than one variable can be given in a |
- <code>foreach</code> expression. For example, the following pattern |
- creates an instance of <code>C</code> for every unique pair of |
- <code>x</code> and <code>y</code> values occurring together in tuples |
- of <code>R</code>. |
- |
- <pre> |
- <individual type="ont:C" foreach="R.x, R.y"/> |
- </pre> |
+ __Iteration.__ More than one variable can be given in a |
+ {{foreach}} expression. For example, the following pattern |
+ creates an instance of {{C}} for every unique pair of |
+ {{x}} and {{y}} values occurring together in tuples |
+ of {{R}}. |
Line 152 was replaced by lines 124-128 |
- <p> This pattern can be read as "For each unique x, y (tuple) value |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x, R.y"/> |
+ }}} |
+ |
+ This pattern can be read as "For each unique x, y (tuple) value |
Line 156 was replaced by line 132 |
- <pre> |
+ {{{ |
Line 158 was replaced by line 134 |
- </pre> |
+ }}} |
Lines 160-161 were replaced by lines 136-137 |
- <p> In this example, we say that each <code>x,y</code> value |
- constitutes a particular <code>C</code>. |
+ In this example, we say that each {{x,y}} value |
+ constitutes a particular {{C}}. |
Line 163 was replaced by line 139 |
- <p> Resource labels (such as <code>R</code>) in annotations are used |
+ Resource labels (such as {{R}}) in annotations are used |
Lines 166-168 were replaced by lines 142-144 |
- resource in an annotation header. For example, if <code>R1</code> and |
- <code>R2</code> are both labels for the <code>Employee</code> |
- relation, the iteration expression "<code>R1.x, R2.x</code>" is |
+ resource in an annotation header. For example, if {{R1}} and |
+ {{R2}} are both labels for the {{Employee}} |
+ relation, the iteration expression "{{R1.x, R2.x}}" is |
Lines 171-172 were replaced by lines 147-148 |
- <pre> |
- SELECT R1.x, R2.x |
+ {{{ |
+ SELECT DISTINCT R1.x, R2.x |
Line 174 was replaced by line 150 |
- </pre> |
+ }}} |
Lines 176-177 were replaced by lines 152-153 |
- <p> In a similar way, one can view <code>foreach</code> expressions as |
- group constructors, similar to the <code>GROUP BY</code> clause in |
+ In a similar way, one can view {{foreach}} expressions as |
+ group constructors, similar to the {{GROUP BY}} clause in |
Line 180 was replaced by line 156 |
- <p> <b>Conditions.</b> Conditions can be added to restrict the |
+ __Conditions.__ Conditions can be added to restrict the |
Lines 182-183 were replaced by lines 158-159 |
- the creation of <code>C</code> instances based on positive values of |
- <code>x</code>. |
+ the creation of {{C}} instances based on positive values of |
+ {{x}}. |
Lines 185-187 were replaced by lines 161-163 |
- <pre> |
- <individual type="ont:C" foreach="R.x, R.y" if="R.x>0"/> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x, R.y" if="R.x>0"/> |
+ }}} |
Line 189 was replaced by line 165 |
- <p> This pattern can be read as "For each unique x, y (tuple) value |
+ This pattern can be read as "For each unique x, y (tuple) value |
Line 193 was replaced by line 169 |
- <pre> |
+ {{{ |
Line 195 was replaced by line 171 |
- </pre> |
+ }}} |
Lines 197-202 were replaced by lines 173-178 |
- <p> In general, conditions are Boolean expressions of the form |
- <code>term op term</code>, where a <code>term</code> is a constant or |
- variable (such as <code>R.x</code> or the value <code>5</code>), and |
- <code>op</code> is a Boolean operator such as <code><</code>, |
- <code>></code>, <code><=</code>, <code>>=</code>, or |
- <code>=</code>. |
+ In general, conditions are Boolean expressions of the form |
+ {{term op term}}, where a {{term}} is a constant or |
+ variable (such as {{R.x}} or the value {{5}}), and |
+ {{op}} is a Boolean operator such as {{<}}, |
+ {{>}}, {{<=}}, {{>=}}, or |
+ {{=}}. |
Line 204 was replaced by line 180 |
- <p> As with <code>foreach</code> expressions, <code>if</code> |
+ As with {{foreach}} expressions, {{if}} |
Lines 207-208 were replaced by lines 183-184 |
- variables that are outside the condition's <em><a |
- href="#context">iteration context</a></em>, i.e., the set of variables |
+ variables that are outside the condition's __<a |
+ href="#context">iteration context</a>__, i.e., the set of variables |
Lines 210-211 were replaced by lines 186-187 |
- corresponding <code>foreach</code> expression. Note that any given |
- binding of <code>foreach</code> variables may have many associated |
+ corresponding {{foreach}} expression. Note that any given |
+ binding of {{foreach}} variables may have many associated |
Lines 213-214 were replaced by lines 189-190 |
- <code>if</code> expression is satisfied whenever the condition is true |
- for any one of these values (i.e., similar to the <code>ANY</code> |
+ {{if}} expression is satisfied whenever the condition is true |
+ for any one of these values (i.e., similar to the {{ANY}} |
At line 217 added 1 line. |
+ !!3.2 Object Properties |
Lines 219-221 were replaced by line 196 |
- <h3>3.2 Object Properties</h3> |
- |
- <p> A <code>property</code> expression assigns OWL properties to |
+ A {{property}} expression assigns OWL properties to |
Lines 223-224 were replaced by lines 198-199 |
- example, the following pattern creates instances of <code>C</code> |
- containing properties <code>P</code>: |
+ example, the following pattern creates instances of {{C}} |
+ containing properties {{P}}: |
Lines 226-230 were replaced by lines 201-205 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" valuetype="ont:D"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" valuetype="ont:D"/> |
+ </individual> |
+ }}} |
Line 232 was replaced by line 207 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Lines 235-236 were replaced by line 210 |
- <em>n</em> unique values of <code>x</code> in <code>R</code> <a |
- href="#6">[6]</a>. |
+ __n__ unique values of {{x}} in {{R}}[6]. |
Lines 238-248 were replaced by lines 212-222 |
- <pre> |
- <rdf:RDF xmlns="local-ns" ...> |
- <owl:Ontology rdf:about=""> |
- <owl:imports rdf:resource="htt://ontologies.org/ont"/> |
- </owl:Ontology> |
- |
- <ont:C rdf:ID="id-val1"> |
- <ont:P> |
- <ont:D/> |
- </ont:P> |
- </ont:C> |
+ {{{ |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about=""> |
+ <owl:imports rdf:resource="htt://ontologies.org/ont"/> |
+ </owl:Ontology> |
+ |
+ <ont:C rdf:ID="id-val1"> |
+ <ont:P> |
+ <ont:D/> |
+ </ont:P> |
+ </ont:C> |
Lines 250-254 were replaced by lines 224-228 |
- <ont:C rdf:ID="id-valn"> |
- <ont:P> |
- <ont:D/> |
- </ont:P> |
- </ont:C> |
+ <ont:C rdf:ID="id-valn"> |
+ <ont:P> |
+ <ont:D/> |
+ </ont:P> |
+ </ont:C> |
Lines 256-257 were replaced by lines 230-231 |
- </rdf:RDF> |
- </pre> |
+ </rdf:RDF> |
+ }}} |
Line 259 was replaced by line 233 |
- <p> The first-order rule for this pattern is: |
+ The first-order rule for this pattern is: |
Line 261 was replaced by line 235 |
- <pre> |
+ {{{ |
Line 265 was replaced by line 239 |
- </pre> |
+ }}} |
Line 267 was replaced by line 241 |
- <p> Note that in this rule, <code>v</code> is existentially |
+ Note that in this rule, {{v}} is existentially |
Lines 270-271 were replaced by lines 244-245 |
- function over <code>x</code> values (similar to <code>id_p4</code>) |
- for generating the appropriate <code>D</code> identifiers. |
+ function over {{x}} values (similar to {{id_p4}}) |
+ for generating the appropriate {{D}} identifiers. |
Line 273 was replaced by line 247 |
- <p> <b>Nested Properties.</b> Property expressions corresponding to |
+ __Nested Properties.__ Property expressions corresponding to |
Line 276 was replaced by line 250 |
- <code>D</code> instances above with <code>Q</code> properties: |
+ {{D}} instances above with {{Q}} properties: |
Lines 278-284 were replaced by lines 252-258 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" valuetype="ont:D"> |
- <property type="ont:Q" valuetype="ont:E"/> |
- </property> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" valuetype="ont:D"> |
+ <property type="ont:Q" valuetype="ont:E"/> |
+ </property> |
+ </individual> |
+ }}} |
Line 286 was replaced by line 260 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Line 291 was replaced by line 265 |
- <pre> |
+ {{{ |
Line 297 was replaced by line 271 |
- </pre> |
+ }}} |
Line 299 was replaced by line 273 |
- <p> <b>Multiple Properties.</b> Individuals can be assigned more than |
+ __Multiple Properties.__ Individuals can be assigned more than |
Line 301 was replaced by line 275 |
- <code>P1</code> and <code>P2</code>. |
+ {{P1}} and {{P2}}. |
Lines 303-308 were replaced by lines 277-282 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P1" valuetype="ont:D1"/> |
- <property type="ont:P2" valuetype="ont:D2"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P1" valuetype="ont:D1"/> |
+ <property type="ont:P2" valuetype="ont:D2"/> |
+ </individual> |
+ }}} |
Line 311 was replaced by line 285 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Line 314 was replaced by line 288 |
- <pre> |
+ {{{ |
Line 320 was replaced by line 294 |
- </pre> |
+ }}} |
Lines 323-325 were replaced by lines 297-299 |
- <p> The general form of a pattern consists of an |
- <code>individual</code> expression, followed by any number of |
- (possibly nested) <code>property</code> expressions: |
+ The general form of a pattern consists of an |
+ {{individual}} expression, followed by any number of |
+ (possibly nested) {{property}} expressions: |
Lines 327-329 were replaced by lines 301-303 |
- <pre> |
- <individual type="..." foreach="..." if="..." ...> |
- <property type="..." ...> |
+ {{{ |
+ <individual type="..." foreach="..." if="..." ...> |
+ <property type="..." ...> |
Line 331 was replaced by line 305 |
- </property> |
+ </property> |
Lines 333-334 were replaced by lines 307-308 |
- </individual> |
- </pre> |
+ </individual> |
+ }}} |
Lines 336-337 were replaced by lines 310-311 |
- <p> The additional attributes of <code>individual</code> and |
- <code>property</code> statements are described further below (as well |
+ The additional attributes of {{individual}} and |
+ {{property}} statements are described further below (as well |
Line 340 was replaced by line 314 |
- <h3>3.3 Datatype Properties</h3> |
+ !!3.3 Datatype Properties |
Line 342 was replaced by line 316 |
- <p> The examples so far assume the use of OWL object properties, whose |
+ The examples so far assume the use of OWL object properties, whose |
Lines 348-350 were replaced by lines 322-324 |
- <p> Datatype <code>property</code> statements use the attribute |
- <code>value</code> instead of <code>valuetype</code>. In general, a |
- <code>value</code> attribute is used to assign a specific data value |
+ Datatype {{property}} statements use the attribute |
+ {{value}} instead of {{valuetype}}. In general, a |
+ {{value}} attribute is used to assign a specific data value |
Lines 352-353 were replaced by lines 326-327 |
- <code>valuetype</code> attribute is used to give the type of the |
- individual linked to the property. Thus, <code>valuetype</code> |
+ {{valuetype}} attribute is used to give the type of the |
+ individual linked to the property. Thus, {{valuetype}} |
Lines 355-357 were replaced by lines 329-331 |
- <code>value</code> attributes can be used for assigning both object |
- and datatype properties. <code>Property</code> statements that use a |
- <code>value</code> attribute (for either an object or datatype |
+ {{value}} attributes can be used for assigning both object |
+ and datatype properties. {{Property}} statements that use a |
+ {{value}} attribute (for either an object or datatype |
Line 360 was replaced by line 334 |
- <p> <b>Constants.</b> One use of a datatype property annotation is for |
+ __Constants.__ One use of a datatype property annotation is for |
Lines 363-364 were replaced by lines 337-338 |
- property <code>P</code> with the value <code>5</code> to each |
- generated <code>C</code> instance. |
+ property {{P}} with the value {{5}} to each |
+ generated {{C}} instance. |
Lines 366-370 were replaced by lines 340-344 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" value="5"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" value="5"/> |
+ </individual> |
+ }}} |
Line 372 was replaced by line 346 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Line 376 was replaced by line 350 |
- <pre> |
+ {{{ |
Line 379 was replaced by line 353 |
- </pre> |
+ }}} |
Line 381 was replaced by line 355 |
- <p> <b>Resource Values.</b> Another common use of datatype property |
+ __Resource Values.__ Another common use of datatype property |
Lines 383-384 were replaced by lines 357-358 |
- the following pattern assigns each instance a property <code>P</code> |
- whose value is taken from the resource variable <code>x</code>. |
+ the following pattern assigns each instance a property {{P}} |
+ whose value is taken from the resource variable {{x}}. |
Lines 386-390 were replaced by lines 360-364 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" value="$R.x"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" value="$R.x"/> |
+ </individual> |
+ }}} |
Line 392 was replaced by line 366 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Line 398 was replaced by line 372 |
- <pre> |
+ {{{ |
Line 401 was replaced by line 375 |
- </pre> |
+ }}} |
Lines 403-404 were replaced by lines 377-378 |
- <p> Resource variables can be used outside of the current iteration |
- context (i.e., the enclosing <code>foreach</code> expression). In this |
+ Resource variables can be used outside of the current iteration |
+ context (i.e., the enclosing {{foreach}} expression). In this |
Lines 409-417 were replaced by lines 383-391 |
- assigns to each instance associated with <code>x</code>, a property |
- <code>P</code> for each of <code>x</code>'s corresponding |
- <code>y</code> values. |
- |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" value="$R.y"/> |
- </individual> |
- </pre> |
+ assigns to each instance associated with {{x}}, a property |
+ {{P}} for each of {{x}}'s corresponding |
+ {{y}} values. |
+ |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" value="$R.y"/> |
+ </individual> |
+ }}} |
Line 419 was replaced by line 393 |
- <p> This pattern can be read as "For each unique x value of R, create |
+ This pattern can be read as "For each unique x value of R, create |
Line 421 was replaced by line 395 |
- value of x" <a href="#7">[7]</a>. The corresponding first-order rule for this pattern is: |
+ value of x"[7]. The corresponding first-order rule for this pattern is: |
Line 423 was replaced by line 397 |
- <pre> |
+ {{{ |
Line 426 was replaced by line 400 |
- </pre> |
+ }}} |
Lines 428-434 were replaced by lines 402-408 |
- <p> In this case, if a particular <code>x</code> value has multiple |
- <code>y</code> values, each such <code>y</code> value will result in a |
- <code>P</code> property. Note that if <code>x</code> and |
- <code>y</code> were not related, (e.g., if the expressions were |
- <code>R1.x</code> and <code>R2.y</code>, respectively), the result |
- would be a cross-product in which every <code>x</code> value would be |
- <code>P</code>-related to every <code>y</code> value. For example, the |
+ In this case, if a particular {{x}} value has multiple |
+ {{y}} values, each such {{y}} value will result in a |
+ {{P}} property. Note that if {{x}} and |
+ {{y}} were not related, (e.g., if the expressions were |
+ {{R1.x}} and {{R2.y}}, respectively), the result |
+ would be a cross-product in which every {{x}} value would be |
+ {{P}}-related to every {{y}} value. For example, the |
Lines 437-445 were replaced by lines 411-415 |
- <pre> |
- <individual type="ont:C" foreach="R1.x"> |
- <property type="ont:P" value="$R2.y"/> |
- </individual> |
- </pre> |
- |
- <p> corresponds to the following first-order rule, assuming |
- <code>R1</code> and <code>R2</code> both represent relation |
- <code>R</code>: |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R1.x"> |
+ <property type="ont:P" value="$R2.y"/> |
+ </individual> |
+ }}} |
Line 447 was replaced by lines 417-421 |
- <pre> |
+ corresponds to the following first-order rule, assuming |
+ {{R1}} and {{R2}} both represent relation |
+ {{R}}: |
+ |
+ {{{ |
Lines 450-451 were replaced by line 424 |
- </pre> |
- |
+ }}} |
Line 453 was replaced by line 426 |
- <p> In an instantiation pattern, <code>value</code> expressions must |
+ In an instantiation pattern, {{value}} expressions must |
Line 455 was replaced by line 428 |
- useful to define functions for use in <code>value</code> expressions, |
+ useful to define functions for use in {{value}} expressions, |
Lines 458-461 were replaced by lines 431-434 |
- <p> <b>Conditional Properties.</b> A <code>property</code> statement |
- can be conditionally applied using an <code>if</code> expression. In |
- particular, the conditions of the <code>if</code> expression must hold |
- for the <code>property</code> to be added to the corresponding |
+ __Conditional Properties.__ A {{property}} statement |
+ can be conditionally applied using an {{if}} expression. In |
+ particular, the conditions of the {{if}} expression must hold |
+ for the {{property}} to be added to the corresponding |
Line 463 was replaced by line 436 |
- <code>P</code> to the individual if <code>x</code> is a positive |
+ {{P}} to the individual if {{x}} is a positive |
Lines 466-470 were replaced by lines 439-443 |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" value="$R.x" if="R.x>0"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual type="ont:C" foreach="DISTINCT R.x"> |
+ <property type="ont:P" value="$R.x" if="R.x>0"/> |
+ </individual> |
+ }}} |
Line 472 was replaced by line 445 |
- <p> This patterns must be represented using two first-order rules: |
+ This patterns must be represented using two first-order rules: |
Line 474 was replaced by line 447 |
- <pre> |
+ {{{ |
Line 478 was replaced by line 451 |
- </pre> |
+ }}} |
Line 480 was replaced by line 453 |
- <p> Thus, the condition on the property does not affect whether the |
+ Thus, the condition on the property does not affect whether the |
Line 482 was replaced by line 455 |
- <code>P</code> property. Using property conditions, it is possible to |
+ {{P}} property. Using property conditions, it is possible to |
Line 487 was replaced by line 460 |
- <p> Like with conditions on <code>individual</code> statements, no |
+ Like with conditions on {{individual}} statements, no |
Line 489 was replaced by line 462 |
- <code>property</code> statement conditions. Variables used in |
+ {{property}} statement conditions. Variables used in |
Lines 491-492 were replaced by lines 464-465 |
- property, with the exception of variables within <code>value</code> |
- expressions <a href="#8">[8]</a>, require only one associated value to |
+ property, with the exception of variables within {{value}} |
+ expressions[8], require only one associated value to |
Line 494 was replaced by line 467 |
- to the <code>ANY</code> keyword in SQL). |
+ to the {{ANY}} keyword in SQL). |
Line 497 was replaced by line 470 |
- <h3>3.3 Complex Instantiation Patterns</h3> |
+ !!3.3 Complex Instantiation Patterns |
Lines 499-501 were replaced by lines 472-474 |
- <p> We have described two mechanisms to link individuals to object |
- properties: through <code>valuetype</code> expressions that generate |
- new, anonymous individuals "in place"; and through <code>value</code> |
+ We have described two mechanisms to link individuals to object |
+ properties: through {{valuetype}} expressions that generate |
+ new, anonymous individuals "in place"; and through {{value}} |
Lines 503-504 were replaced by lines 476-477 |
- introduce the use of <em><a href="#label">pattern labels</a></em> and |
- <em><a href="#reference">pattern references</a></em> to additionally |
+ introduce the use of __pattern labels__ and |
+ __pattern references__ to additionally |
Line 508 was replaced by line 481 |
- <p> <b>Pattern Labels.</b> Each individual instantiation pattern can |
+ __Pattern Labels.__ Each individual instantiation pattern can |
Lines 512-514 were replaced by lines 485-487 |
- <pre> |
- <individual label="o1" type="ont:C" foreach="R.x"/> |
- </pre> |
+ {{{ |
+ <individual label="o1" type="ont:C" foreach="DISTINCT R.x"/> |
+ }}} |
Line 516 was replaced by line 489 |
- <p> The first-order rule for this pattern is: |
+ The first-order rule for this pattern is: |
Line 518 was replaced by line 491 |
- <pre> |
+ {{{ |
Line 520 was replaced by line 493 |
- </pre> |
+ }}} |
Line 522 was replaced by line 495 |
- <p> The use of labels in this way does not change the interpretation |
+ The use of labels in this way does not change the interpretation |
Lines 527-529 were replaced by lines 500-501 |
- <p> <b>Referencing Patterns.</b> Properties can reference patterns |
- using pattern labels in <code>value</code> expressions <a |
- href="#9">[9]</a>. To distinguish pattern references from constants |
+ __Referencing Patterns.__ Properties can reference patterns |
+ using pattern labels in {{value}} expressions[9]. To distinguish pattern references from constants |
Lines 534-538 were replaced by lines 506-510 |
- <pre> |
- <individual label="o2" type="ont:D" foreach="R.x, R.y"> |
- <property type="ont:P" value="@o1"/> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual label="o2" type="ont:D" foreach="DISTINCT R.x, R.y"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
+ }}} |
Line 540 was replaced by line 512 |
- <p> This pattern can be read as "For each unique x, y (tuple) value |
+ This pattern can be read as "For each unique x, y (tuple) value |
Line 545 was replaced by line 517 |
- <pre> |
+ {{{ |
Line 548 was replaced by line 520 |
- </pre> |
+ }}} |
Line 550 was replaced by line 522 |
- <p> As with resource variables, pattern references are interpreted |
+ As with resource variables, pattern references are interpreted |
Lines 552-555 were replaced by lines 524-527 |
- because <code>P</code>'s iteration context is "R.x, R.y" and |
- <code>o1</code>'s iteration context is "R.x" (i.e., <code>o1</code>'s |
- <code>foreach</code> expression is contained in <code>P</code>'s |
- enclosing <code>foreach</code> expression), the added <code>P</code> |
+ because {{P}}'s iteration context is "R.x, R.y" and |
+ {{o1}}'s iteration context is "R.x" (i.e., {{o1}}'s |
+ {{foreach}} expression is contained in {{P}}'s |
+ enclosing {{foreach}} expression), the added {{P}} |
Line 557 was replaced by line 529 |
- <code>x</code> value of the iteration context. |
+ {{x}} value of the iteration context. |
Line 559 was replaced by line 531 |
- <p> The iteration context of a property is not required to be a |
+ The iteration context of a property is not required to be a |
Lines 563-573 were replaced by lines 535-545 |
- <pre> |
- <individual label="o3" type="ont:D" foreach="R.y, R.z"> |
- <property type="ont:P" value="@o1"/> |
- </individual> |
- </pre> |
- |
- <p> each unique <code>y</code>, <code>z</code> pair for <code>R</code> |
- will be assigned a property <code>P</code> for every corresponding |
- <code>x</code> value of the pair. Note that in this example, any given |
- <code>y</code>, <code>z</code> pair may have multiple associated |
- <code>x</code> values. |
+ {{{ |
+ <individual label="o3" type="ont:D" foreach="DISTINCT R.y, R.z"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
+ }}} |
+ |
+ each unique {{y}}, {{z}} pair for {{R}} |
+ will be assigned a property {{P}} for every corresponding |
+ {{x}} value of the pair. Note that in this example, any given |
+ {{y}}, {{z}} pair may have multiple associated |
+ {{x}} values. |
Lines 575-576 were replaced by lines 547-548 |
- <p> Also, the iteration context of a property only applies to the |
- referenced pattern, and does <em>not</em> apply to additionally nested |
+ Also, the iteration context of a property only applies to the |
+ referenced pattern, and does __not__ apply to additionally nested |
Lines 579-586 were replaced by lines 551-558 |
- <pre> |
- <individual label="o5" type="ont:E" foreach="R.x, R.z"> |
- <property type="ont:Q" value="@o4"/> |
- </individual> |
- |
- <individual label="o4" type="ont:D" foreach="R.y"> |
- <property type="ont:P" value="@o1"/> |
- </individual> |
+ {{{ |
+ <individual label="o5" type="ont:E" foreach="DISTINCT R.x, R.z"> |
+ <property type="ont:Q" value="@o4"/> |
+ </individual> |
+ |
+ <individual label="o4" type="ont:D" foreach="DISTINCT R.y"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
Line 588 was replaced by line 560 |
- </pre> |
+ }}} |
Line 590 was replaced by line 562 |
- <p> The corresponding first-order rules for these patterns are: |
+ The corresponding first-order rules for these patterns are: |
Line 592 was replaced by line 564 |
- <pre> |
+ {{{ |
Line 598 was replaced by line 570 |
- </pre> |
+ }}} |
Line 600 was replaced by line 572 |
- <p> Thus, although property values containing pattern references are |
+ Thus, although property values containing pattern references are |
Lines 602-603 were replaced by lines 574-575 |
- <code>foreach</code> expression, each distinct pattern is still |
- executed within its own context. To illustrate, let <code>R</code> be |
+ {{foreach}} expression, each distinct pattern is still |
+ executed within its own context. To illustrate, let {{R}} be |
Line 606 was replaced by line 578 |
- <pre> |
+ {{{ |
Line 611 was replaced by line 583 |
- </pre> |
+ }}} |
Line 613 was replaced by line 585 |
- <p> The triples created from pattern <code>o1</code> are: |
+ The triples created from pattern {{o1}} are: |
Line 615 was replaced by line 587 |
- <pre> |
+ {{{ |
Line 618 was replaced by line 590 |
- </pre> |
+ }}} |
Line 620 was replaced by line 592 |
- <p> The triples created from pattern <code>o4</code> are: |
+ The triples created from pattern {{o4}} are: |
Line 622 was replaced by line 594 |
- <pre> |
+ {{{ |
Line 626 was replaced by line 598 |
- </pre> |
+ }}} |
Line 628 was replaced by line 600 |
- <p> And the triples created from pattern <code>o5</code> are: |
+ And the triples created from pattern {{o5}} are: |
Line 630 was replaced by line 602 |
- <pre> |
+ {{{ |
Line 635 was replaced by line 607 |
- </pre> |
+ }}} |
Lines 637-656 were replaced by lines 609-620 |
- <p> Notice that both individuals of pattern <code>o5</code> are |
- <code>Q</code>-related to the same <code>o4</code> |
- individual. Similarly, this <code>o4</code> individual is |
- <code>P</code>-related to both individuals of <code>o1</code>, |
- corresponding to <em>both</em> <code>x</code> values of |
- <code>R</code>, and thus going "out of context" for pattern |
- <code>o5</code>. |
- |
- <p> To use the iteration context of <code>o5</code> for |
- <code>o1</code> while still generating intermediate instances of |
- <code>D</code>, we can use the following pattern, combining |
- <code>o5</code> and <code>o4</code>: |
- |
- <pre> |
- <individual label="o6" type="ont:E" foreach="R.x, R.z"> |
- <property type="ont:Q" valuetype="ont:D"> |
- <property type="ont:P" value="@o1"/> |
- </property> |
- </individual> |
- </pre> |
+ Notice that both individuals of pattern {{o5}} are |
+ {{Q}}-related to the same {{o4}} |
+ individual. Similarly, this {{o4}} individual is |
+ {{P}}-related to both individuals of {{o1}}, |
+ corresponding to __both__ {{x}} values of |
+ {{R}}, and thus going "out of context" for pattern |
+ {{o5}}. |
+ |
+ To use the iteration context of {{o5}} for |
+ {{o1}} while still generating intermediate instances of |
+ {{D}}, we can use the following pattern, combining |
+ {{o5}} and {{o4}}: |
Line 658 was replaced by lines 622-628 |
- <p> The corresponding first-order rule for this pattern is: |
+ {{{ |
+ <individual label="o6" type="ont:E" foreach="DISTINCT R.x, R.z"> |
+ <property type="ont:Q" valuetype="ont:D"> |
+ <property type="ont:P" value="@o1"/> |
+ </property> |
+ </individual> |
+ }}} |
Line 660 was replaced by lines 630-632 |
- <pre> |
+ The corresponding first-order rule for this pattern is: |
+ |
+ {{{ |
Line 665 was replaced by line 637 |
- </pre> |
+ }}} |
Lines 667-670 were replaced by lines 639-642 |
- <p> Note that in this case, however, we generate only one |
- <code>D</code> instance per <code>x</code>, <code>z</code> |
- pair,(instead of one for every value of <code>y</code>. Also, with |
- pattern <code>o6</code>, we can no longer reference the <code>D</code> |
+ Note that in this case, however, we generate only one |
+ {{D}} instance per {{x}}, {{z}} |
+ pair,(instead of one for every value of {{y}}. Also, with |
+ pattern {{o6}}, we can no longer reference the {{D}} |
Lines 673-674 were replaced by lines 645-646 |
- <p> <b>Property Iteration and Labels</b>. It is also possible to apply |
- <code>foreach</code> expressions to <code>property</code> statements, |
+ __Property Iteration and Labels__. It is also possible to apply |
+ {{foreach}} expressions to {{property}} statements, |
Line 676 was replaced by line 648 |
- individuals, for cases like <code>o6</code> above, should be |
+ individuals, for cases like {{o6}} above, should be |
Lines 679-685 were replaced by lines 651-657 |
- <pre> |
- <individual label="o7" type="ont:E" foreach="R.x, R.z"> |
- <property type="ont:Q" valuetype="ont:D" foreach="R.y" label="o8"> |
- <property type="ont:P" value="@o1"/> |
- </property> |
- </individual> |
- </pre> |
+ {{{ |
+ <individual label="o7" type="ont:E" foreach="DISTINCT R.x, R.z"> |
+ <property type="ont:Q" valuetype="ont:D" foreach="DISTINCT R.y" label="o8"> |
+ <property type="ont:P" value="@o1"/> |
+ </property> |
+ </individual> |
+ }}} |
Line 687 was replaced by line 659 |
- <p> results in the first-order rule: |
+ results in the first-order rule: |
Line 689 was replaced by line 661 |
- <pre> |
+ {{{ |
Line 695 was replaced by line 667 |
- </pre> |
+ }}} |
Lines 697-698 were replaced by lines 669-670 |
- <p> As shown, labels may also be applied to intermediate individuals |
- (via their corresponding <code>property</code> statements), allowing |
+ As shown, labels may also be applied to intermediate individuals |
+ (via their corresponding {{property}} statements), allowing |
Lines 701-702 were replaced by lines 673-674 |
- <code>foreach</code> expression with each of its ancestor's |
- <code>foreach</code> expressions. |
+ {{foreach}} expression with each of its ancestor's |
+ {{foreach}} expressions. |
At line 704 added 1 line. |
+ !!!Glossary |
Line 706 was replaced by line 679 |
- <a name="glossary"></a> <h2>Glossary</h2> |
+ ;Semantic Annotation: A mapping from a resource to an instance(s) of an ontology(ies). Semantic annotations in our framework have identifiers as well as associated metadata (who created the annotation, and so on). |
Lines 708-711 were replaced by line 681 |
- <p> <b><a name="annotation">Semantic Annotation<a/>:</b> A mapping |
- from a resource to an instance(s) of an ontology(ies). Semantic |
- annotations in our framework have identifiers as well as associated |
- metadata (who created the annotation, and so on). |
+ ;Resource: A structured information source with a defined schema. Can be a dataset or a service, such as a workflow, actor, or web-service. |
Lines 713-715 were replaced by line 683 |
- <p> <b><a name="resource">Resource</a>:</b> A structured information |
- source with a defined schema. Can be a dataset or a service, such as |
- a workflow, actor, or web-service. |
+ ;Ontology: Here, by ontology we mean an OWL-based representation of a set of concepts, properties, and constraints (axioms). |
Lines 717-719 were replaced by line 685 |
- <p> <b><a name="ontology">Ontology</a>:</b> Here, by ontology we mean |
- an OWL-based representation of a set of concepts, properties, and |
- constraints (axioms). |
+ ;Semantic Annotation Template: A set of instantiation patterns within a particular semantic annotation. |
Lines 721-805 were replaced by lines 687-689 |
- <p> <b><a name="template">Semantic Annotation Template</a>:</b> A set |
- of instantiation patterns within a particular semantic annotation. |
- |
- <p> <b><a name="pattern">Instantiation Pattern</a>:</b> An XML-based |
- specification of a mapping from portions of a resource to instances |
- of an ontology. |
- |
- <p> <b><a name="prefix">Prefix Label</a>:</b> A label used to |
- represent an ontology location. |
- |
- <p> <b><a name="variable">Resource Variable</a>:</b> An attribute of a |
- resource, which in an annotation template takes the form 'R.x' (or |
- more generally a path expression 'R.x1.x2...xn' for nested |
- relations). |
- |
- <p> <b><a name="context">Iteration Context</a>:</b> The set of |
- resource variables, or current variable bindings (as the pattern is |
- being executed), for a property or condition in an instantiation |
- pattern. The iteration context is determined by the enclosing |
- <code>foreach</code> expression of the item in question. |
- |
- <p> <b><a name="label">Pattern Label</a>:</b> A label assigned to a |
- template instantiation pattern. |
- |
- <p> <b><a name="reference">Pattern Reference</a>:</b> A reference to a |
- template instantiation pattern (using a pattern label) from within |
- an object property in another (or possibly the same) pattern. |
- |
- |
- |
- <a name="footnotes"></a> <h2>Footnotes</h2> |
- |
- <p> <a name="1">[1]</a> In OWL, instances of classes are called |
- 'individuals.' |
- |
- <p> <a name="2">[2]</a> Alternatively, we could use anonymous |
- identifiers for generated OWL individuals. However, using explicit |
- as opposed to anonymous identifiers has a number of advantages, |
- e.g., identifiers can be used for "provenance" (that is, using |
- conventions for identifier names one could go from the created OWL |
- individuals back to the resource item used to generte the resource), |
- and also make it easier to formalize the interpretation of patterns |
- in first-order logic. |
- |
- <p> <a name="2">[3]</a> The examples of resources in this document are |
- assumed to be relational data sets. However, the approach described |
- here can be used with a variety of resource structures, including |
- nested relational data (e.g., like in XML). |
- |
- <p> <a name="3">[4]</a> By default, variables in <code>foreach</code> |
- expressions that are null in the resource do not generate |
- corresponding ontology class instances. |
- |
- <p> <a name="5">[5]</a> We use the notation <code>(Axy)</code> for |
- universal quantification over variables <code>x</code> and |
- <code>y</code>; <code>(Exy)</code> for existential quantification |
- over variables <code>x</code> and <code>y</code>; and |
- <code>-></code> for implication. |
- |
- <p> <a name="6">[6]</a> Note that the use of <code>property</code> |
- expressions in this way is useful for cases in which the property is |
- either (i) not defined (or optional) in the ontology for the |
- associated class, or (ii) is a required property, but the |
- <code>valuetype</code> expression gives a subclass of the property's |
- defined range. |
- |
- <p> <a name="7">[7]</a> Implicitly, this pattern is equivalent to the pattern: |
- |
- <pre> |
- <individual type="ont:C" foreach="R.x"> |
- <property type="ont:P" value="$R.y" foreach="R.y"/> |
- </individual> |
- </pre> |
- |
- <p> That is, for each unique <code>x</code>, <code>y</code> pair, |
- assign a <code>P</code> property with value <code>y</code> to the |
- corresponding <code>C</code> instance. Additional uses of |
- <code>foreach</code> attributes on properties are discussed later. |
- |
- <p> <a name="8">[8]</a> Because the variable used within a |
- <code>value</code> attribute is implicitly carried over to the |
- <code>property</code> statement's <code>foreach</code> expression |
- (see <a href="#7">[7]</a>), these resource variables are considered |
- to be part of the <code>property</code> statement's iteration |
- context. |
+ ;Instantiation Pattern: An XML-based specification of a mapping from portions of a resource to instances of an ontology. |
+ |
+ ;Prefix Label: A label used to represent an ontology location. |
Lines 807-808 were replaced by lines 691-720 |
- <p> <a name="9">[9]</a> Pattern references can be cyclic, i.e., a |
- property within a pattern p can contain a property that refers to p. |
+ ;Resource Variable: An attribute of a resource, which in an annotation template takes the form 'R.x' (or more generally a path expression 'R.x1.x2...xn' for nested relations). |
+ |
+ ;Iteration Context: The set of resource variables, or current variable bindings (as the pattern is being executed), for a property or condition in an instantiation pattern. The iteration context is determined by the enclosing {{foreach}} expression of the item in question. |
+ |
+ ;Pattern Label: A label assigned to a template instantiation pattern. |
+ |
+ ;Pattern Reference: A reference to a template instantiation pattern (using a pattern label) from within an object property in another (or possibly the same) pattern. |
+ |
+ |
+ !!!Footnotes |
+ |
+ [#1] In OWL, instances of classes are called 'individuals.' |
+ |
+ [#2] Alternatively, we could use anonymous identifiers for generated OWL individuals. However, using explicit as opposed to anonymous identifiers has a number of advantages, e.g., identifiers can be used for "provenance" (that is, using conventions for identifier names one could go from the created OWL individuals back to the resource item used to generte the resource), and also make it easier to formalize the interpretation of patterns in first-order logic. |
+ |
+ [#3] The examples of resources in this document are assumed to be relational data sets. However, the approach described here can be used with a variety of resource structures, including nested relational data (e.g., like in XML). |
+ |
+ [#4] By default, variables in {{foreach}} expressions that are null in the resource do not generate corresponding ontology class instances. |
+ |
+ [#5] We use the notation {{(Axy)}} for universal quantification over variables {{x}} and {{y}}; {{(Exy)}} for existential quantification over variables {{x}} and {{y}}; and {{->}} for implication. |
+ |
+ [#6] Note that the use of {{property}} expressions in this way is useful for cases in which the property is either (i) not defined (or optional) in the ontology for the associated class, or (ii) is a required property, but the {{valuetype}} expression gives a subclass of the property's defined range. |
+ |
+ [#7] Implicitly, this pattern is equivalent to the pattern: |
+ |
+ {{{ |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="$R.y" foreach="R.y"> |
+ </individual> |
+ }}} |
At line 809 added 1 line. |
+ That is, for each unique {{x}}, {{y}} pair, assign a {{P}} property with value {{y}} to the corresponding {{C}} instance. Additional uses of {{foreach}} attributes on properties are discussed later. |
Lines 811-812 were replaced by line 724 |
- </body> |
- </html> |
+ [#8] Because the variable used within a {{value}} attribute is implicitly carried over to the {{property}} statement's {{foreach}} expression (see [7]), these resource variables are considered to be part of the {{property}} statement's iteration context. |
At line 813 added 1 line. |
+ [#9] Pattern references can be cyclic, i.e., a property within a pattern p can contain a property that refers to p. |