Debian Codegraph @

Source/Parser/FunctionalANTLR/OWL2FunctionalGrammer.g

raw
1 grammar OWL2FunctionalGrammer;
2
3 options {
4 language = Cpp;
5 k = 2;
6 }
7
8 tokens {
9 /* Ontology Keywords */
10 PREFIX = 'Prefix';
11 ONTOLOGY = 'Ontology';
12 IMPORT = 'Import';
13
14 /* Entities and Literals */
15 CLASS = 'Class';
16 DATATYPE = 'Datatype';
17 OBJECT_PROPERTY = 'ObjectProperty';
18 DATA_PROPERTY = 'DataProperty';
19 ANNOTATION_PROPERTY = 'Annotation_Property';
20 NAMED_INDIVIDUAL = 'NamedIndividual';
21
22 /* Declaration */
23 DECLARATION = 'Declaration';
24
25 /* Property Expressions */
26 OBJECT_INVERSE_OF = 'ObjectInverseOf';
27 OBJECT_PROPERTY_CHAIN = 'ObjectPropertyChain';
28
29 /* Data Ranges */
30 DATATYPE_RESTRICTION = 'DatatypeRestriction';
31
32 /* Class Expressions */
33 OBJECT_INTERSECTION_OF = 'ObjectIntersectionOf';
34 OBJECT_UNION_OF = 'ObjectUnionOf';
35 OBJECT_COMPLEMENT_OF = 'ObjectComplementOf';
36 OBJECT_ONE_OF = 'ObjectOneOf';
37 OBJECT_SOME_VALUES_FROM = 'ObjectSomeValuesFrom';
38 OBJECT_ALL_VALUES_FROM = 'ObjectAllValuesFrom';
39 OBJECT_HAS_VALUE = 'ObjectHasValue';
40 OBJECT_HAS_SELF = 'ObjectHasSelf';
41 OBJECT_MIN_CARDINALITY = 'ObjectMinCardinality';
42 OBJECT_MAX_CARDINALITY = 'ObjectMaxCardinality';
43 OBJECT_EXACT_CARDINALITY = 'ObjectExactCardinality';
44 DATA_INTERSECTION_OF = 'DataIntersectionOf';
45 DATA_UNION_OF = 'DataUnionOf';
46 DATA_COMPLEMENT_OF = 'DataComplementOf';
47 DATA_ONE_OF = 'DataOneOf';
48 DATA_SOME_VALUES_FROM = 'DataSomeValuesFrom';
49 DATA_ALL_VALUES_FROM = 'DataAllValuesFrom';
50 DATA_HAS_VALUE = 'DataHasValue';
51 DATA_MIN_CARDINALITY = 'DataMinCardinality';
52 DATA_MAX_CARDINALITY = 'DataMaxCardinality';
53 DATA_EXACT_CARDINALITY = 'DataExactCardinality';
54
55 /* Class Expressions Axioms */
56 SUB_CLASS_OF = 'SubClassOf';
57 EQUIVALENT_CLASSES = 'EquivalentClasses';
58 DISJOINT_CLASSES = 'DisjointClasses';
59 DISJOINT_UNION = 'DisjointUnion';
60
61 /* Object Property Axioms */
62 SUB_OBJECT_PROPERTY_OF = 'SubObjectPropertyOf';
63 EQUIVALENT_OBJECT_PROPERTIES = 'EquivalentObjectProperties';
64 DISJOINT_OBJECT_PROPERTIES = 'DisjointObjectProperties';
65 OBJECT_PROPERTY_DOMAIN = 'ObjectPropertyDomain';
66 OBJECT_PROPERTY_RANGE = 'ObjectPropertyRange';
67 INVERSE_OBJECT_PROPERTIES = 'InverseObjectProperties';
68 FUNCTIONAL_OBJECT_PROPERTY = 'FunctionalObjectProperty';
69 INVERSE_FUNCTIONAL_OBJECT_PROPERTY = 'InverseFunctionalObjectProperty';
70 REFLEXIVE_OBJECT_PROPERTY = 'ReflexiveObjectProperty';
71 IRREFLEXIVE_OBJECT_PROPERTY = 'IrreflexiveObjectProperty';
72 SYMMETRIC_OBJECT_PROPERTY = 'SymmetricObjectProperty';
73 ASYMMETRIC_OBJECT_PROPERTY = 'AsymmetricObjectProperty';
74 TRANSITIVE_OBJECT_PROPERTY = 'TransitiveObjectProperty';
75
76 /* Data Property Axioms */
77 SUB_DATA_PROPERTY_OF = 'SubDataPropertyOf';
78 EQUIVALENT_DATA_PROPERTIES = 'EquivalentDataProperties';
79 DISJOINT_DATA_PROPERTIES = 'DisjointDataProperties';
80 DATA_PROPERTY_DOMAIN = 'DataPropertyDomain';
81 DATA_PROPERTY_RANGE = 'DataPropertyRange';
82 FUNCTIONAL_DATA_PROPERTY = 'FunctionalDataProperty';
83 DATATYPE_DEFINITION = 'DatatypeDefinition';
84
85 /* Keys */
86 HAS_KEY = 'HasKey';
87
88 /* Assertions */
89 SAME_INDIVIDUAL = 'SameIndividual';
90 DIFFERENT_INDIVIDUALS = 'DifferentIndividuals';
91 CLASS_ASSERTION = 'ClassAssertion';
92 OBJECT_PROPERTY_ASSERTION = 'ObjectPropertyAssertion';
93 NEGATIVE_OBJECT_PROPERTY_ASSERTION = 'NegativeObjectPropertyAssertion';
94 DATA_PROPERTY_ASSERTION = 'DataPropertyAssertion';
95 NEGATIVE_DATA_PROPERTY_ASSERTION = 'NegativeDataPropertyAssertion';
96
97 /* Annotations */
98 ANNOTATION = 'Annotation';
99 ANNOTATION_ASSERTION = 'AnnotationAssertion';
100 SUB_ANNOTATION_PROPERTY_OF = 'SubAnnotationPropertyOf';
101 ANNOTATION_PROPERTY_DOMAIN = 'AnnotationPropertyDomain';
102 ANNOTATION_PROPERTY_RANGE = 'AnnotationPropertyRange';
103
104 }
105
106
107 @header {
108 }
109
110 @members {
111 }
112
113
114 /*------------------------------------------------------------------
115 * LEXER RULES
116 *------------------------------------------------------------------*/
117
118 WHITESPACE
119 : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ { skip(); }
120 ;
121
122
123 NON_NEGATIVE_INTEGER
124 : ('1'..'9') DIGIT*
125 ;
126
127 fragment
128 DIGIT
129 : '0'..'9'
130 ;
131
132 REFERENCE
133 : '^^'
134 ;
135
136 OPEN_BRACE
137 : '('
138 ;
139
140 CLOSE_BRACE
141 : ')'
142 ;
143
144 EQUALS
145 : '='
146 ;
147
148 /* a finite sequence of characters in which " (U+22) and \ (U+5C)
149 * occur only in pairs of the form \" (U+5C, U+22) and \\ (U+5C, U+5C),
150 * enclosed in a pair of " (U+22) characters
151 */
152 QUOTED_STRING
153 : '\"' ( ~('\\'|'\"')
154 | ('\\' ('\"'|'\''|'\\'))
155 )*
156 '\"'
157 ;
158
159 IRI_REF
160 : '<' (
161 ~( '<'
162 | '>'
163 | '\"'
164 | '{'
165 | '}'
166 | '|'
167 | '^'
168 | '`'
169 | '\\'
170 | '\u0000'..'\u0020'
171 )
172 )* '>'
173 ; /* see IRI_REF of [SPARQL] */
174
175 PNAME_NS
176 : PN_PREFIX? ':'
177 ;
178
179
180 PNAME_LN
181 : PNAME_NS PN_LOCAL
182 ;
183
184 BLANK_NODE_LABEL
185 : '_:' PN_LOCAL
186 ;
187
188 LANGTAG
189 : '@' ('a'..'z'|'A'..'Z')+ ('-' ('a'..'z'|'A'..'Z'|DIGIT)+)*
190 ;
191
192
193 fragment
194 PN_CHARS_U
195 : PN_CHARS_BASE | '_'
196 ;
197
198 fragment
199 PN_CHARS
200 : PN_CHARS_U
201 | '-'
202 | DIGIT
203 | '\u00B7'
204 | '\u0300'..'\u036F'
205 | '\u203F'..'\u2040'
206 ;
207
208 fragment
209 PN_PREFIX
210 : PN_CHARS_BASE ( ( PN_CHARS | '.' )* PN_CHARS )?
211 ;
212
213 fragment
214 PN_LOCAL
215 : ( PN_CHARS_U | DIGIT ) ( ( PN_CHARS | '.' )* PN_CHARS)?
216 ;
217
218 fragment
219 PN_CHARS_BASE
220 : 'a'..'z'
221 | 'A'..'Z'
222 | '\u00C0'..'\u00D6'
223 | '\u00D8'..'\u00F6'
224 | '\u00F8'..'\u02FF'
225 | '\u0370'..'\u037D'
226 | '\u037F'..'\u1FFF'
227 | '\u200C'..'\u200D'
228 | '\u2070'..'\u218F'
229 | '\u2C00'..'\u2FEF'
230 | '\u3001'..'\uD7FF'
231 | '\uF900'..'\uFDCF'
232 | '\uFDF0'..'\uFFFD'
233 // | '\u10000'..'\uEFFFF' // not supported by java
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 /* 2 Preliminary Definitions */
271
272 /* 2.3 Integers, Characters, Strings, Language Tags, and Node IDs */
273 /* @ (U+40) followed a nonempty sequence of characters matching the
274 * langtag production from [BCP 47]
275 */
276 languageTag
277 : LANGTAG
278 ;
279 /* See LANGTAG in [SPARQL] */
280 /* a finite sequence of characters matching the BLANK_NODE_LABEL
281 * production of [SPARQL]
282 */
283 nodeId
284 : BLANK_NODE_LABEL
285 ;
286
287 /* 2.3 IRIs */
288 /* an iri as defined in [RFC3987], enclosed in a pair of < (U+3C) and >
289 * (U+3E) characters
290 */
291 fullIri
292 : IRI_REF
293 ;
294 /* See IRI_REF in [SPARQL] */
295 iri
296 : fullIri
297 | abbreviatedIri
298 ;
299
300 /* a finite sequence of characters matching the PNAME_LN production of
301 * [SPARQL]
302 */
303 abbreviatedIri
304 : PNAME_LN
305 ;
306
307 /* a finite sequence of characters matching the as PNAME_NS production of
308 * [SPARQL]
309 */
310 prefixName
311 : PNAME_NS
312 ;
313
314
315
316
317
318 /* 3 Ontologies */
319
320 /* 3.5 Ontology Annotations */
321 ontologyAnnotations
322 : annotation*
323 ;
324
325 /* 3.7 Functional-Style Syntax */
326 ontologyDocument
327 : prefixDeclaration* ontology
328 ;
329
330 prefixDeclaration
331 : PREFIX OPEN_BRACE prefixName EQUALS fullIri CLOSE_BRACE
332 ;
333
334 ontology
335 : ONTOLOGY OPEN_BRACE ( ontologyIri versionIri? )?
336 directlyImportsDocuments
337 ontologyAnnotations
338 axioms
339 CLOSE_BRACE
340 ;
341
342 ontologyIri
343 : iri
344 ;
345
346 versionIri
347 : iri
348 ;
349
350 directlyImportsDocuments
351 : ( IMPORT OPEN_BRACE iri CLOSE_BRACE )*
352 ;
353
354 axioms
355 : (axiom)*
356 ;
357
358
359
360 /* 5 Entities and Literals */
361
362 /* 5.1 Classes */
363 class
364 : iri
365 ;
366
367 /* 5.2 Datatypes */
368 datatype
369 : iri
370 ;
371
372 /* 5.3 Object Properties */
373 objectProperty
374 : iri
375 ;
376
377 /* 5.4 Data Properties */
378 dataProperty
379 : iri
380 ;
381
382 /* 5.5 Annotation Properties */
383 annotationProperty
384 : iri
385 ;
386
387 /* 5.6 Individuals */
388 individual
389 : namedIndividual
390 | anonymousIndividual
391 ;
392
393 /* 5.6.1 Named Individuals */
394 namedIndividual
395 : iri
396 ;
397
398 /* 5.6.2 Anonymous Individuals */
399 anonymousIndividual
400 : nodeId
401 ;
402
403 /* 5.7 Literals */
404 literal
405 : QUOTED_STRING
406 ( REFERENCE datatype
407 | languageTag?
408 )
409 ;
410
411 /* 5.8 Entity Declarations and Typing */
412 declaration
413 : DECLARATION OPEN_BRACE axiomAnnotations entity CLOSE_BRACE
414 ;
415
416 entity
417 : CLASS OPEN_BRACE class CLOSE_BRACE
418 | DATATYPE OPEN_BRACE datatype CLOSE_BRACE
419 | OBJECT_PROPERTY OPEN_BRACE objectProperty CLOSE_BRACE
420 | DATA_PROPERTY OPEN_BRACE dataProperty CLOSE_BRACE
421 | ANNOTATION_PROPERTY OPEN_BRACE annotationProperty CLOSE_BRACE
422 | NAMED_INDIVIDUAL OPEN_BRACE namedIndividual CLOSE_BRACE
423 ;
424
425 /* 6 Property Expressions */
426 objectPropertyExpression
427 : objectProperty
428 | inverseObjectProperty
429 ;
430
431 /* 6.1.1 Inverse Object Properties */
432 inverseObjectProperty
433 : OBJECT_INVERSE_OF OPEN_BRACE objectProperty CLOSE_BRACE
434 ;
435
436 /* 6.2 Data Property Expressions */
437 dataPropertyExpression
438 : dataProperty
439 ;
440
441 /* 7 Data Ranges */
442 dataRange
443 : datatype
444 | dataIntersectionOf
445 | dataUnionOf
446 | dataComplementOf
447 | dataOneOf
448 | dataRangeRestriction
449 ;
450
451 /* 7.1 Intersection of Data Ranges */
452 dataIntersectionOf
453 : DATA_INTERSECTION_OF OPEN_BRACE dataRange dataRange+ CLOSE_BRACE
454 ;
455
456 /* 7.2 Union of Data Ranges */
457 dataUnionOf
458 : DATA_UNION_OF OPEN_BRACE dataRange dataRange+ CLOSE_BRACE
459 ;
460
461 /* 7.3 Complement of Data Ranges */
462 dataComplementOf
463 : DATA_COMPLEMENT_OF OPEN_BRACE dataRange CLOSE_BRACE
464 ;
465
466 /* 7.4 Enumeration of Literals */
467 dataOneOf
468 : DATA_ONE_OF OPEN_BRACE literal+ CLOSE_BRACE
469 ;
470
471 /* 7.5 Datatype Restrictions */
472 dataRangeRestriction
473 : DATATYPE_RESTRICTION OPEN_BRACE
474 datatype
475 ( dataRangeFacetRestriction )+
476 CLOSE_BRACE
477 ;
478
479 dataRangeFacetRestriction
480 : iri literal
481 ;
482
483
484 /* 8 Class Expressions */
485 classExpression
486 : class
487 | objectIntersectionOf
488 | objectUnionOf
489 | objectComplementOf
490 | objectOneOf
491 | objectSomeValuesFrom
492 | objectAllValuesFrom
493 | objectHasValue
494 | objectHasSelf
495 | objectMinCardinality
496 | objectMaxCardinality
497 | objectExactCardinality
498 | dataSomeValuesFrom
499 | dataAllValuesFrom
500 | dataHasValue
501 | dataMinCardinality
502 | dataMaxCardinality
503 | dataExactCardinality
504 ;
505
506
507 /* 8.1 Propositional Connectives and Enumeration of Individuals */
508
509 /* 8.1.1 Intersection of Class Expressions */
510 objectIntersectionOf
511 : OBJECT_INTERSECTION_OF OPEN_BRACE
512 classExpression
513 ( classExpression)+
514 CLOSE_BRACE
515 ;
516
517 /* 8.1.2 Union of Class Expressions */
518 objectUnionOf
519 : OBJECT_UNION_OF OPEN_BRACE classExpression classExpression+ CLOSE_BRACE
520 ;
521
522 /* 8.1.3 Complement of Class Expressions */
523 objectComplementOf
524 : OBJECT_COMPLEMENT_OF OPEN_BRACE classExpression CLOSE_BRACE
525 ;
526
527 /* 8.1.4 Enumeration of Individuals */
528 objectOneOf
529 : OBJECT_ONE_OF OPEN_BRACE individual+ CLOSE_BRACE
530 ;
531
532
533 /* 8.2 Object Property Restrictions */
534
535 /* 8.2.1 Existential Quantification */
536 objectSomeValuesFrom
537 : OBJECT_SOME_VALUES_FROM OPEN_BRACE
538 objectPropertyExpression
539 classExpression
540 CLOSE_BRACE
541 ;
542
543 /* 8.2.2 Universal Quantification */
544 objectAllValuesFrom
545 : OBJECT_ALL_VALUES_FROM OPEN_BRACE
546 objectPropertyExpression
547 classExpression
548 CLOSE_BRACE
549 ;
550
551 /* 8.2.3 Individual Value Restriction */
552 objectHasValue
553 : OBJECT_HAS_VALUE OPEN_BRACE
554 objectPropertyExpression
555 individual
556 CLOSE_BRACE
557 ;
558
559 /* 8.2.4 Self-Restriction */
560 objectHasSelf
561 : OBJECT_HAS_SELF OPEN_BRACE
562 objectPropertyExpression
563 CLOSE_BRACE
564 ;
565
566
567 /* 8.3 Object Property Cardinality Restrictions */
568
569 /* 8.3.1 Minimum Cardinality */
570 objectMinCardinality
571 : OBJECT_MIN_CARDINALITY OPEN_BRACE
572 NON_NEGATIVE_INTEGER
573 objectPropertyExpression
574 classExpression?
575 CLOSE_BRACE
576 ;
577
578 /* 8.3.2 Maximum Cardinality */
579 objectMaxCardinality
580 : OBJECT_MAX_CARDINALITY OPEN_BRACE
581 NON_NEGATIVE_INTEGER
582 objectPropertyExpression
583 classExpression?
584 CLOSE_BRACE
585 ;
586
587 /* 8.3.3 Exact Cardinality */
588 objectExactCardinality
589 : OBJECT_EXACT_CARDINALITY OPEN_BRACE
590 NON_NEGATIVE_INTEGER
591 objectPropertyExpression
592 classExpression?
593 CLOSE_BRACE
594 ;
595
596
597 /* 8.4 Data Property Restrictions */
598
599 /* 8.4.1 Existential Quantification */
600 dataSomeValuesFrom
601 : DATA_SOME_VALUES_FROM OPEN_BRACE
602 dataPropertyExpression+
603 dataRange
604 CLOSE_BRACE
605 ;
606
607 /* 8.4.2 Universal Quantification */
608 dataAllValuesFrom
609 : DATA_ALL_VALUES_FROM OPEN_BRACE
610 dataPropertyExpression+
611 dataRange
612 CLOSE_BRACE
613 ;
614
615 /* 8.4.3 Literal Value Restriction */
616 dataHasValue
617 : DATA_HAS_VALUE OPEN_BRACE
618 dataPropertyExpression
619 literal
620 CLOSE_BRACE
621 ;
622
623
624 /* 8.5 Data Property Cardinality Restrictions */
625
626 /* 8.5.1 Minimum Cardinality */
627 dataMinCardinality
628 : DATA_MIN_CARDINALITY OPEN_BRACE
629 NON_NEGATIVE_INTEGER
630 dataPropertyExpression
631 dataRange?
632 CLOSE_BRACE
633 ;
634
635 /* 8.5.2 Maximum Cardinality */
636 dataMaxCardinality
637 : DATA_MAX_CARDINALITY OPEN_BRACE
638 NON_NEGATIVE_INTEGER
639 dataPropertyExpression
640 dataRange?
641 CLOSE_BRACE
642 ;
643
644 /* 8.5.3 Exact Cardinality */
645 dataExactCardinality
646 : DATA_EXACT_CARDINALITY OPEN_BRACE
647 NON_NEGATIVE_INTEGER
648 dataPropertyExpression
649 dataRange?
650 CLOSE_BRACE
651 ;
652
653 /* 9 Axioms */
654 axiom
655 : declaration
656 | classAxiom
657 | objectPropertyAxiom
658 | dataPropertyAxiom
659 | datatypeDefinition
660 | hasKey
661 | assertion
662 | annotationAxiom
663 ;
664
665 axiomAnnotations
666 : annotation*
667 ;
668
669 /* 9.1 Class Expression Axioms */
670 classAxiom
671 : subClassOf
672 | equivalentClasses
673 | disjointClasses
674 | disjointUnion
675 ;
676
677 /* 9.1.1 Subclass Axioms */
678 subClassOf
679 : SUB_CLASS_OF OPEN_BRACE
680 axiomAnnotations
681 subClassExpression
682 superClassExpression
683 CLOSE_BRACE
684 ;
685
686 subClassExpression
687 : classExpression
688 ;
689
690 superClassExpression
691 : classExpression
692 ;
693
694 /* 9.1.2 Equivalent Classes */
695 equivalentClasses
696 : EQUIVALENT_CLASSES OPEN_BRACE
697 axiomAnnotations
698 classExpression
699 ( classExpression )+
700 CLOSE_BRACE
701 ;
702
703 /* 9.1.3 Disjoint Classes */
704 disjointClasses
705 : DISJOINT_CLASSES OPEN_BRACE
706 axiomAnnotations
707 classExpression
708 classExpression+
709 CLOSE_BRACE
710 ;
711
712 /* 9.1.4 Disjoint Union of Class Expressions */
713 disjointUnion
714 : DISJOINT_UNION OPEN_BRACE
715 axiomAnnotations
716 class
717 disjointClassExpressions
718 CLOSE_BRACE
719 ;
720
721 disjointClassExpressions
722 : classExpression classExpression+
723 ;
724
725 /* 9.2 Object Property Axioms */
726 objectPropertyAxiom
727 : subObjectPropertyOf
728 | equivalentObjectProperties
729 | disjointObjectProperties
730 | inverseObjectProperties
731 | objectPropertyDomain
732 | objectPropertyRange
733 | functionalObjectProperty
734 | inverseFunctionalObjectProperty
735 | reflexiveObjectProperty
736 | irreflexiveObjectProperty
737 | symmetricObjectProperty
738 | asymmetricObjectProperty
739 | transitiveObjectProperty
740 ;
741
742 /* 9.2.1 Object Subproperties */
743 subObjectPropertyOf
744 : SUB_OBJECT_PROPERTY_OF OPEN_BRACE
745 axiomAnnotations
746 ( objectPropertyExpression
747 | propertyExpressionChain
748 ) objectPropertyExpression
749 CLOSE_BRACE
750 ;
751
752 propertyExpressionChain
753 : OBJECT_PROPERTY_CHAIN OPEN_BRACE
754 objectPropertyExpression
755 ( objectPropertyExpression )+
756 CLOSE_BRACE
757 ;
758
759 /* 9.2.2 Equivalent Object Properties */
760 equivalentObjectProperties
761 : EQUIVALENT_OBJECT_PROPERTIES OPEN_BRACE
762 axiomAnnotations
763 objectPropertyExpression
764 objectPropertyExpression+
765 CLOSE_BRACE
766 ;
767
768 /* 9.2.3 Disjoint Object Properties */
769 disjointObjectProperties
770 : DISJOINT_OBJECT_PROPERTIES OPEN_BRACE
771 axiomAnnotations
772 objectPropertyExpression
773 objectPropertyExpression+
774 CLOSE_BRACE
775 ;
776
777 /* 9.2.4 Inverse Object Properties */
778 inverseObjectProperties
779 : INVERSE_OBJECT_PROPERTIES OPEN_BRACE
780 axiomAnnotations
781 objectPropertyExpression
782 objectPropertyExpression
783 CLOSE_BRACE
784 ;
785
786 /* 9.2.5 Object Property Domain */
787 objectPropertyDomain
788 : OBJECT_PROPERTY_DOMAIN OPEN_BRACE
789 axiomAnnotations
790 objectPropertyExpression
791 classExpression
792 CLOSE_BRACE
793 ;
794
795 /* 9.2.6 Object Property Range */
796 objectPropertyRange
797 : OBJECT_PROPERTY_RANGE OPEN_BRACE
798 axiomAnnotations
799 objectPropertyExpression
800 classExpression
801 CLOSE_BRACE
802 ;
803
804 /* 9.2.7 Functional Object Properties */
805 functionalObjectProperty
806 : FUNCTIONAL_OBJECT_PROPERTY OPEN_BRACE
807 axiomAnnotations
808 objectPropertyExpression
809 CLOSE_BRACE
810 ;
811
812 /* 9.2.8 Inverse-Functional Object Properties */
813 inverseFunctionalObjectProperty
814 : INVERSE_FUNCTIONAL_OBJECT_PROPERTY OPEN_BRACE
815 axiomAnnotations
816 objectPropertyExpression
817 CLOSE_BRACE
818 ;
819
820 /* 9.2.9 Reflexive Object Properties */
821 reflexiveObjectProperty
822 : REFLEXIVE_OBJECT_PROPERTY OPEN_BRACE
823 axiomAnnotations
824 objectPropertyExpression
825 CLOSE_BRACE
826 ;
827
828 /* 9.2.10 Irreflexive Object Properties */
829 irreflexiveObjectProperty
830 : IRREFLEXIVE_OBJECT_PROPERTY OPEN_BRACE
831 axiomAnnotations
832 objectPropertyExpression
833 CLOSE_BRACE
834 ;
835
836 /* 9.2.11 Symmetric Object Properties */
837 symmetricObjectProperty
838 : SYMMETRIC_OBJECT_PROPERTY OPEN_BRACE
839 axiomAnnotations
840 objectPropertyExpression
841 CLOSE_BRACE
842 ;
843
844 /* 9.2.12 Asymmetric Object Properties */
845 asymmetricObjectProperty
846 : ASYMMETRIC_OBJECT_PROPERTY OPEN_BRACE
847 axiomAnnotations
848 objectPropertyExpression
849 CLOSE_BRACE
850 ;
851
852 /* 9.2.13 Transitive Object Properties */
853 transitiveObjectProperty
854 : TRANSITIVE_OBJECT_PROPERTY OPEN_BRACE
855 axiomAnnotations
856 objectPropertyExpression
857 CLOSE_BRACE
858 ;
859
860 /* 9.3 Data Property Axioms */
861 dataPropertyAxiom
862 : subDataPropertyOf
863 | equivalentDataProperties
864 | disjointDataProperties
865 | dataPropertyDomain
866 | dataPropertyRange
867 | functionalDataProperty
868 ;
869
870 /* 9.3.1 Data Subproperties */
871 subDataPropertyOf
872 : SUB_DATA_PROPERTY_OF OPEN_BRACE
873 axiomAnnotations
874 subDataPropertyExpression
875 superDataPropertyExpression
876 CLOSE_BRACE
877 ;
878
879 subDataPropertyExpression
880 : dataPropertyExpression
881 ;
882 superDataPropertyExpression
883 : dataPropertyExpression
884 ;
885
886 /* 9.3.2 Equivalent Data Properties */
887 equivalentDataProperties
888 : EQUIVALENT_DATA_PROPERTIES OPEN_BRACE
889 axiomAnnotations
890 dataPropertyExpression
891 dataPropertyExpression+
892 CLOSE_BRACE
893 ;
894
895 /* 9.3.3 Disjoint Data Properties */
896 disjointDataProperties
897 : DISJOINT_DATA_PROPERTIES OPEN_BRACE
898 axiomAnnotations
899 dataPropertyExpression
900 dataPropertyExpression+
901 CLOSE_BRACE
902 ;
903
904 /* 9.3.4 Data Property Domain */
905 dataPropertyDomain
906 : DATA_PROPERTY_DOMAIN OPEN_BRACE
907 axiomAnnotations
908 dataPropertyExpression
909 classExpression
910 CLOSE_BRACE
911 ;
912
913 /* 9.3.5 Data Property Range */
914 dataPropertyRange
915 : DATA_PROPERTY_RANGE OPEN_BRACE
916 axiomAnnotations
917 dataPropertyExpression
918 dataRange
919 CLOSE_BRACE
920 ;
921
922 /* 9.3.6 Functional Data Properties */
923 functionalDataProperty
924 : FUNCTIONAL_DATA_PROPERTY OPEN_BRACE
925 axiomAnnotations
926 dataPropertyExpression
927 CLOSE_BRACE
928 ;
929
930 /* 9.4 Datatype Definitions */
931 datatypeDefinition
932 : DATATYPE_DEFINITION OPEN_BRACE
933 axiomAnnotations
934 datatype
935 dataRange
936 CLOSE_BRACE
937 ;
938
939 /* 9.5 Keys */
940 hasKey
941 : HAS_KEY OPEN_BRACE
942 axiomAnnotations
943 classExpression
944 OPEN_BRACE objectPropertyExpression* CLOSE_BRACE
945 OPEN_BRACE dataPropertyExpression* CLOSE_BRACE
946 CLOSE_BRACE
947 ;
948
949 /* 9.6 Assertions */
950 assertion
951 : sameIndividual
952 | differentIndividuals
953 | classAssertion
954 | objectPropertyAssertion
955 | negativeObjectPropertyAssertion
956 | dataPropertyAssertion
957 | negativeDataPropertyAssertion
958 ;
959
960 sourceIndividual
961 : individual
962 ;
963 targetIndividual
964 : individual
965 ;
966 targetValue
967 : literal
968 ;
969
970 /* 9.6.1 Individual Equality */
971 sameIndividual
972 : SAME_INDIVIDUAL OPEN_BRACE
973 axiomAnnotations
974 individual
975 individual+
976 CLOSE_BRACE
977 ;
978
979 /* 9.6.2 Individual Inequality */
980 differentIndividuals
981 : DIFFERENT_INDIVIDUALS OPEN_BRACE
982 axiomAnnotations
983 individual
984 individual+
985 CLOSE_BRACE
986 ;
987
988 /* 9.6.3 Class Assertions */
989 classAssertion
990 : CLASS_ASSERTION OPEN_BRACE
991 axiomAnnotations
992 classExpression
993 individual
994 CLOSE_BRACE
995 ;
996
997 /* 9.6.4 Positive Object Property Assertions */
998 objectPropertyAssertion
999 : OBJECT_PROPERTY_ASSERTION OPEN_BRACE
1000 axiomAnnotations
1001 objectPropertyExpression
1002 sourceIndividual
1003 targetIndividual
1004 CLOSE_BRACE
1005 ;
1006
1007 /* 9.6.5 Negative Object Property Assertions */
1008 negativeObjectPropertyAssertion
1009 : NEGATIVE_OBJECT_PROPERTY_ASSERTION OPEN_BRACE
1010 axiomAnnotations
1011 objectPropertyExpression
1012 sourceIndividual
1013 targetIndividual
1014 CLOSE_BRACE
1015 ;
1016
1017 /* 9.6.6 Positive Data Property Assertions */
1018 dataPropertyAssertion
1019 : DATA_PROPERTY_ASSERTION OPEN_BRACE
1020 axiomAnnotations
1021 dataPropertyExpression
1022 sourceIndividual
1023 targetValue
1024 CLOSE_BRACE
1025 ;
1026
1027 /* 9.6.7 Negative Data Property Assertions */
1028 negativeDataPropertyAssertion
1029 : NEGATIVE_DATA_PROPERTY_ASSERTION OPEN_BRACE
1030 axiomAnnotations
1031 dataPropertyExpression
1032 sourceIndividual
1033 targetValue
1034 CLOSE_BRACE
1035 ;
1036
1037
1038 /* 10 Annotations */
1039
1040 /* 10.1 Annotations of Ontologies, Axioms, and other Annotations */
1041 annotation
1042 : ANNOTATION OPEN_BRACE
1043 annotationAnnotations
1044 annotationProperty
1045 annotationValue
1046 CLOSE_BRACE
1047 ;
1048
1049 annotationAnnotations
1050 : annotation*
1051 ;
1052
1053 annotationValue
1054 : anonymousIndividual | iri | literal
1055 ;
1056
1057 /* 10.2 Annotation Axioms */
1058 annotationAxiom
1059 : annotationAssertion
1060 | subAnnotationPropertyOf
1061 | annotationPropertyDomain
1062 | annotationPropertyRange
1063 ;
1064
1065 /* 10.2.1 Annotation Assertion */
1066 annotationAssertion
1067 : ANNOTATION_ASSERTION OPEN_BRACE
1068 axiomAnnotations
1069 annotationProperty
1070 annotationSubject
1071 annotationValue
1072 CLOSE_BRACE
1073 ;
1074
1075 annotationSubject
1076 : iri | anonymousIndividual
1077 ;
1078
1079 /* 10.2.2 Annotation Subproperties */
1080 subAnnotationPropertyOf
1081 : SUB_ANNOTATION_PROPERTY_OF OPEN_BRACE
1082 axiomAnnotations
1083 subAnnotationProperty
1084 superAnnotationProperty
1085 CLOSE_BRACE
1086 ;
1087
1088 subAnnotationProperty
1089 : annotationProperty
1090 ;
1091
1092 superAnnotationProperty
1093 : annotationProperty
1094 ;
1095
1096 /* 10.2.3 Annotation Property Domain */
1097 annotationPropertyDomain
1098 : ANNOTATION_PROPERTY_DOMAIN OPEN_BRACE
1099 axiomAnnotations
1100 annotationProperty
1101 iri
1102 CLOSE_BRACE
1103 ;
1104
1105 /* 10.2.4 Annotation Property Range */
1106 annotationPropertyRange
1107 : ANNOTATION_PROPERTY_RANGE OPEN_BRACE
1108 axiomAnnotations
1109 annotationProperty
1110 iri
1111 CLOSE_BRACE
1112 ;
1113