index.html 35.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 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 149 150 151 152 153 154 155 156 157 158 159 160 161 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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
<!DOCTYPE html  PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>OWL 2 Web Ontology Language Data Range Extension: Linear Equations</title>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  <style type="text/css">
   .editsection { display: none; }
</style>
<link href="owl.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/W3C-WG-NOTE" rel="stylesheet" type="text/css" />

  <script src="http://www.w3.org/2007/OWL/toggles.js" type="text/javascript"></script>

</head>
<body>

<div class="head">
<a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72" /></a><h1 id="title" style="clear:both">OWL 2 Web Ontology Language <br /><span id="short-title">Data Range Extension: Linear Equations</span></h1>

<h2 id="W3C-doctype">W3C Working Group Note 27 October 2009</h2>

<!-- no inplace warning -->
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2009/NOTE-owl2-dr-linear-20091027/" id="this-version-url">http://www.w3.org/TR/2009/NOTE-owl2-dr-linear-20091027/</a></dd>

<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/owl2-dr-linear/">http://www.w3.org/TR/owl2-dr-linear/</a></dd>

<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2009/WD-owl2-dr-linear-20090611/">http://www.w3.org/TR/2009/WD-owl2-dr-linear-20090611/</a> (<a href="http://www.w3.org/TR/2009/NOTE-owl2-dr-linear-20091027/diff-from-20090611">color-coded diff</a>)</dd>
</dl>

<dl><dt>Authors:</dt><dd><a href="http://www.cs.man.ac.uk/~bparsia/">Bijan Parsia</a>, University of Manchester</dd>
<dd><a href="http://www.cs.man.ac.uk/~sattler/">Uli Sattler</a>, University of Manchester</dd>
</dl>



<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/2009/pdf/NOTE-owl2-dr-linear-20091027.pdf">PDF version</a>.</p>



<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2009 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>

</div>
<hr />
<h2><a id="abstract" name="abstract">Abstract</a></h2>

<div>
<div><p>The OWL 2 Web Ontology Language, informally OWL 2, is an ontology language for the Semantic Web with formally defined meaning.  OWL 2 ontologies provide classes, properties, individuals, and data values and are stored as Semantic Web documents.  OWL 2 ontologies can be used along with information written in RDF, and OWL 2 ontologies themselves are primarily exchanged as RDF documents.  The OWL 2 <a href="http://www.w3.org/TR/2009/REC-owl2-overview-20091027/" title="Document Overview">Document Overview</a> describes the overall state of OWL 2, and should be read before other OWL 2 documents.</p><p>This document specifies a syntax and semantics for incorporating linear equations with rational coefficients solved in the reals in OWL 2.</p></div>
</div>

<h2 class="no-toc no-num">
<a id="status" name="status">Status of this Document</a>
</h2>
    
<h4 class="no-toc no-num" id="may-be">May Be Superseded</h4>
    
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>

    

<!-- no eventStatusExtra -->

<!-- no statusExtra -->

<div>

<h4 class="no-toc no-num" id="sotd-xml-dep">XML Schema Datatypes Dependency</h4>

<p>OWL 2 is defined to use datatypes defined in the <a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Definition Language (XSD)</a>.  As of this writing, the latest W3C Recommendation for XSD is version 1.0, with <a href="http://www.w3.org/TR/xmlschema11-1/">version 1.1</a> progressing toward Recommendation.  OWL 2 has been designed to take advantage of the new datatypes and clearer explanations available in XSD 1.1, but for now those advantages are being partially put on hold.  Specifically, until XSD 1.1 becomes a W3C Recommendation, the elements of OWL 2 which are based on it should be considered <em>optional</em>, as detailed in <a href="http://www.w3.org/TR/2009/REC-owl2-conformance-20091027/#XML_Schema_Datatypes">Conformance, section 2.3</a>.  Upon the publication of XSD 1.1 as a W3C Recommendation, those elements cease to be optional and are to be considered required as otherwise specified.</p>

