1
+ package uk .co .turingatemyhamster
2
+ package owl2
3
+ package ast
4
+
5
+ /**
6
+ *
7
+ *
8
+ * @author Matthew Pocock
9
+ */
10
+ trait OntologysImpl extends owl2.Ontologys {
11
+
12
+ importedPackages : owl2.Iri =>
13
+
14
+ override type Ontology = ast.Ontology [IRI , Annotation , Axiom ]
15
+
16
+ override final val Ontology : OntologyApi = new OntologyApi {
17
+ override def apply (directlyImports : List [IRI ],
18
+ ontologyIRI : Option [IRI ],
19
+ versionIRI : Option [IRI ],
20
+ ontologyAnnotation : List [Annotation ],
21
+ axioms : List [Axiom ]) = ast.Ontology (directlyImports, ontologyIRI, versionIRI, ontologyAnnotation, axioms)
22
+
23
+ override def unapply (o : Ontology ) = ast.Ontology .unapply(o)
24
+ }
25
+
26
+ override final type Annotation = ast.Annotation
27
+
28
+ override final val Annotation : AnnotationApi = new AnnotationApi {
29
+ override def unapply (annotation : Annotation ) = Some (annotation.annotationAnnotations)
30
+ }
31
+
32
+ override final type Axiom = ast.Axiom
33
+
34
+ override final val Axiom : AxiomApi = new AxiomApi {
35
+ override def unapply (axiom : Axiom ) = Some (axiom.axiomAnnotations)
36
+ }
37
+ }
38
+
39
+ // constraint: versionIRI.isDefined ==> ontologyIRI.isDefined
40
+ // Could encode as:
41
+ // case class OntologyURI(uriValue: IRI, versionIRI: Option[IRI])
42
+ case class Ontology [IRI , Annotation , Axiom ](directlyImportsDocuments : List [IRI ],
43
+ ontologyIRI : Option [IRI ],
44
+ versionIRI : Option [IRI ],
45
+ ontologyAnnotations : List [Annotation ],
46
+ axioms : List [Axiom ])
47
+
48
+ trait Annotation {
49
+ def annotationAnnotations : List [Annotation ]
50
+ }
51
+
52
+ trait Axiom {
53
+ def axiomAnnotations : List [Annotation ]
54
+ }
0 commit comments