// animals DAML+OIL example [MS] rdf := "http://www.w3.org/1999/02/22-rdf-syntax-ns#" . rdfs := "http://www.w3.org/TR/1999/PR-rdf-schema-19990303#". daml := "http://www.daml.org/2001/03/daml+oil#". animals := "http://www.example.org/animals#". // 1. pure DAML+OIL ontology @animals:ontology1 { animals:Animal[rdf:type -> daml:Class]. animals:Herbivore[rdf:type -> daml:Class; daml:subClassOf -> animals:Animal]. animals:Carnivore[rdf:type -> daml:Class; daml:subClassOf -> animals:Animal; daml:disjointWith -> animals:Herbivore]. animals:Omnivore[rdf:type -> daml:Class; daml:subClassOf -> animals:Herbivore; daml:subClassOf -> animals:Carnivore]. } // 2. initial ontology + taxonomy after classification with DL classifier @animals:ontology2 { FORALL S,P,O S[P->O] <- S[P->O]@animals:ontology1. // the following "pipes" the materialized model animals:ontology1 // through the external program "daml_oil" and asserts the // returned model EXTERNAL daml_oil(animals:ontology1). } // 3. remaining DAML+OIL semantics that can be defined in TRIPLE directly @animals:ontology3 { FORALL S,P,O S[P->O] <- S[P->O]@animals:ontology2. daml:Thing[rdf:type -> daml:Class]. daml:Nothing[rdf:type -> daml:Class]. FORALL C C[daml:sameClassAs -> C] <- C[rdf:type -> daml:Class]. FORALL C1,C2 C1[daml:subClassOf -> C2] <- C1[daml:sameClassAs -> C2]. FORALL C1,C2 C1[daml:sameClassAs -> C2] <- C2[daml:sameClassAs -> C1]. // ... transitivity of subClassOf etc. as for RDF Schema // (unfinished) } // query: which concepts/classes are unsatisfiable FORALL C <- C[daml:sameClassAs -> daml:Nothing]@animals:ontology3. // output is: C = 'http://www.example.org/animals#':'Omnivore' (and Nothing)