<p>We suggest that for now developers and users follow the <a href="http://www.w3.org/TR/2009/CR-xmlschema11-1-20090430/">XSD 1.1 Candidate Recommendation</a>.  Based on discussions between the Schema and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation.</p>
</div>



           <h4 class="no-toc no-num" id="status-changes">Summary of Changes</h4>

            <div>There have been no <a href="http://www.w3.org/2005/10/Process-20051014/tr#substantive-change">substantive</a> changes since the <a href="http://www.w3.org/TR/2009/WD-owl2-dr-linear-20090611/">previous version</a>.   For details on the minor changes see the <a href="#changelog">change log</a> and <a href="http://www.w3.org/TR/2009/NOTE-owl2-dr-linear-20091027/diff-from-20090611">color-coded diff</a>.</div>



<h4 class="no-toc no-num" id="please">Please Send Comments</h4><p>Please send any comments to <a class="mailto" href="mailto:public-owl-comments@w3.org">public-owl-comments@w3.org</a>
    (<a class="http" href="http://lists.w3.org/Archives/Public/public-owl-comments/">public
    archive</a>).  Although work on this document by the <a href="http://www.w3.org/2007/OWL/">OWL Working Group</a> is complete, comments may be addressed in the <a href="http://www.w3.org/2007/OWL/errata">errata</a> or in future revisions.  Open discussion among developers is welcome at <a class="mailto" href="mailto:public-owl-dev@w3.org">public-owl-dev@w3.org</a> (<a class="http" href="http://lists.w3.org/Archives/Public/public-owl-dev/">public archive</a>).</p>
    
<h4 class="no-toc no-num" id="no-endorsement">No Endorsement</h4>
    
<p><em>Publication as a Working Group Note does not imply endorsement by the W3C Membership. This document may be updated, replaced or obsoleted by other documents at any time.  Therefore, quotes or references to specific information in the document should include the publication date of this version, 27 October 2009. It is inappropriate to cite this document as other than a Working Group Note, which is not an endorsed W3C Recommendation.</em></p>


<h4 class="no-toc no-num" id="patents">Patents</h4>
    
<p><em>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. The group does not expect this document to become a W3C Recommendation.  W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/41712/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent.An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure"> section 6 of the W3C Patent Policy</a>.</em></p>

<hr title="Separator After Status Section" />


