Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing anonymous ontologies #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cordawyn
Copy link

Hi!

I made a few adjustments to the ontology printers – specifically, I added a check for "anonymous" ontologies (w/o ontology URIs) that will make the printer output a blank string instead of crashing ;)

(Also, leiningen was complaining about non-HTTPs URI for the repo – I changed that to "https" in project.clj).

@phillord
Copy link
Owner

Out of curiosity, how are you making an anonymous ontology? I don't think tawny supports it (perhaps it should).

@cordawyn
Copy link
Author

I've been trying to add a few ontologies to the ontology manager as follows:

(.loadOntologyFromOntologyDocument
  (tawny.owl/owl-ontology-manager)
  (tawny.owl/iri (clojure.java.io/resource "ontology.ttl")))

... which seems to work, but produces an anonymous ontology 😄

@cordawyn
Copy link
Author

cordawyn commented Apr 16, 2019

That said, I'm getting the feeling that tawny may not be the right tool for me, as I've been struggling to make it work with a combination of "external" ontologies and ontologies defined with tawny DSL... I find myself making too many raw Java method calls, not so many Clojure's.

@phillord
Copy link
Owner

tawny.repl/load-ontology does that. I mostly do this where I want to work with an ontology interactively. Other wise, if you want to cross refer to lots of entities in the external ontology, using tawny.read/defread is the way to go. If you don't, then you can just use an owl-import with the IRI which should work.

@phillord
Copy link
Owner

Are you sure that ontology.ttl has a declared IRI in it? That might well be the problem. Consider:

user> (def sio (load-ontology (iri (clojure.java.io/resource "sio.owl"))))
Started Loading: #object[com.google.common.base.Absent 0x61a016a7 Optional.absent()]  from: #[iri file:/home/phillord/src/knowledge/tawny-owl-git/master/dev-resources/sio.owl]
Finished Loading: #object[com.google.common.base.Present 0x49c5da59 Optional.of(http://semanticscience.org/ontology/sio.owl)] ...succeeded
#'user/sio
user> (as-iri sio)
#[iri http://semanticscience.org/ontology/sio.owl]
user> (as-iri sio)
#[iri http://semanticscience.org/ontology/sio.owl]

This should work if you run a repl directly in a clone of the tawny-owl repo.

Still, either way, you are correct, it should print nicely.

@cordawyn
Copy link
Author

Are you sure that ontology.ttl has a declared IRI in it? That might well be the problem.

Yes, that might be the problem, indeed. But I have a bunch of those, and there can be a random SKOS vocabulary or some "snippets", that don't necessarily have an ontology IRI.

Thanks for the hints about tawny API – I somehow missed those functions from the start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants