Skip to content

Commit

Permalink
refactor: Simplify macros for tawny-owl 2
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
ngrewe committed Feb 19, 2024
1 parent 75179ca commit 3cb65d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/main/clojure/de/halbordnung/ontologies/tqme/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@
(owl-some b/has_history (phase-perm-spec o class)))

(defn perm-spec
[o class]
[class]
class)

(defn temp
[o ctor relation class]
[ctor relation class]
(owl-some
has-max-tqme
(owl-some
Expand All @@ -170,7 +170,7 @@
)

(defn perm-gen
[o ctor relation class]
[ctor relation class]
(owl-and
(owl-some has-min-tqme
(ctor relation (owl-some min-tqme-of class)))
Expand Down
20 changes: 10 additions & 10 deletions src/test/clojure/de/halbordnung/ontologies/tqme/cq.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
:super organism))
(o/disjoint-classes to (list tooth organism))
(o/add-superclass to tooth
(c/temp to o/owl-some b/continuant_part_of_at_all_times organism))
(c/temp o/owl-some b/continuant_part_of_at_all_times organism))


(o/add-superclass to human
(c/temp to o/owl-only b/has_continuant_part_at_all_times (o/owl-not tooth)))
(c/temp o/owl-only b/has_continuant_part_at_all_times (o/owl-not tooth)))
(is (r/consistent? to) "Ontology is consistent")
(is (satisfiable? to (o/owl-and tooth
(o/owl-some
Expand Down Expand Up @@ -125,10 +125,10 @@
:characteristic :inversefunctional)
ventricle (o/owl-class to "ventricle"
:super (o/owl-and b/material_entity
(c/perm-spec to (o/owl-some part-of-brain brain))))
(c/perm-spec (o/owl-some part-of-brain brain))))
human (o/owl-class to "human"
:super (o/owl-and b/material_entity
(c/perm-spec to (o/owl-some has-brain brain))))
(c/perm-spec (o/owl-some has-brain brain))))

joes-brain (o/individual to "joes-brain"
:type brain)
Expand Down Expand Up @@ -180,7 +180,7 @@
(o/disjoint-classes to (list male-sex female-sex))
(def mammal (o/owl-class to "mammal"
:super (o/owl-and b/material_entity
(c/perm-spec to (o/exactly 1 b/specifically_depended_on_by sex)))))
(c/perm-spec (o/exactly 1 b/specifically_depended_on_by sex)))))

(is (not (satisfiable? to (o/owl-and mammal
(o/owl-some b/specifically_depended_on_by male-sex)
Expand All @@ -192,7 +192,7 @@
:super b/history))
(def organism (o/owl-class to "organism"
:super (o/owl-and b/material_entity
(c/perm-spec to (o/exactly 1 b/participates_in_at_all_times life)))))
(c/perm-spec (o/exactly 1 b/participates_in_at_all_times life)))))

(let
[joes-life (o/individual to "joes-life"
Expand Down Expand Up @@ -225,7 +225,7 @@
(o/disjoint-classes to (list oxygen-molecule red-blood-cell))

(o/add-superclass to red-blood-cell
(c/perm-gen to o/owl-some b/has_continuant_part_at_all_times oxygen-molecule))
(c/perm-gen o/owl-some b/has_continuant_part_at_all_times oxygen-molecule))

(o/with-probe-axioms to
[a (o/add-subclass to
Expand All @@ -246,7 +246,7 @@
:super b/quality))

(o/add-superclass to apple
(c/perm-gen to o/owl-some b/specifically_depended_on_by colour))
(c/perm-gen o/owl-some b/specifically_depended_on_by colour))

(.flush ^OWLReasoner (r/reasoner to))
(is (r/consistent? to)
Expand Down Expand Up @@ -299,11 +299,11 @@
(o/disjoint-classes to (list blood-volume red-blood-cell oxygen-molecule))

(o/add-superclass to red-blood-cell
(c/perm-gen to o/owl-some b/has_continuant_part_at_all_times
(c/perm-gen o/owl-some b/has_continuant_part_at_all_times
oxygen-molecule))

(o/add-superclass to blood-volume
(c/perm-gen to o/owl-some b/has_continuant_part_at_all_times
(c/perm-gen o/owl-some b/has_continuant_part_at_all_times
red-blood-cell))
(is (r/consistent? to)
"Consistent TQME ontology for transitive permanent generic parthood")
Expand Down

0 comments on commit 3cb65d1

Please sign in to comment.