<table class="toc" id="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a></li>
<li class="toclevel-1"><a href="#Examples"><span class="tocnumber">2</span> <span class="toctext">Examples</span></a></li>
<li class="toclevel-1"><a href="#Syntax"><span class="tocnumber">3</span> <span class="toctext">Syntax</span></a>
<ul>
<li class="toclevel-2"><a href="#Functional_Syntax"><span class="tocnumber">3.1</span> <span class="toctext">Functional Syntax</span></a></li>
<li class="toclevel-2"><a href="#RDF_Mapping"><span class="tocnumber">3.2</span> <span class="toctext">RDF Mapping</span></a></li>
<li class="toclevel-2"><a href="#XML_Syntax"><span class="tocnumber">3.3</span> <span class="toctext">XML Syntax</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Semantics"><span class="tocnumber">4</span> <span class="toctext">Semantics</span></a></li>
<li class="toclevel-1"><a href="#Implementation_Considerations"><span class="tocnumber">5</span> <span class="toctext">Implementation Considerations</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_XML_Schemas"><span class="tocnumber">6</span> <span class="toctext">Appendix: XML Schemas</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Change_Log_.28Informative.29"><span class="tocnumber">7</span> <span class="toctext">Appendix: Change Log (Informative)</span></a>
<ul>
<li class="toclevel-2"><a href="#Changes_Since_Draft_of_11_June_2009"><span class="tocnumber">7.1</span> <span class="toctext">Changes Since Draft of 11 June 2009</span></a></li>
</ul>
</li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<p><br />
</p>
<a name="Overview"></a><h2> <span class="mw-headline">1  Overview </span></h2>
<p>OWL 2 has a sophisticated set of built-in numeric dataranges and <a class="external text" href="http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/#Data_Ranges" title="http://www.w3.org/2007/OWL/wiki/Syntax#Data_Ranges">rather expressive constructors</a> for building new dataranges out of the basic dataranges. A major restriction on the sort of data ranges that can be built with existing constructors (i.e., datatype facets) is that only <b>unary</b> dataranges can be defined --- i.e.,  only datatypes may be defined. One can say that the value of a data property has to be an integer greater than 5, but one cannot say that the value of one data property is greater than that of another data property. Furthermore, one might wish to relate the values of two properties by more complex equations than mere comparisons.
</p><p>This document defines an extension to OWL for defining dataranges in terms of linear (in)equalites with rational coefficients solved over the algebraic reals. These dataranges can be used in OWL axioms to, for example, define classes in terms of a constraint on the relationships between values of distinct data properties.
</p><p>This extension is restricted in two respects for the sake of reasonable implementability:
</p>
<ul><li> The datarange definition language is limited to linear (in)equations with rational coefficients. Transcendental functions (such as <i>sin</i>) are not permitted. Similarly, non-linear polynomials are not permitted. While both are essential to many applications, they are not likely to be widely implemented due to practical and theoretical problems that still must be dealt with.
</li><li> Equation-based dataranges can only constrain values of data properties of a single individual. That is, one cannot compare the boiling point of the one individual, <i>water</i>, with the boiling point of another individual, say, <i>copper</i>. Restrictions using dataranges this way are known as <b>path free</b>. While the theory for arbitrary data restrictions is well known, there is still a dearth of optimizations that would make their inclusion practical.
</li></ul>
<p>These restrictions may be lifted, to various degrees,  in future versions of this specification.
</p>
<a name="Examples"></a><h2> <span class="mw-headline">2  Examples </span></h2>
<p>Consider the relation between the boiling point and the melting point of a substance. For example, for water (at 1 atmosphere) the boiling point is 100C and the melting point 0C. This can be represented in plain OWL quite easily:
</p>
<pre>ClassAssertion(DataHasValue(melting_point "0"^^xsd:decimal) water)
ClassAssertion(DataHasValue(boiling_point "100"^^xsd:decimal) water)
</pre>
<p>From these assertions it follows that the boiling point of water is greater than its melting point. This is, in fact, a general principle for substances: the boiling point of a normal physical substance is greater or equal to its melting point. This physical law can be expressed with a datarange with two free variables x and y, representing the melting and boiling point, respectively.:
</p>
<pre>EquivalentClasses(NormalSubstance DataAllValuesFrom(melting_point boiling_point 
        DataComparison(Arguments(x y) leq( x y ))))
</pre>
<p>With this definition (and given that <i>melting_point</i> and <i>boiling_point</i> are functional), one can infer:
</p>
<pre>ClassAssertion(NormalSubstance water)
</pre>
<p>When administering drugs, there are many factors that go into determining the maximum safe dose. Often, the maximum the maximum single dose of a drug is computed in terms of milligram of drug per kilogram of body weight.
</p>
<pre>EquivalentClasses(SafelyDosedPatient DataAllValuesFrom(tookDrugInAmount weight
        DataComparison(Arguments(totalDoseInMg weightinKg) leq(totalDoseInMg times(2, weightInKg)))))
