phillord / tawny-owl

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

Pizza ontology tutorial: "unable to resolve symbol: functional" #63

Closed mathpunk closed 4 years ago

mathpunk commented 6 years ago

I am interested in learning about designing ontologies, and I was following the example of the pizza ontology in your "Getting Started."

When I try to evaluate something like:

(ns ontologies.pizza
  (:require [tawny.owl :as owl]))

(owl/declare-classes
 Pizza
 PizzaBase)

(owl/defoproperty hasIngredient)

(owl/defoproperty hasBase
  :subpropertyof hasIngredient
  :characteristics owl/functional
  :range PizzaBase
  :domain Pizza)

...I get Unable to resolve symbol: functional in this context.

I think that functional is getting defined here. As an experiment I tried replacing functional with irreflexive and got the same result, so I hazard that none of the functions named in that do form are getting declared, or at least are not getting declared non-privately.

phillord commented 6 years ago

Ah, sorry, it should be :functional with a colon.

I've been working on replacing those documents with a proper tutorial, but alas, have got rather stalled. The problem is with markdown I cannot sanely test that my code actually works. Need to fix this.

mathpunk commented 6 years ago

Hm, that yields----

(owl/defoproperty hasBase
                           :subpropertyof hasIngredient
                           :characteristics :functional
                           :range PizzaBase
                           :domain Pizza)
IllegalArgumentException Expected only keys (:ontology :subpropertychain :subchain :sub :inverse :disjoint :super :characteristic :label :subproperty :comment :domain :annotation :range :equivalent); Got ((#object[uk.ac.manchester.cs.owl.owlapi.OWLClassImpl 0x16c0054d "<http://www.ncl.ac.uk/pizza#PizzaBase>"]) (:subpropertyof #object[uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl 0x1d1b707b "<http://www.ncl.ac.uk/pizza#hasIngredient>"] :characteristics :functional))  tawny.util/check-keys (util.clj:99)
phillord commented 6 years ago

Oh dear. This stuff does need updating doesn't it.

(defoproperty hasBase :super hasIngredient :characteristic :functional)

phillord commented 6 years ago

I'll update these and https://github.com/phillord/tawny-pizza as soon as I can. I am hoping to release 2.0 fairly soon, but these need fixing.

dfornika commented 4 years ago

@phillord It looks like this was resolved. Can the issue be closed?

phillord commented 4 years ago

Indeed! Thanks