phillord / tawny-owl

Build OWL Ontologies in a Programmatic Environment
GNU Lesser General Public License v3.0
251 stars 54 forks source link

Specifying the ontology for predicates when describing "exactly" relationships #30

Closed goksel closed 9 years ago

goksel commented 9 years ago

Predicates, when used to describe "exactly" relationships programmatically, are created in the ontology that is defined last. However, it is not possible to specify the ontology that such predicates belong to.

For example, the code below works well without specifying the ontology. (defontology ontology1)
(defontology ontology2)
(owl-class ontology1 "Class1" :subclass ( exactly 1 "predicate1" (owl-class ontology1 "Class2") ))

However the line below does not work: (owl-class ontology1 "Class1" :subclass ( exactly 1 ontology2 "predicate1" (owl-class ontology1 "Class2") ))

A similar code using the "owl-some" relationship works without any problem. (owl-class ontology1 "Class1" :subclass ( owl-some ontology2 "predicate2" (owl-class ontology1 "Class2") ))

phillord commented 9 years ago

Try

(owl-class ontology1 "Class1" :subclass (exactly ontology2 1 "predicate1" (owl-class ontology1 "Class2")))

The ontology argument always comes first.

goksel commented 9 years ago

This solves the problem. Closing the issue.