</pre>
<p>This axiom states that the safe dose is 2 milligrams per kilogram, and thus that a safe dose (in milligrams) for a person of a given weight must be less than 2 times the weight (in kilograms) of the patient. 
</p><p>As safe doses vary with age and other factors, one could define a number of such classes with varying constraints on the safety of the dose.
</p>
<a name="Syntax"></a><h2> <span class="mw-headline">3 Syntax</span></h2>
<a name="Functional_Syntax"></a><h3> <span class="mw-headline">3.1  Functional Syntax </span></h3>
<p>As with built-in OWL 2 data ranges, linear (in)equations may be used to form universal, existential, and quantified restrictions on (sets of) data properties.
</p>
<div class="grammar">
<p><span class="nonterminal">ComparisonRelation</span>&nbsp;:= <br />
&nbsp;&nbsp;&nbsp; 'gt' |<br />
&nbsp;&nbsp;&nbsp; 'lt' | <br />
&nbsp;&nbsp;&nbsp; 'geq' |<br />
&nbsp;&nbsp;&nbsp; 'leq' |<br />
&nbsp;&nbsp;&nbsp; 'eq' |<br />
&nbsp;&nbsp;&nbsp; 'neq' <br />
<span class="nonterminal">Variable</span>&nbsp;:= <span class="nonterminal">NCName</span><br />
<span class="nonterminal">Rational</span>&nbsp;:= Integer / NonZeroInteger <br />
<span class="nonterminal">Term</span>&nbsp;:= 'times' '(' [ <span class="nonterminal">Rational</span> ] <span class="nonterminal">Variable</span>  ')' | <span class="nonterminal">Variable</span><br />
<span class="nonterminal">LinearExpression</span>:= 'plus' '(' <span class="nonterminal">Term</span> { <span class="nonterminal">Term</span> }  ')' | <span class="nonterminal">Term</span> | <span class="nonterminal">Variable</span><br />
<span class="nonterminal">Arguments</span>&nbsp;:= 'Arguments' '(' <span class="nonterminal">NCName</span> { <span class="nonterminal">NCName</span> } ')'<br />
<span class="nonterminal">Comparison</span>&nbsp;:= 'DataComparison' '('  <span class="nonterminal">Arguments</span> <span class="nonterminal">ComparisonRelation</span>'(' <span class="nonterminal">Variable</span> <span class="nonterminal">Variable</span> ')' ')'<br />
<span class="nonterminal">ScaledComparison</span>&nbsp;:=  'DataComparison' (' <span class="nonterminal">Arguments</span> <span class="nonterminal">ComparisonRelation</span> '(' <span class="nonterminal">Term</span> <span class="nonterminal">Term</span> ')' ')'<br />
<span class="nonterminal">LinearComparison</span>&nbsp;:= 'DataComparison' '('   <span class="nonterminal">Arguments</span> <span class="nonterminal">ComparisonRelation</span> '(' <span class="nonterminal">LinearExpression</span> <span class="nonterminal">LinearExpression</span> ')' ')'<br />
<span class="nonterminal">DataComparison</span>&nbsp;:= <span class="nonterminal">Comparison</span> | <span class="nonterminal">ScaledComparison</span> | <span class="nonterminal">LinearComparison</span>
</p>
</div>
<p>The definition of a DataRange is extended with the various comparisons:
</p>
<div class="grammar">
<p><span class="nonterminal">DataRange</span>&nbsp;:=<br />
&nbsp;&nbsp;&nbsp; <span class="nonterminal">Datatype</span> |<br />
&nbsp;&nbsp;&nbsp; <span class="nonterminal">DataComplementOf</span> |<br />
&nbsp;&nbsp;&nbsp; <span class="nonterminal">DataOneOf</span> |<br />
&nbsp;&nbsp;&nbsp; <span class="nonterminal">DatatypeRestriction</span> |<br />
&nbsp;&nbsp;&nbsp; <span class="nonterminal">DataComparison</span>
</p>
</div>
<p>It is not currently possible for user defined (in)equations to be named, though it is easy to spec a natural syntax:
</p>
 <div class="grammar"> <span class="nonterminal">DataComparisonDefinition</span>&nbsp;:= 'DataComparisonDefinition' '(' axiomAnnotations IRI DataRange ')' </div>
