phillord / tawny-owl

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

Seeming problems with generated ontology file #83

Open Trevoke opened 3 weeks ago

Trevoke commented 3 weeks ago

Hello! Thanks again for this project, it's allowing me to explore my ability to reason about these things and try to define concepts so much better.

I've found a problem with the generated ontology as I try to iterate.

Before the generated code, here's hopefully all the possibly relevant clojure code:

;;; project.clj
(defproject pizza "0.0.1-SNAPSHOT"
  :description "An ontology for pizza"
  :dependencies [[uk.org.russet/tawny-owl "2.3.3"]]
  :main pizza.core

  :profiles
  {:light {:plugins [[nightlight/lein-nightlight "2.4.4"]]}}
  )

;;; src/pizza/core.clj
(ns pizza.core
  [:use [tawny.owl]]
  [:require [pizza.pizza]])

(defn -main [& args]
  (tawny.owl/save-ontology pizza.pizza/pizza "pizza.omn"))

;;; src/pizza/pizza.clj
(ns pizza.pizza
  (:require [tawny.owl :refer :all]
            [tawny.reasoner :as r]))

(defontology pizza
  :iri "http://mo.com/pizza")
;; And there's classes and stuff below but only things from the Take Wing tutorial

And I had issues loading the generated .omn file in Protege 5.6.4. Here's how I get around it when I generate a file:

## This file was created by Tawny-OWL
## It should not be edited by hand
Prefix: http://www.w3.org/2002/07/owl#: <http://www.purl.org/ontolink/tawny#>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: pizza: <http://mo.com/pizza#>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Prefix: : <http://mo.com/pizza>

Ontology: <http://mo.com/pizza>

Import: <http://www.purl.org/ontolink/tawny>

This chunk gave us some trouble. We had to do a few changes:

Fix 1

Remove

Prefix: http://www.w3.org/2002/07/owl#: <http://www.purl.org/ontolink/tawny#>

And replace in file http://www.w3.org/2002/07/owl# with owl (except for prefix definition)

Fix 2

Remove

Import: <http://www.purl.org/ontolink/tawny>

Link seems dead.

Hopefully it's just something I'm doing wrong, but maybe there's something on your end?