(in-package :cl-user) (with-ontology localized-domain-range () ( ;; definitions from RO, BFO (object-property !part_of (inverse-of !has_part)) (class !Continuant :partial) (class !Occurrent :partial) (disjoint-classes !Continuant !Occurrent) ;; domain and range (sub-class-of (restriction !part_of (some-values-from !Continuant)) !Continuant) (sub-class-of (restriction !has_part (some-values-from !Continuant)) !Continuant) (sub-class-of (restriction !part_of (some-values-from !Occurrent)) !Occurrent) (sub-class-of (restriction !has_part (some-values-from !Occurrent)) !Occurrent) ;; test instances (individual !continuant1 (type !Continuant)) (individual !should-be-continuant1 (value !part_of !continuant1)) (individual !should-be-continuant2 (value !has_part !continuant1)) ;; test class (class !shouldnt-be-satisfiable :partial (intersection-of !Continuant (restriction !part_of (some-values-from !Occurrent)))) ;; make sure that continuants with no parts are allowed. (class !no-part-continuants :complete (intersection-of !Continuant (restriction !part_of (cardinality 0))))) (print-db (parents !no-part-continuants)) (print-db (direct-types !should-be-continuant1)) (print-db (direct-types !should-be-continuant2)) (print-db (satisfiable-concept? !shouldnt-be-satisfiable)) ; (princ (abstract-syntax localized-domain-range)) ; (write-rdfxml localized-domain-range) (values) ) (with-ontology domain-example () ((Class !continuant :partial) (object-property !part_of (domain !continuant)) (individual !should-be-continuant (value !part_of !continuant))) (print-db (all-types !should-be-continuant)))