-
Notifications
You must be signed in to change notification settings - Fork 3
/
obo-syntax.html
2405 lines (1990 loc) · 103 KB
/
obo-syntax.html
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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>OBO Flat File Format 1.4 Syntax and Semantics [DRAFT]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
/* Style for a "Working Group Note" */
/*
Copyright 1997-2003 W3C (MIT, ERCIM, Keio). All Rights Reserved.
The following software licensing rules apply:
http://www.w3.org/Consortium/Legal/copyright-software */
/* $Id: base.css,v 1.25 2006/04/18 08:42:53 bbos Exp $ */
body {
padding: 2em 1em 2em 70px;
margin: 0;
font-family: sans-serif;
color: black;
background: white;
background-position: top left;
background-attachment: fixed;
background-repeat: no-repeat;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a:active { color: #C00; background: transparent }
a:link img, a:visited img { border-style: none } /* no border on img links */
a img { color: white; } /* trick to hide the border in Netscape 4 */
@media all { /* hide the next rule from Netscape 4 */
a img { color: inherit; } /* undo the color change above */
}
th, td { /* ns 4 */
font-family: sans-serif;
}
h1, h2, h3, h4, h5, h6 { text-align: left }
/* background should be transparent, but WebTV has a bug */
h1, h2, h3 { color: #005A9C; background: white }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
@media screen { /* hide from IE3 */
a[href]:hover { background: #ffa }
}
pre { margin-left: 2em }
/*
p {
margin-top: 0.6em;
margin-bottom: 0.6em;
}
*/
dt, dd { margin-top: 0; margin-bottom: 0 } /* opera 3.50 */
dt { font-weight: bold }
pre, code { font-family: monospace } /* navigator 4 requires this */
ul.toc, ol.toc {
list-style: disc; /* Mac NS has problem with 'none' */
list-style: none;
}
@media aural {
h1, h2, h3 { stress: 20; richness: 90 }
.hide { speak: none }
p.copyright { volume: x-soft; speech-rate: x-fast }
dt { pause-before: 20% }
pre { speak-punctuation: code }
}
/* Copyright 1997-2003 W3C (MIT, ERCIM, Keio). All Rights Reserved.
The following software licensing rules apply:
http://www.w3.org/Consortium/Legal/copyright-software */
body {
// background-image: url(http://www.w3.org/StyleSheets/TR/logo-WG-Note);
//background-image: url(http://www.obofoundry.org/images/foundrylogo.gif);
}
</style>
<link href="owl.css" rel="stylesheet" type="text/css" />
<body>
<div class="head">
<a class="image" style="float:right" href="/"
title="The Open Biological and Biomedical Ontologies"><img class="middle"
src="http://www.obofoundry.org/images/foundrylogo.gif"
width="64"
alt="The Open Biological and Biomedical Ontology Foundry" /></a>
<h1 class="mainTitle">
OBO Flat File Format 1.4 Syntax and Semantics [DRAFT]</h1>
<h2><a id="editordraft" name="editordraft"></a>Editor's Draft of 2011/06/15</h2>
<dl>
<dt>This version: </dt>
<dd><a href="http://berkeleybop.org/~cjm/obo2owl/obo-syntax.html">http://berkeleybop.org/~cjm/obo2owl/obo-syntax.html</a></dd>
<dt>Latest version: </dt>
<dd><a href="http://berkeleybop.org/~cjm/obo2owl/obo-syntax.html">http://berkeleybop.org/~cjm/obo2owl/obo-syntax.html</a></dd>
<dt>Previous version: </dt>
<dd><a href="http://www.cs.man.ac.uk/~horrocks/obo/syntax.html">http://www.cs.man.ac.uk/~horrocks/obo/syntax.html</a></dd>
<dt>Editors: </dt>
<dd>Chris Mungall, Lawrence Berkeley National Laboratory</dd>
<dd>Alan Ruttenberg, University at Buffalo</dd>
<dd>David Osumi-Sutherland, Cambridge University</dd>
<dt>Contributors: </dt>
<dd>Erick Antezana, Bayer CropScience</dd>
<dd>James Balhoff, National Evolutionary Synthesis Center</dd>
<dd>Melanie Courtot, British Columbia Cancer Research Center</dd>
<dd>John Day-Richter, Google</dd>
<dd>Amelia Ireland, The Jackson Laboratory</dd>
<dd>Shahid Manzoor, Lawrence Berkeley National Laboratory</dd>
<dd>Syed Hamid Tirmizi, University of Texas</dd>
</dl>
<hr>
</div>
<h2 class="notoc"><a id="abstract" name="abstract">Abstract</a></h2>
<div class="abstract">
<p>This document provides a BNF specification and mapping to OWL2 of
the <a href="http://www.geneontology.org/GO.format.obo-1_4.shtml">OBO
Flat File Format, version 1.4</a></p>
</div>
<div class="status">
<h2 class="notoc"><a id="status" name="status">Status of this Document</a></h2>
<p><strong>This is an editor's draft, for comment by the community.</strong></p>
<p>Comments should be sent to <a href="mailto:[email protected]">[email protected]</a> (<a href="http://sourceforge.net/mailarchive/forum.php?forum=obo-format">archive</a>)
to ensure wide visibility. </p>
</div>
<hr>
<div class="toc">
<h2 class="notoc"><a id="toc" name="toc">Table of Contents</a></h2>
<ul class="toc">
<li class="tocline1"><a href="#1">1 Introduction</a></li>
<li class="tocline1"><a href="#2">2 Preliminary Definitions</a>
<ul class="toc">
<li class="tocline2"><a href="#2.1">2.1 BNF Notation</a></li>
<li class="tocline2"><a href="#2.2">2.2 Spacing Characters</a></li>
<li class="tocline2"><a href="#2.3">2.3 Line Termination</a></li>
</ul>
</li>
<li class="tocline1"><a href="#3">3 OBO Grammar</a></li>
<li class="tocline1"><a href="#4">4 OBO Document Structure</a></li>
<li class="tocline1"><a href="#5">5 OBO Semantics: Mapping to OWL2-DL</a></li>
<li class="tocline1"><a href="#6">6 OBO Sublanguages</a></li>
<li class="tocline1"><a href="#7">7 OWL Macros</a></li>
<li class="tocline1"><a href="#8">8 Recommendations (informative)</a></li>
<li class="tocline1"><a href="#9">9 References</a></li>
</ul>
<hr>
</div>
<h2><a name="1"></a>1 Introduction</h2>
<p>On completion, this document will provide a formalisation (using
BNF) of
the <a href="http://www.godatabase.org/dev/doc/obo_format_spec.html">OBO
Flat File Format Specification, version 1.4</a> (which we will refer
to from now on as OBOF), and a semantics for the language defined via
a translation to the OWL DL abstract syntax.</p>
<p>
The first part of this document describes the syntax of OBO Format
using BNF. OBO Files are parsed into abstract OBO documents. A
mapping is provided between abstract OBO documents and OWL2 and the
IAO ontology-metadata ontology.
</p>
<h2><a name="1.1"></a>1.1 Relationship to previous translations</h2>
<p>
This document is derived from and indebted to a previous document by
Ian Horrocks [<cite><a href="#obo-owl-horrocks" title="">OBO-OWL
Horrocks</a></cite>], later described in an accompanying paper
[<cite><a href="#obo-owl-golbreich" title="">OBO-OWL
Golbreich</a></cite>]. This document provided a semantics for OBO
Format in terms of OWL-DL and what was then OWL1.1. The syntax was
underspecified and the mapping was incomplete as there was no
treatment of annotation properties.
</p>
<p>
The NCBO OboInOwl vocabulary attempted to fill in the gaps in the
Horrocks translation by providing a full translation of all of
obof1.2, including synonyms and definitions using the n-ary
relations pattern. [<cite><a href="#obo-owl-ncbo" title="">OBO-OWL
NCBO</a></cite>]. This vocabulary has been implemented in many
tools, including OboEdit2.1 and the Berkeley OBO converter. This
vocabulary is also currently (Aug 2010) used in the official OBO
Foundry conversions available from the Berkeley ontologies download
site and the accompanying Neurocommons triplestore. However, whilst
the n-ary relations pattern represented OBO metadata correctly, the
mapping has undesirable side-effects, such as introducing modeling
classes and individuals into an ontology, affecting both reasoning
and usability. The mapping was never adopted by Protege4.
</p>
<p>
OBO Format 1.3 was accompanied by a grammar and mapping to FOL
[<cite><a href="#obolog" title="">Obolog</a></cite>]. This mapping
was based on the 2005 version of the OBO Relation Ontology and
OBOF1.3/Obolog attempted to do justice to dual instance/type level
relations and ternary temporally-qualified instance-level
relations. However, this introduced too large an impedance mismatch
between OBOF and OWL, and as a consequence OBOF1.3 and Obolog have
been deprecated.
</p>
<p>
More recent work by Tirmizi provides an implementation of a fully
roundtrippable mapping between OBO to OWL and back
[<cite><a href="#obo-owl-swat4ls" title="">OBO-OWL
SWAT4LS</a></cite>] [<cite><a href="#obo-owl-jbms" title="">OBO-OWL
JBMS</a></cite>]. This did not attempt to provide a full grammar,
and relied on previous efforts for defining the semantics.
</p>
<p>
This document supersedes previous efforts. It is based on OBO-Format
1.4 which introduces extra constructs and is intended to be closely
aligned to OWL and the IAO ontology metadata ontology. The grammar
provided here is intended to be complete, formally specifying the
syntax of an OBO format file at the character level. The semantics
are also complete, and a translation is provided for all OBOF
constructs, including new constructs which allow a wider range of
expressivity within OWL2. The NCBO oboInOwl vocabulary and n-ary
relations approach has been deprecated, and the intention is to use
IAO in its place (although the mapping of all vocabulary elements is
not complete), with OWL2 axiom annotations replacing the n-ary
relations pattern. An additional section on OWL macros describes how
to effectively increase the expressivity of OBOF whilst remaining
within a simple OBOF environment.
</p>
<a name="Preliminary_Definitions"></a><h2> <span class="mw-headline">2 Preliminary Definitions </span></h2>
<a name="BNF"></a><h2> <span class="mw-headline">2.1 BNF Notation </span></h2>
<p>OBO-Format 1.4 is defined using a standard BNF notation, which is summarized in the table below.
</p>
<div class="center">
<table border="1">
<caption> <span class="caption">Table 1.</span> The BNF Notation Used in this Document
</caption><tr>
<th> Construct
</th><th> Syntax
</th><th> Example
</th></tr>
<tr>
<td> non-terminal symbols
</td><td> boldface
</td><td> <span class="nonterminal">QuotedString</span>
</td></tr>
<tr>
<td> terminal symbols
</td><td> single quoted
</td><td> <span class="name">'Term'</span>
</td></tr>
<tr>
<td> zero or more
</td><td> curly braces
</td><td> <span class="name">{ </span><span class="nonterminal">entity-frame</span><span class="name"> }</span>
</td></tr>
<tr>
<td> zero or one
</td><td> square brackets
</td><td> <span class="name">[ </span><span class="nonterminal">ws SynonymType-ID</span><span class="name"> ]</span>
</td></tr>
<tr>
<td> alternative
</td><td> vertical bar
</td><td> <span class="nonterminal">Class-ID</span><span class="name"> | </span><span class="nonterminal">Relation-ID</span>
</td></tr>
<tr>
<td> grouping
</td><td> parentheses
</td><td> ( <span class="nonterminal"></span> )
</td></tr>
<tr>
<td> complementation</td>
<td> minus symbol</td>
<td> ( <span class="nonterminal">character</span><span class="name"> - </span><span class="nonterminal">NewLineChar</span> )
</td></tr>
</table>
</div>
<p>Because generic tag-value pairs occur in very many places in the syntax,
to save space the grammar has meta-productions for basic tag-values and for the tags themselves:
</p>
<p class="grammar" style="white-space: pre;"><span class="nonterminal"><T>-TVP</span> ::= '<span class="terminal"><T>:</span>' {ws} <span class="nonterminal">UnquotedString</span>
<span class="nonterminal"><T>-BT</span> ::= '<span class="terminal"><T>:</span>' {ws} ( 'true' | 'false' )
<span class="nonterminal"><T>-Tag</span> ::= '<span class="terminal"><T>:</span>' {ws}
</p>
<p>
For example, <span>property_value-Tag</span> should be interpreted as: <span>'property_value:' { ws }</span>
</p>
<p>We provide an additional List meta-production, for comma-delimited lists
</p>
<p class="grammar" style="white-space: pre;"><span class="nonterminal"><NT>List</span> ::= [<span class="terminal"><NT>:</span> {',' {ws} <span class="terminal"><NT>:</span> }]
</p>
<p>
For example, <span>property_value-Tag</span> should be interpreted as: <span>'property_value:' { ws }</span>
</p>
<p>
Documents in the obo-format consist of sequences of Unicode characters
[<cite><a href="#ref-unicode" title="">UNICODE</a></cite>] and are encoded in UTF-8
[<cite><a href="#ref-rfc-3629" title="">RFC 3629</a></cite>].
TODO - language tags
<h3><a name="2.2"></a>2.2 Spacing Characters</h3>
INCOMPLETE
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">WhiteSpaceChar</span> ::= ' ' | \t | U+0020 | U+0009
<span class="nonterminal">ws</span> ::= { <span class="nonterminal">WhiteSpaceChar</span> }
<span class="nonterminal">NewlineChar</span> ::= \r | \n | U+000A | U+000C | U+000D
<span class="nonterminal">nl</span> ::= <span class="nonterminal">ws</span> <span class="nonterminal">NewLineChar</span>
<span class="nonterminal">nl*</span> ::= { <span class="nonterminal">nl</span> }
<span class="nonterminal">nl+</span> ::= <span class="nonterminal">nl</span> { <span class="nonterminal">ws</span> <span class="nonterminal">NewLineChar</span> }
<span class="nonterminal">OBOChar</span> ::= '\' <span class="nonterminal">Letter</span> | ( <span class="nonterminal">Char</span> - (<span class="nonterminal">NewLineChar</span> | '\') )
</p>
<h3><a name="2.3"></a>2.3 Line Termination</h3>
<p>
Each tag-value clause in OBOF is line separated. The line can
optionally be ended by a comment, indicated by the ! character - this
is ignored by the parser. Each clause can also have zero or more
tag-value qualifiers.
</p>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">EOL</span> ::= <span class="nonterminal">ws*</span> [ <span class="nonterminal">QualifierBlock</span> ] <span class="nonterminal">ws*</span> [ <span class="nonterminal">HiddenComment</span> ] <span class="nonterminal">ws*</span> <span class="nonterminal">NewLineChar</span>
<span class="nonterminal">QualifierBlock</span> ::= '{' <span class="nonterminal">QualifierList</span> }
<span class="nonterminal">HiddenComment</span> ::= '!' { ( <span class="nonterminal">Char</span> - <span class="nonterminal">NewlineChar</span> ) }
<span class="nonterminal">QualifierList</span> ::= <span class="terminal">Qualifier</span> {',' {ws} <span class="terminal">Qualifier</span> }
<span class="nonterminal">Qualifier</span> ::= <span class="nonterminal">Rel-ID</span> '=' <span class="nonterminal">QuotedString</span>
</p>
<h3><a name="2.4"></a>2.4 Tokens</h3>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">QuotedString</span> ::= <span class="nonterminal">DblQuote</span> { ( <span class="nonterminal">OBOChar</span> - <span class="nonterminal">DblQuote</span> ) } <span class="nonterminal">DblQuote</span>
<span class="nonterminal">UnquotedString</span> ::= { <span class="nonterminal">OBOChar</span> }
</p>
<h3><a name="2.5"></a>2.5 Identifiers</h3>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">NonWsChar</span> ::= ( <span class="nonterminal">OBOChar</span> - <span class="nonterminal">WhiteSpaceChar</span> )
<span class="nonterminal">Class-ID</span> ::= <span class="nonterminal">ID</span>
<span class="nonterminal">Rel-ID</span> ::= <span class="nonterminal">ID</span>
<span class="nonterminal">Instance-ID</span> ::= <span class="nonterminal">ID</span>
<!-- TODO: URLs -->
<span class="nonterminal">ID</span> ::= <span class="nonterminal">Prefixed-ID</span> | <span class="nonterminal">Unprefixed-ID</span>
<span class="nonterminal">Unprefixed-ID</span> ::= { ( <span class="nonterminal">NonWsChar</span> - <span class="nonterminal">':'</span> ) }
<span class="nonterminal">Prefixed-ID</span> ::= <span class="nonterminal">Canonical-Prefixed-ID</span> | <span class="nonterminal">NonCanonical-Prefixed-ID</span>
</p>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">Canonical-Prefixed-ID</span> ::= <span class="nonterminal">Canonical-IDPrefix</span> ':' <span class="nonterminal">Canonical-LocalID</span>
<span class="nonterminal">Alpha-Char</span> ::= <span class="nonterminal">a</span> |<span class="nonterminal">b</span> |<span class="nonterminal">c</span> |<span class="nonterminal">d</span> |<span class="nonterminal">e</span> |<span class="nonterminal">f</span> |<span class="nonterminal">g</span> |<span class="nonterminal">h</span> |<span class="nonterminal">i</span> |<span class="nonterminal">j</span> |<span class="nonterminal">k</span> |<span class="nonterminal">l</span> |<span class="nonterminal">m</span> |<span class="nonterminal">n</span> |<span class="nonterminal">o</span> |<span class="nonterminal">p</span> |<span class="nonterminal">q</span> |<span class="nonterminal">r</span> |<span class="nonterminal">s</span> |<span class="nonterminal">t</span> |<span class="nonterminal">u</span> |<span class="nonterminal">v</span> |<span class="nonterminal">w</span> |<span class="nonterminal">x</span> |<span class="nonterminal">y</span> |<span class="nonterminal">z</span> | <span class="nonterminal">A</span> |<span class="nonterminal">B</span> |<span class="nonterminal">C</span> |<span class="nonterminal">D</span> |<span class="nonterminal">E</span> |<span class="nonterminal">F</span> |<span class="nonterminal">G</span> |<span class="nonterminal">H</span> |<span class="nonterminal">I</span> |<span class="nonterminal">J</span> |<span class="nonterminal">K</span> |<span class="nonterminal">L</span> |<span class="nonterminal">M</span> |<span class="nonterminal">N</span> |<span class="nonterminal">O</span> |<span class="nonterminal">P</span> |<span class="nonterminal">Q</span> |<span class="nonterminal">R</span> |<span class="nonterminal">S</span> |<span class="nonterminal">T</span> |<span class="nonterminal">U</span> |<span class="nonterminal">V</span> |<span class="nonterminal">W</span> |<span class="nonterminal">X</span> |<span class="nonterminal">Y</span> |<span class="nonterminal">Z</span>
<span class="nonterminal">Digit</span> ::= <span class="nonterminal">0</span> |<span class="nonterminal">1</span> |<span class="nonterminal">2</span> |<span class="nonterminal">3</span> |<span class="nonterminal">4</span> |<span class="nonterminal">5</span> |<span class="nonterminal">6</span> |<span class="nonterminal">7</span> |<span class="nonterminal">8</span> |<span class="nonterminal">9</span>
<span class="nonterminal">Canonical-IDPrefix</span> ::= <span class="nonterminal">Alpha-Char</span> { ( '_' | <span class="nonterminal">Alpha-Char</span> ) }
<span class="nonterminal">Canonical-LocalID</span> ::= { <span class="nonterminal">Digit</span> }
</p>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">NonCanonical-Prefixed-ID</span> ::= ( <span class="nonterminal">Any-IDPrefix</span> ':' <span class="nonterminal">Any-LocalID</span> ) - <span class="nonterminal">Canonical-Prefixed-ID</span>
<span class="nonterminal">Any-IDPrefix</span> ::= { ( <span class="nonterminal">NonWsChar</span> - <span class="nonterminal">':'</span> ) } ':'
<span class="nonterminal">Any-LocalID</span> ::= { <span class="nonterminal">NonWsChar</span> }
</p>
<h3><a name="2.6"></a>2.6 Xref Lists</h3>
<p>
An XrefList is a comma-separated list of zero or more Xrefs inside square brackets (these are manditory). Each Xref is an identifier, optionally followed by q auoted description
</p>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">XrefList</span> ::= '[' [ <span class="nonterminal">Xref</span> { ',' {ws} <span class="nonterminal">Xref</span> } ] ']'
<span class="nonterminal">Xref</span> ::= <span class="nonterminal">ID</span> [ {ws} <span class="nonterminal">QuotedString</span> ]
</p>
<h2><a name="3"></a>3 OBO Grammar</h3>
<h3><a name="3.1"></a>3.1 OBO Document Structure</h3>
<p>An OBO document consists of a series of header frame followed by
zero or more entity frames. Each frame has a set of clauses, or
<tag,value> pairs. A tag is a token which may be drawn from the
set of defined OBOF tags. The value can be atomic or multi-values. In
the OBO Abstract syntax a clause is written
<Tag>(<V1>...<Vn>).</p>
<p>Each frame should by convention be separated by an empty line, but this is not enforced in the syntax</p>
<p>Note that the term "frame" replaces the previously used "stanza" in
order to be more consistent with Manchester Syntax.</p>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">OBO-Doc</span> := <span class="nonterminal">header-frame</span> { <span class="nonterminal">entity-frame</span> } <span class="nonterminal">nl*</span>
</p>
<h3><a name="3.2"></a>3.2 OBO Headers</h3>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">header-frame</span> ::= { <span class="nonterminal">header-clause</span> <span class="nonterminal">nl*</span> }
<span class="nonterminal">header-clause</span> ::= <span class="nonterminal">format-version-TVP</span>
| <span class="nonterminal">ontology-TVP</span>
| <span class="nonterminal">data-version-TVP</span>
| <span class="nonterminal">date-Tag</span> <span class="nonterminal">DD-MM-YYYY</span> <span class="nonterminal">sp</span> <span class="nonterminal">hh-mm</span>
| <span class="nonterminal">saved-by-TVP</span>
| <span class="nonterminal">auto-generated-by-TVP</span>
| <span class="nonterminal">import-Tag</span> <span class="nonterminal">IRI</span> | <span class="nonterminal">filepath</span>
| <span class="nonterminal">subsetdef-Tag</span> <span class="nonterminal">ID</span> <span class="nonterminal">sp</span> <span class="nonterminal">QuotedString</span>
| <span class="nonterminal">synonymtypedef-Tag</span> <span class="nonterminal">ID</span> <span class="nonterminal">sp</span> <span class="nonterminal">QuotedString</span>
[ <span class="nonterminal">SynonymScope</span> ]
| <span class="nonterminal">default-namespace-Tag</span> <span class="nonterminal">OBONamespace</span>
| <span class="nonterminal">idspace-Tag</span> <span class="nonterminal">IDPrefix</span> <span class="nonterminal">sp</span> <span class="nonterminal">IRI</span>
[ <span class="nonterminal">sp</span> <span class="nonterminal">QuotedString</span> ]
| <span class="nonterminal">treat-xrefs-as-equivalent-Tag</span> <span class="nonterminal">IDPrefix</span>
| <span class="nonterminal">treat-xrefs-as-genus-differentia-Tag</span> <span class="nonterminal">IDPrefix</span> <span class="nonterminal">ws</span> <span class="nonterminal">Rel-ID</span> <span class="nonterminal">ws</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">treat-xrefs-as-relationship-Tag</span> <span class="nonterminal">IDPrefix</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">treat-xrefs-as-is_a-Tag</span> <span class="nonterminal">IDPrefix</span>
| <span class="nonterminal">treat-xrefs-as-has-subclass-Tag</span> <span class="nonterminal">IDPrefix</span>
| <span class="nonterminal">remark-TVP</span>
| <span class="nonterminal">UnreservedToken</span> ':' [ <span class="nonterminal">ws</span> ] <span class="nonterminal">UnquotedString</span>
<span class="nonterminal">entity-frame</span> ::= <span class="nonterminal">term-frame</span> | <span class="nonterminal">typedef-frame</span> | <span class="nonterminal">instance-frame</span> | <span class="nonterminal">annotation-frame</span>
</p>
<h3><a name="3.3"></a>3.3 Term Frames</h3>
<p >Term frames introduce and define the meaning of <i>terms</i> (AKA
classes).</p >
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">term-frame</span> ::= <span class="nonterminal">nl*</span>
'[Term]' <span class="nonterminal">nl</span>
<span class="nonterminal">id-Tag</span> <span class="nonterminal">Class-ID</span> <span class="nonterminal">EOL</span>
{ <span class="nonterminal">term-frame-clause</span> <span class="nonterminal">EOL</span> }
<span class="nonterminal">term-frame-clause</span> ::=
<span class="nonterminal">is_anonymous-BT</span>
| <span class="nonterminal">name-TVP</span>
| <span class="nonterminal">namespace-Tag</span> <span class="nonterminal">OBONamespace</span>
| <span class="nonterminal">alt_id-Tag</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">def-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">XrefList</span>
| <span class="nonterminal">comment-TVP</span>
| <span class="nonterminal">subset-Tag</span> <span class="nonterminal">Subset-ID</span>
| <span class="nonterminal">synonym-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">SynonymScope</span> [ <span class="nonterminal">ws</span> <span class="nonterminal">SynonymType-ID</span> ] <span class="nonterminal">XrefList</span>
| <span class="nonterminal">xref-Tag</span> <span class="nonterminal">Xref</span>
| <span class="nonterminal">builtin-BT</span>
| <span class="nonterminal">property_value-Tag</span> <span class="nonterminal">Relation-ID</span> ( <span class="nonterminal">QuotedString</span> <span class="nonterminal">XSD-Type</span> | <span class="nonterminal">ID</span> )
| <span class="nonterminal">is_a-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">intersection_of-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">intersection_of-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">union_of-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">equivalent_to-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">disjoint_from-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">relationship-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">created_by-Tag</span> <span class="nonterminal">Person-ID</span>
| <span class="nonterminal">creation_date-Tag</span> <span class="nonterminal">ISO-8601-DateTime</span>
| <span class="nonterminal">is_obsolete-BT</span>
| <span class="nonterminal">replaced_by-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">consider-Tag</span> <span class="nonterminal">ID</span>
</p >
<h3><a name="3.4"></a>3.4 Typedef Frames</h3>
<p >Typedef frames introduce and define the meaning of
<i>relations</i> (AKA properties).</p >
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">typedef-frame</span> ::= [ <span class="nonterminal">nl</span> ]
'[Typedef]' <span class="nonterminal">nl</span>
<span class="nonterminal">id-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">EOL</span>
{ <span class="nonterminal">typedef-frame-clause</span> <span class="nonterminal">EOL</span> }
<span class="nonterminal">typedef-frame-clause</span> ::=
<span class="nonterminal">is_anonymous-BT</span>
| <span class="nonterminal">name-TVP</span>
| <span class="nonterminal">namespace-Tag</span> <span class="nonterminal">OBONamespace</span>
| <span class="nonterminal">alt_id-Tag</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">def-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">XrefList</span>
| <span class="nonterminal">comment-TVP</span>
| <span class="nonterminal">subset-Tag</span> <span class="nonterminal">Subset-ID</span>
| <span class="nonterminal">synonym-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">SynonymScope</span> [ <span class="nonterminal">ws</span> <span class="nonterminal">SynonymType-ID</span> ] <span class="nonterminal">XrefList</span>
| <span class="nonterminal">xref-Tag</span> <span class="nonterminal">Xref</span>
| <span class="nonterminal">property_value-Tag</span> <span class="nonterminal">Relation-ID</span> ( <span class="nonterminal">QuotedString</span> <span class="nonterminal">XSD-Type</span> | <span class="nonterminal">ID</span> )
| <span class="nonterminal">domain-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">range-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">builtin-BT</span>
| <span class="nonterminal">is_anti_symmetric-BT</span>
| <span class="nonterminal">is_cyclic-BT</span>
| <span class="nonterminal">is_reflexive-BT</span>
| <span class="nonterminal">is_symmetric-BT</span>
| <span class="nonterminal">is_transitive-BT</span>
| <span class="nonterminal">is_functional-BT</span>
| <span class="nonterminal">is_inverse_functional-BT</span>
| <span class="nonterminal">is_a-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">intersection_of-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">union_of-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">equivalent_to-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">disjoint_from-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">inverse_of-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">transitive_over-Tag</span> <span class="nonterminal">Relation-ID</span>
| <span class="nonterminal">holds_over_chain-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">Relation-ID</span>
| <span class="nonterminal">equivalent_to_chain-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">Relation-ID</span>
| <span class="nonterminal">disjoint_over-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">relationship-Tag</span> <span class="nonterminal">Rel-ID</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">created_by-Tag</span> <span class="nonterminal">Person-ID</span>
| <span class="nonterminal">creation_date-Tag</span> <span class="nonterminal">ISO-8601-DateTime</span>
| <span class="nonterminal">is-obsolete-BT</span>
| <span class="nonterminal">replaced_by-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">consider-Tag</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">expand_assertion_to-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">XrefList</span>
| <span class="nonterminal">expand_expression_to-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">XrefList</span>
| <span class="nonterminal">is_metadata_tag-BT</span>
| <span class="nonterminal">is_class_level_tag-BT</span>
</p >
<h3><a name="3.5"></a>3.5 Instance Frames</h3>
<p >Instance frames introduce and define the meaning of
<i>instances</i> (AKA individuals).</p >
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">instance-frame</span> ::= [ <span class="nonterminal">nl</span> ]
'[Instance]' <span class="nonterminal">nl</span>
<span class="nonterminal">id-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">EOL</span>
{ <span class="nonterminal">instance-frame-clause</span> <span class="nonterminal">EOL</span> }
<span class="nonterminal">instance-frame-clause</span> ::=
<span class="nonterminal">is_anonymous-BT</span>
| <span class="nonterminal">name-TVP</span>
| <span class="nonterminal">namespace-Tag</span> <span class="nonterminal">OBONamespace</span>
| <span class="nonterminal">alt_id-Tag</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">def-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">XrefList</span>
| <span class="nonterminal">comment-TVP</span>
| <span class="nonterminal">subset-Tag</span> <span class="nonterminal">Subset-ID</span>
| <span class="nonterminal">synonym-Tag</span> <span class="nonterminal">QuotedString</span> <span class="nonterminal">ws</span> <span class="nonterminal">SynonymScope</span> [ <span class="nonterminal">ws</span> <span class="nonterminal">SynonymType-ID</span> ] <span class="nonterminal">XrefList</span>
| <span class="nonterminal">xref-Tag</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">property_value-Tag</span> <span class="nonterminal">Relation-ID</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">instance_of-Tag</span> <span class="nonterminal">Class-ID</span>
| <span class="nonterminal">PropertyValueTagValue</span>
| <span class="nonterminal">relationship-Tag</span> <span class="nonterminal">Rel-ID</span> <span class="nonterminal">ID</span>
| <span class="nonterminal">created_by-Tag</span> <span class="nonterminal">Person-ID</span>
| <span class="nonterminal">creation_date-Tag</span> <span class="nonterminal">ISO-8601-DateTime</span>
| <span class="nonterminal">is-obsolete-BT</span>
| <span class="nonterminal">replaced_by-Tag</span> <span class="nonterminal">Rel-ID</span>
| <span class="nonterminal">consider-Tag</span> <span class="nonterminal">ID</span>
</p >
<h3><a name="3.5"></a>3.5 Synonym Scopes</h3>
<p class="grammar" style="white-space: pre;">
<span class="nonterminal">SynonymScope</span> ::=
'EXACT' | 'BROAD' | 'NARROW' | 'RELATED'
</p>
<h2><a name="4"></a>4 OBO Document Structure</h2>
<p>This section defines structural constraints on an OBO
Document. These structural constraints hold on an abstract OBO
Document - the result of parsing a physical OBO document file.</p>
<h3><a name="4.1"></a>4.1 Combining Frames</h3>
<p>
Each frame in an abstract OBO document can be accessed by its
identifier - the value of the <b>id</b> tag.
</p>
<p>
Although it is strongly recommended that an OBOF document does not
contain two frames with the same identifier, this is syntactically
valid. If two frames have the same identifier, then they
are <i>combined</i>. Only frames of the same type can be combined -
if a document uses the same ID for two frames of different types,
the document is structurally invalid.
</p>
<p>
When two frames F1 and F2 are combined, the new frame F3 has a set
of tag-values consisting of the union of the set of tag-values from
F1 and the set of tag-values from F2. If two tag-values are have
identical tags and identical values, they are considered a single
tag-value.
</p>
<h3><a name="4.2"></a>4.2 OBO namespaces and ontology name</h3>
<p>
Note that OBO namespaces are not the same as OWL namespaces - the
analog of OWL namespaces are OBO ID spaces. OBO namespaces are
semantics-free properties of a frame that allow partitioning of an
ontology into sub-ontologies. For example, the GO is partitioned
into 3 ontologies (3 OBO namespaces, 1 OWL namespace).
</p>
<p>
Every frame must have exactly one namespace. However, these do not
need to be explicitly assigned. After parsing an OBO Document, any
frame without a namespace is assigned the default-namespace, from
the OBO Document header. If this is not specified, the Parser
assigns a namespace arbitrarily. It is recommended this is
equivalent to the URL or file path from which the document was
retrieved.
</p>
<p>
Every OBODoc should have an "ontology" tag specified in the
header. If this is not specified, then the parser should supply a
default value. This value should be derived from the URL of the
source of the ontology (typically using http or file schemes).
</p>
<h3><a name="4.4"></a>4.4 Processing Header Macros</h3>
<h4><a name="4.4.1"></a>4.4.1 Implicit Header Macros</h4>
<p>
Every OBO-Doc is automatically populated with two header clauses:
<ul>
<li>treat-xrefs-as-equivalent(RO)</li>
<li>treat-xrefs-as-equivalent(BFO)</li>
</ul>
It is illegal to override these. These declarations
are taken as implicit, and an OBO format generator
need not export these
</p>
<h4><a name="4.4.2"></a>4.4.2 Header Macro Translation</h4>
<p>
The following table shows how header macros are used to insert new
clauses into the ontology document. If the pre-condition is satisfied
(middle column) and the header contains the specified macro (first
column), then clauses are added to the ontology such that the
post-condition is satisfied (right hand column). Note that the
original xref tags are <i>not</i> replaced in the ontology.
</p>
<p>
Expansion of these clauses is optional. A typicaly use case is to
expand clauses into a separate bridging ontology. NOTE: this part of
the spec is unsatisfactory. A better solution will be to do this as an
OWL Macro (section 7). Specifically, obo header macros will be
translated to OWL macros, and then the generic OWL macro engine will
translate these. We leave this section in the draft spec for now to
show the intended semantics.
</p>
<table border="1" cellspacing="0">
<caption><a id="header-macros" name="header-macros" />
Header Macros</caption>
<thead>
<tr><th>Header</th>
<th>Precondition</th>
<th>Add clauses</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="white-space: pre;">treat-xrefs-as-equivalent(Prefix)</td>
<td valign="top" style="white-space: pre;">xref(Prefix:B) ∈ Frame[A]</td>
<td valign="top" style="white-space: pre;">equivalent_to(Prefix:B) ∈ Frame[A]</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">treat-xrefs-as-is_a(Prefix)</td>
<td valign="top" style="white-space: pre;">xref(Prefix:B) ∈ Frame[A]</td>
<td valign="top" style="white-space: pre;">is_a(Prefix:B) ∈ Frame[A]</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">treat-xrefs-as-has-subclass(Prefix)</td>
<td valign="top" style="white-space: pre;">xref(Prefix:B) ∈ Frame[A]</td>
<td valign="top" style="white-space: pre;">is_a(Prefix:A) ∈ Frame[B]</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">treat-xrefs-as-genus-differentia(Prefix Rel-ID Class-ID)</td>
<td valign="top" style="white-space: pre;">xref(Prefix:B) ∈ Frame[A] and
intersection_of(...) ∉ Frame[A]</td>
<td valign="top" style="white-space: pre;">intersection_of(X:B) ∈ Frame[A] and
intersection_of(Rel-ID Class-ID) ∈ Frame[A]
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">treat-xrefs-as-relationship(Prefix Rel-ID)</td>
<td valign="top" style="white-space: pre;">xref(Prefix:B) ∈ Frame[A]</td>
<td valign="top" style="white-space: pre;">relationship(Rel-ID X:B) ∈ Frame[A]</td>
</tr>
</tbody>
</table>
<h3><a name="4.4"></a>4.4 Tag Cardinality Constraints</h3>
<p>Note that the id tag is not specified in this table. Each frame has
exactly one id tag, and the id tag uniquely identifier the
frame. These constrainst must hold <i>after</i> frames with
identical ids have been combined (see above).</p>
<p>Any tag not mentioned has free cardinality (zero, one or many).</p>
<table border="1" cellspacing="0">
<caption><a id="cardinality" name="cardinality" />
Cardinality Constraints</caption>
<thead>
<tr><th>Tag</th>
<th>Frame</th>
<th>Cardinality (Normative)</th>
<th>Informative Notes</th>
</tr>
</thead>
<tbody>
<tr><td>ontology</td><td>Header</td><td>zero or one</td><td>-</td>recommended for all docs</tr>
<tr><td>format_version</td><td>Header</td><td>zero or one</td><td>-</td></tr>
<tr><td>date</td><td>Header</td><td>zero or one</td><td>-</td></tr>
<tr><td>default-namespace</td><td>Header</td><td>zero or one</td><td>-</td></tr>
<tr><td>saved-by</td><td>Header</td><td>zero or one</td><td>-</td></tr>
<tr><td>auto-generated-by</td><td>Header</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_anonymous</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>name</td><td>*</td><td>zero or one</td><td>names are recommended for all frames</td></tr>
<tr><td>namespace</td><td>*</td><td>one</td><td>-</td></tr>
<tr><td>def</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>comment</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>domain</td><td>Typedef</td></td><td>zero or one</td><td>use union constructs in place of multiple values</td></tr>
<tr><td>range</td><td>Typedef</td></td><td>zero or one</td><td>use union constructs in place of multiple values</td></tr>
<tr><td>is_anti_symmetric</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_cyclic</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_reflexive</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_symmetric</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_transitive</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_functional</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_inverse_functional</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_obsolete</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>instance_of</td><td>Instance</td><td>zero or one</td><td>use intersection constructs in place of multiple values</td></tr>
<tr><td>intersection_of</td><td>Term or Typedef</td><td>zero or (two or more)</td><td>-</td></tr>
<tr><td>union_of</td><td>Term or Typedef</td><td>zero or (two or more)</td><td>-</td></tr>
<tr><td>created_by</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>creation_date</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_obsolete</td><td>*</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_metadata_tag</td><td>Typedef</td><td>zero or one</td><td>-</td></tr>
<tr><td>is_class_level</td><td>Typedef</td><td>zero or one</td><td>-</td></tr>
</tbody>
</table>
<p>
<ul>
<li>
If a frame with an intersection_of clause has exactly one intersection_of(Class-ID) clause, then the frame is said to have a <i>genus-differentia definition</i>
</li>
</ul>
</p>
<h2><a name="5"></a>5 OBO Semantics : Mapping to OWL2-DL</h2>
<p>On completions this section will define the semantics of the
entirety of OBO via mappings to OWL2. The mappings could also be used
to specify a translation procedure and/or an interface to OWL tools
(such as OWL reasoners).</p>
<p>The translation is defined using a translation function <span
class="name">T</span> which translates (a fragment of) OBO into OWL
DL. The definition of <span class="name">T</span> is often recursive,
but it will eventually "ground out" in (a fragment of) OWL DL.</p>
<h3><a name="5.0"></a>5.0 Ontologies</h3>
<p>
An OBO-Doc translates to an owl Ontology. The Ontology IRI is
generated by extracting the value of the "ontology" tag in the header frame
</p>
<table border="1" cellspacing="0">
<caption><a id="decl" name="decl" />
Mapping of Ontology Document</caption>
<thead>
<tr><th>OBO</th>
<th>Translation - <span class="name">T</span>(S)</th></tr>
</thead>
<tbody>
<tr>
<td valign="top" style="white-space: pre;">OBO-Doc(Header1...HeaderN Frame1..FrameM)
</td>
<td valign="top" style="white-space: pre;">Ontology(<span class="name">T<sup>OntID</sup></span>(Header[@ontology],Header[@data-version])
<span class="name">T<sup>H</sup></span>(Header-1)...<span class="name">T<sup>H</sup></span>(Header-1)
<span class="name">T<sup>F</sup></span>(Frame1)...<span class="name">T<sup>F</sup></span>(FrameM) )
</td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<table border="1" cellspacing="0">
<caption><a id="decl" name="decl" />
Mapping of Ontology Headers</caption>
<thead>
<tr><th>OBO</th>
<th>Translation - <span class="name">T<sup>H</sup></span>(S)</th></tr>
</thead>
<tbody>
<tr>
<td valign="top" style="white-space: pre;">data-version(String)
</td>
<td valign="top" style="white-space: pre;">-
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">import(IRI)
</td>
<td valign="top" style="white-space: pre;">Import(IRI)</td>
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">remark(String)
</td>
<td valign="top" style="white-space: pre;">Annotation(<span class="name">T</span>(remark) <span class="name">T</span>(String))</td>
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">subsetdef(ID String)
</td>
<td valign="top" style="white-space: pre;">ClassAssertion(<span class="name">T</span>(subsetdef) <span class="name">T</span>(ID))
AnnotationAssertion(<span class="name">T</span>(name) <span class="name">T</span>(ID) <span class="name">T</span>(String))
</td>
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">synonymtypedef(ID String [Scope])
</td>
<td valign="top" style="white-space: pre;">ClassAssertion(<span class="name">T</span>(synonymtypedef) <span class="name">T</span>(ID))
AnnotationAssertion(<span class="name">T</span>(name) <span class="name">T</span>(ID) <span class="name">T</span>(String))
AnnotationAssertion(<span class="name">T</span>(scope) <span class="name">T</span>(ID) <span class="name">T</span>(Scope))
</td>
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;"><Tag>(String Qualifiers)</td>
<td valign="top" style="white-space: pre;">AnnotationAssertion(<span class="name">T</span>(Qualifiers) <span class="name">T</span>(<Tag>) <span class="name">T</span>(ID) <span class="name">T</span>(String))</td>
</tr>
</tbody>
</table>
<h3><a name="5.1"></a>5.1 Declarations</h3>
<table border="1" cellspacing="0">
<caption><a id="decl" name="decl" />
Mapping of frames/stanzas to OWL</caption>
<thead>
<tr><th>OBO</th>
<th>Conditions</th>
<th>Translation - <span class="name">T<sup>F</sup></span>(S)</th></tr>
</thead>
<tbody>
<tr>
<td valign="top" style="white-space: pre;">Term(Class-id Clause-1..Clause-n)
</td>
<td>
</td>
<td valign="top" style="white-space: pre;">Class(<span class="name">T</span>(Class-id)) <span class="name">T<sup>C</sup></span>(Clause-1)..<span class="name">T<sup>C</sup></span>(Clause-n)
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">Typedef(Rel-id)
</td>
<td>is_metadata_tag(true) OR
is_class_level(true)
</td>
<td valign="top" style="white-space: pre;">AnnotationProperty(<span class="name">T</span>(Rel-id)) <span class="name">T<sup>P</sup></span>(Clause-1)..<span class="name">P<sup>C</sup></span>(Clause-n)
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">Typedef(Rel-id)
</td>
<td>NOT (is_metadata_tag(true) OR
is_class_level(true) )
</td>
<td valign="top" style="white-space: pre;">ObjectProperty(<span class="name">T</span>(Rel-id)) <span class="name">T<sup>P</sup></span>(Clause-1)..<span class="name">P<sup>C</sup></span>(Clause-n)
</td>
</tr>
<tr>
<td valign="top" style="white-space: pre;">Instance(Instance-id)
</td>
<td>
</td>
<td valign="top" style="white-space: pre;">NamedIndividual(<span class="name">T</span>(Instance-id)) <span class="name">T<sup>I</sup></span>(Clause-1)..<span class="name">I<sup>C</sup></span>(Clause-n)
</td>
</tr>
</tbody>
</table>
<h3><a name="5.2"></a>5.2 Mapping Term Frames - Class Axioms</h3>
<p>
Term frames are mapped to Class declarations and Class-level
axioms. We list the translations that are specific to Term frames
here - generic translations making annotation assertions are applied
later on.
</p>
<table border="1" cellspacing="0">
<caption><a id="translation" name="translationDL" />
Translation of Term frames to OWL</caption>
<thead>
<tr><th>Term frame with id:Class-ID</th>