<p>In order to retain decidability with naming, there needs to be acyclicity condition akin to <a class="external text" href="http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/#The_Restrictions_on_the_Axiom_Closure" title="http://www.w3.org/2007/OWL/wiki/Syntax#The_Restrictions_on_the_Axiom_Closure">those for datatypes</a>. Furthermore, since there are <i>DataComparisons</i> which are equivalent to datatypes, the datatype and data comparison conditions must appropriately interact.
</p>
<a name="RDF_Mapping"></a><h3> <span class="mw-headline">3.2  RDF Mapping </span></h3>
<p>(In)equations in RDF are expressed using MathML as below. The equations are serialized as <i>rdf:XMLLiteral</i>s. The content of those literals must conform to the "owl-linear-comparisons-mathml.xsd".
</p>
<pre>
&lt;!DOCTYPE rdf:RDF [
&lt;!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" &gt;
]&gt;
&lt;rdf:RDF xmlns="http://example.org/#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"&gt;
    &lt;owl:Ontology rdf:about="http://example.org/"/&gt;
    &lt;owl:DatatypeProperty rdf:about="#boiling_point"/&gt;
    &lt;owl:DatatypeProperty rdf:about="#melting_point"/&gt;

    &lt;owl:Class rdf:about="#NormalSubstance"&gt;
        &lt;owl:equivalentClass&gt;
            &lt;owl:Restriction&gt;
                &lt;owl:onProperties rdf:parseType="Collection"&gt;
                    &lt;owl:DatatypeProperty rdf:about="#boiling_point"/&gt;
                    &lt;owl:DatatypeProperty rdf:about="#melting_point"/&gt;
                &lt;/owl:onProperties&gt;
                &lt;owl:allValuesFrom&gt;
                    &lt;owl:DataComparison&gt;
                        &lt;rdf:value rdf:parseType="Literal"&gt;
                            &lt;lambda xmlns="http://www.w3.org/1998/Math/MathML"
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:schemaLocation="http://www.w3.org/1998/Math/MathML
                                            owl-linear-comparisons-mathml.xsd"&gt;
                                &lt;bvar&gt;
                                    &lt;ci&gt;x&lt;/ci&gt;
                                &lt;/bvar&gt;
                                &lt;bvar&gt;
                                    &lt;ci&gt;y&lt;/ci&gt;
                                &lt;/bvar&gt;
                                &lt;apply&gt;
                                    &lt;leq/&gt;
                                    &lt;ci&gt;x&lt;/ci&gt;
                                    &lt;ci&gt;y&lt;/ci&gt;
                                &lt;/apply&gt;
                            &lt;/lambda&gt;
                        &lt;/rdf:value&gt;
                    &lt;/owl:DataComparison&gt;
                &lt;/owl:allValuesFrom&gt;
            &lt;/owl:Restriction&gt;
        &lt;/owl:equivalentClass&gt;
    &lt;/owl:Class&gt;

    &lt;rdf:Description rdf:about="#water"&gt;
        &lt;rdf:type&gt;
            &lt;owl:Restriction&gt;
                &lt;owl:onProperty rdf:resource="#boiling_point"/&gt;
                &lt;owl:hasValue rdf:datatype="&amp;xsd;integer"&gt;100&lt;/owl:hasValue&gt;
            &lt;/owl:Restriction&gt;
        &lt;/rdf:type&gt;
        &lt;rdf:type&gt;
            &lt;owl:Restriction&gt;
                &lt;owl:onProperty rdf:resource="#melting_point"/&gt;
                &lt;owl:hasValue rdf:datatype="&amp;xsd;integer"&gt;0&lt;/owl:hasValue&gt;
            &lt;/owl:Restriction&gt;
        &lt;/rdf:type&gt;
    &lt;/rdf:Description&gt;
 &lt;/rdf:RDF&gt;
</pre>
<a name="XML_Syntax"></a><h3> <span class="mw-headline">3.3 XML Syntax</span></h3>
<p>For the XML syntax, the terminals of the functional syntax are mapped into corresponding MathML elements. Consider the water example:
</p>
<pre>
&lt;Ontology xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/2002/07/owl# owlxml-datarange.xsd"
    xmlns="http://www.w3.org/2002/07/owl#"
    ontologyIRI="http://example.org/"&gt;
    &lt;ClassAssertion&gt;
        &lt;DataHasValue&gt;
            &lt;DataProperty IRI="melting_point"/&gt;
            &lt;Literal datatypeIRI="xsd:decimal"&gt;0&lt;/Literal&gt;
        &lt;/DataHasValue&gt;
        &lt;NamedIndividual IRI="water"/&gt;
    &lt;/ClassAssertion&gt;
    &lt;ClassAssertion&gt;
        &lt;DataHasValue&gt;
            &lt;DataProperty IRI="boiling_point"/&gt;
            &lt;Literal datatypeIRI="xsd:decimal"&gt;100&lt;/Literal&gt;
        &lt;/DataHasValue&gt;
        &lt;NamedIndividual IRI="water"/&gt;
    &lt;/ClassAssertion&gt;
    
    &lt;EquivalentClasses&gt;
        &lt;Class IRI="NormalSubstance"/&gt;
        &lt;DataAllValuesFrom&gt;
            &lt;DataProperty IRI="melting_point"/&gt;
            &lt;DataProperty IRI="boiling_point"/&gt;
            &lt;DataComparison&gt;
                &lt;lambda xmlns="http://www.w3.org/1998/Math/MathML"&gt;
                    &lt;bvar&gt;
                        &lt;ci&gt;x&lt;/ci&gt;
                    &lt;/bvar&gt;
                    &lt;bvar&gt;
                        &lt;ci&gt;y&lt;/ci&gt;
                    &lt;/bvar&gt;
                    &lt;apply&gt;
                        &lt;leq/&gt;
                        &lt;ci&gt;x&lt;/ci&gt;
                        &lt;ci&gt;y&lt;/ci&gt;
                    &lt;/apply&gt;
                &lt;/lambda&gt;
            &lt;/DataComparison&gt;
        &lt;/DataAllValuesFrom&gt;
    &lt;/EquivalentClasses&gt;
&lt;/Ontology&gt;
</pre>
<p>In order to validate, one must use an extended version of the XML Schema. See Appendix A for the schema.
</p><p><br />
</p>
<a name="Semantics"></a><h2> <span class="mw-headline">4  Semantics </span></h2>
<p>The semantics of all constructs where data ranges can occur (DataSomeValuesFrom, DataAllValuesFrom, DataMinCardinality, DataExactCardinality, DataMaxCardinality, DataComplementOf) is defined in Section 2 of the <a class="external text" href="http://www.w3.org/TR/2008/WD-owl2-semantics-20080411/#Model-Theoretic_Semantics_for_OWL_2" title="http://www.w3.org/TR/2008/WD-owl2-semantics-20080411/#Model-Theoretic_Semantics_for_OWL_2">Semantics</a>. This section defines the meaning of  DataComparisons.
</p><p>As explained in the <a class="external text" href="http://www.w3.org/TR/2008/WD-owl2-semantics-20080411/#Model-Theoretic_Semantics_for_OWL_2" title="http://www.w3.org/TR/2008/WD-owl2-semantics-20080411/#Model-Theoretic_Semantics_for_OWL_2">Semantics</a> document, this is accomplished by extending the  datatype interpretation function <i>&sdot;&nbsp;<sup>DT</sup></i> to <i>DataComparison</i>. First some notation: for an expression <i>exp</i>, a variable <i>y</i> and a value <i>v</i>, <i>exp[y -&gt; v]</i> is the expression obtained by replacing all occurrences of <i>y</i> in <i>exp</i> with <i>v</i>. 
</p><p>Next, on the value space of <i>owl:real</i>, the equality <i>=</i> and  ordering <i>&lt;</i> are  defined as usual, and  the operators <i>+</i> and <i>*</i> are the usual addition and multiplication operators on the real numbers.
</p><p>The value of terms is then defined as follows: 
</p>
<ul><li> <i>(times(v1 v2))<sup>DT</sup> = v1 * v2</i>
</li><li> <i>(plus (t1 ... tk))<sup>DT</sup> = (t1)<sup>DT</sup> + ... + (tk)<sup>DT</sup></i>
</li></ul>
<p><br />
Intuitively, in order to find out whether a pair <i>(5,60)</i> of numbers is in, say, <i>DataComparison(Arguments(y1 y2) lt (times("4"^^owl:real y1) times("1"^^owl:real y1)))<sup>DT</sup></i>, one replaces all occurrences of <i>y1</i> in both <i>times(...)</i> terms with <i>5</i>, all occurrences of <i>y2</i> in both terms  with <i>60</i>, computes the value of both <i>times(...)</i> terms (the first giving 20, the second giving 60), and then checks whether <i>lt</i> holds between them. Since this is indeed the case, the pair <i>(5,60)</i> is in <i>DataComparison(...)</i>. 
</p><p>In what follows, <i>y1</i> and <i>y2</i> refer to variables, <i>t1</i> and <i>t2</i> to terms, and <i>L1</i> and <i>L2</i> to linear expressions.
</p>
<ul><li> <i>(DataComparison(Arguments(y1 y2) comprel(y1 y2)))<sup>DT</sup> = </i>
<ul><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v1 &lt; v2 }</i> if <i>comprel</i> is <i>lt</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v2 &lt; v1 }</i> if <i>comprel</i> is <i>gt</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v1 &lt; v2</i> or <i>v1 = v2 }</i> if <i>comprel</i> is <i>leq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v2 &lt; v1</i> or <i>v1 = v2 }</i> if <i>comprel</i> is <i>geq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v2 = v1 }</i> if <i>comprel</i> is <i>eq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | v2 &lt; v1</i>  or <i>v1 &lt; v2 }</i> if <i>comprel</i> is <i>neq</i>
</li></ul>
</li></ul>
<p><br />
</p>
<ul><li> <i>(DataComparison(Arguments(y1 y2) comprel(t1 t2)))<sup>DT</sup>  = </i>
<ul><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> &lt; (t2[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>lt</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t2[y1-&gt;v1][y2-&gt;v2]))<sup>DT</sup> &lt; (t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>gt</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t1[y1-&gt;v1][y2-&gt;v2]))<sup>DT</sup> &lt; (t2[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup></i> or <i>(t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> = (t2[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>leq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t2[y1-&gt;v1][y2-&gt;v2]))<sup>DT</sup> &lt; (t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup></i> or <i>(t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> = (t2[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>geq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t2[y1-&gt;v1][y2-&gt;v2]))<sup>DT</sup> = (t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>eq</i>
</li><li> <i>{ (v1, v2) in ((owl:real)<sup>DT</sup>)<sup>2</sup> | (t2[y1-&gt;v1][y2-&gt;v2]))<sup>DT</sup> &lt; (t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup></i>  or <i>(t1[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> &lt; (t2[y1-&gt;v1][y2-&gt;v2])<sup>DT</sup> }</i> if <i>comprel</i> is <i>neq</i>
</li></ul>
</li></ul>
<p><br />
</p>
<ul><li> <i>(DataComparison(Arguments(y1 ... yk) comprel(L1 L2)))<sup>DT</sup> = </i>
<ul><li> <i>{ (v1,..., vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>lt</i>
</li><li> <i>{ (v1, ...,vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>gt</i>
</li><li> <i>{ (v1,..., vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup></i> or <i>(L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> = (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>leq</i>
</li><li> <i>{ (v1,...,vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup></i> or <i>(L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> = (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>geq</i>
</li><li> <i>{ (v1,..., vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> = (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>eq</i>
</li><li> <i>{ (v1,..., vk) in ((owl:real)<sup>DT</sup>)<sup>k</sup> | (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup></i>  or <i>(L1[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> &lt; (L2[y1-&gt;v1]...[yk-&gt;vk])<sup>DT</sup> }</i> if <i>comprel</i> is <i>neq</i>
</li></ul>
</li></ul>
<a name="Implementation_Considerations"></a><h2> <span class="mw-headline">5  Implementation Considerations </span></h2>
<p>There is a rich literature on implementing linear solvers. The key papers for the integration between OWL and a linear solver are:
</p>
<ul><li> <a class="external text" href="http://SunSITE.Informatik.RWTH-Aachen.de/Publications/CEUR-WS//Vol-86/13-Lutz.ps" title="http://SunSITE.Informatik.RWTH-Aachen.de/Publications/CEUR-WS//Vol-86/13-Lutz.ps">Description Logics with Concrete Domains - A Survey</a>
</li><li> <a class="external text" href="http://www.racer-systems.com/technology/contributions/2003/HaMo03b.pdf" title="http://www.racer-systems.com/technology/contributions/2003/HaMo03b.pdf">Description Logic Systems with Concrete Domains: Applications for the Semantic Web</a>
</li></ul>
<div id="changelog">
<a name="Appendix:_XML_Schemas"></a><h2> <span class="mw-headline">6  Appendix: XML Schemas </span></h2>
<p>This schema is named "owlxml-with-linear-comparisons.xsd".
</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3.org/2002/07/owl#" xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:m="http://www.w3.org/1998/Math/MathML"&gt;
    &lt;xsd:import namespace="http://www.w3.org/1998/Math/MathML"
        schemaLocation="owl-comparisons-mathml.xsd"/&gt;
    &lt;xsd:redefine schemaLocation="http://www.w3.org/2009/09/owl2-xml.xsd"&gt;
        &lt;xsd:group name="DataRange"&gt;
            &lt;xsd:choice&gt;
                &lt;xsd:group ref="owl:DataRange"/&gt;
                &lt;xsd:element ref="owl:DataComparison"/&gt;
            &lt;/xsd:choice&gt;
        &lt;/xsd:group&gt;
    &lt;/xsd:redefine&gt;

    &lt;xsd:complexType name="DataComparison"&gt;
        &lt;xsd:complexContent&gt;
            &lt;xsd:extension base="owl:DataRange"&gt;
                &lt;xsd:sequence&gt;
                    &lt;xsd:element ref="m:lambda" minOccurs="1" maxOccurs="1"/&gt;
                &lt;/xsd:sequence&gt;
            &lt;/xsd:extension&gt;
        &lt;/xsd:complexContent&gt;
    &lt;/xsd:complexType&gt;
    &lt;xsd:element name="DataComparison" type="owl:DataComparison"/&gt;
&lt;/xsd:schema&gt;
</pre>
<p>This schema is named "owl-linear-comparisons-mathml.xsd".
</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML"
    xmlns:m="http://www.w3.org/1998/Math/MathML" elementFormDefault="qualified"&gt;
    &lt;xsd:element name="gt"/&gt;
    &lt;xsd:element name="lt"/&gt;
    &lt;xsd:element name="geq"/&gt;
    &lt;xsd:element name="leq"/&gt;
    &lt;xsd:element name="eq"/&gt;
    &lt;xsd:element name="neq"/&gt;
    
    &lt;xsd:element name="ci" type="xsd:NCName"/&gt;
    &lt;xsd:element name="sep"/&gt;
    &lt;xsd:element name="cn"&gt;
        &lt;xsd:complexType mixed="true"&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element ref="sep" maxOccurs="1"/&gt;
            &lt;/xsd:sequence&gt;
            &lt;xsd:attribute name="type"&gt;
                &lt;xsd:simpleType&gt;
                    &lt;xsd:restriction base="xsd:string"&gt;
                        &lt;xsd:pattern value="real|rational"/&gt;
                    &lt;/xsd:restriction&gt;
                &lt;/xsd:simpleType&gt;
            &lt;/xsd:attribute&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;

    &lt;xsd:element name="bvar"&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element ref="m:ci" minOccurs="1" maxOccurs="1"/&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
    &lt;xsd:element name="times"&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element ref="m:cn"/&gt;
                &lt;xsd:element ref="m:ci" maxOccurs="1" minOccurs="1"/&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
    
    &lt;xsd:element name="plus"&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element ref="m:times" minOccurs="1"/&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
    
    &lt;xsd:element name="apply"&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:choice minOccurs="1" maxOccurs="1"&gt;
                    &lt;xsd:element ref="m:gt"/&gt;
                    &lt;xsd:element ref="m:lt"/&gt;
                    &lt;xsd:element ref="m:geq"/&gt;
                    &lt;xsd:element ref="m:leq"/&gt;
                    &lt;xsd:element ref="m:eq"/&gt;
                    &lt;xsd:element ref="m:neq"/&gt;
                &lt;/xsd:choice&gt;
                &lt;xsd:choice minOccurs="2" maxOccurs="2"&gt;
                    &lt;xsd:element ref="m:ci"/&gt;
                    &lt;xsd:element ref="m:times"/&gt;
                    &lt;xsd:element ref="m:plus"/&gt;
                &lt;/xsd:choice&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;

    &lt;xsd:element name="lambda"&gt;
        &lt;xsd:complexType&gt;
            &lt;xsd:sequence&gt;
                &lt;xsd:element ref="m:bvar" minOccurs="1" maxOccurs="unbounded"/&gt;
                &lt;xsd:element ref="m:apply"/&gt;
            &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
    &lt;/xsd:element&gt;
&lt;/xsd:schema&gt;
</pre>
<a name="Appendix:_Change_Log_.28Informative.29"></a><h2> <span class="mw-headline">7  Appendix: Change Log (Informative) </span></h2>
<a name="Changes_Since_Draft_of_11_June_2009"></a><h3> <span class="mw-headline">7.1  Changes Since Draft of 11 June 2009 </span></h3>
<ul><li> Slight change to the functional syntax grammar (which doesn't change the recognized language).
</li><li> Added XML Schemas for the expression language and for an extenion to the XML Serialization.
</li><li> Removed naming of (in)equations.
</li><li> Removed Manchester syntax.
</li></ul>
</div>


</body>
</html>