[ANN] tawny-owl 0.11

190 views
Skip to first unread message

Phillip Lord

unread,
May 22, 2013, 7:41:33 AM5/22/13
to clo...@googlegroups.com

I'm pleased to announce the release of tawny-owl 0.11.

What is it?
==========

This package allows users to construct OWL ontologies in a fully programmatic
environment, namely Clojure. This means the user can take advantage of
programmatic language to automate and abstract the ontology over the
development process; also, rather than requiring the creation of ontology
specific development environments, a normal programming IDE can be used;
finally, a human readable text format means that we can integrate with the
standard tooling for versioning and distributed development.

Changes
=======

# 0.11

## New features

- facts on individual are now supported
- documentation has been greatly extended
- OWL API 3.4.4


A new paper on the motivation and use cases for tawny-owl is also
available at http://www.russet.org.uk/blog/2366

https://github.com/phillord/tawny-owl

Feedback welcome!

atkaaz

unread,
May 22, 2013, 8:06:18 AM5/22/13
to clo...@googlegroups.com
For those who don't know the concepts (aka me) can we get a working example of what can be done ? I'm having a strange feeling that ontologies(although I've never heard the word/idea before except from you) might be something similar to what I am searching for...

Possibly an example that showcases everything that can be done ? though that might be too much to ask, or perhaps suggest a link url to something that might help (me) understand ?

Thanks.


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Andrew Wagner

unread,
May 22, 2013, 8:38:42 AM5/22/13
to clo...@googlegroups.com
I went looking for the same thing. There are a few partial examples in the docs directory that might be worth looking at.

Phillip Lord

unread,
May 22, 2013, 9:24:37 AM5/22/13
to clo...@googlegroups.com


It's a good question; the library is more intended for people who know
ontologies and don't care, or have never heard about, clojure. So the
documentation is biased in that way.

In this setting, an ontology is essentially a set of facts, that you can
test with a computational reasoner; so, it's something like logic
programming. I don't implement the reasoner -- someone else has done
that (in fact there are several). These reasoners can scale up to
100'000s of terms.

My example Pizza ontology shows it in use.

https://github.com/phillord/tawny-pizza

So, you can make statements like

(defclass CheesyPizza
:equivalent
(owland Pizza
(owlsome hasTopping CheeseTopping)))

and

(defclass MozzarellaTopping
:subclass CheeseTopping)

and finally,

(defclass MargheritaPizza
:subclass
(someonly hasTopping CheeseTopping TomatoTopping))

and the reasoner will work out that MargheritaPizza is a CheesyPizza.

In itself, this is simple, but you can build up more complex classes
like so.

(defclass VegetarianPizza
:equivalent
(owland Pizza
(owlnot
(owlsome hasTopping MeatTopping))
(owlnot
(owlsome hasTopping FishTopping))))

(defclass NonVegetarianPizza
:equivalent
(owland Pizza (owlnot VegetarianPizza)))

Of course, really takes flight when you have large ontologies. FMA which
models human anatomy, has I think, about 100,000 terms. SNOMED (ways you
can get ill) has millions.

Now there are lots of tools for building these; the novelty with tawny
is that the "raw" syntax is relatively simple (most of tawny-pizza does
not look like a programming language), but it is entirely programmatic;
so, it is possible to automate, build patterns, and integrate with
external infrastructure all in one place. I think that this is going to
be very useful, but we shall see!

While I am interested in biomedical and scientific ontologies, there are
lots of other applications. Probably the most famous one at the moment
is Siri (the iphone thingy) which is ontological powered underneath.

There are quite a few articles, varying in scope on ontologies on
ontogenesis http://ontogenesis.knowledgeblog.org.

It is a very valid point, though. I should write some documentation on
ontologies for programmers. I shall work on it!

Phil
> --

--
Phillip Lord, Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: philli...@newcastle.ac.uk
School of Computing Science, http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower, skype: russet_apples
Newcastle University, twitter: phillord
NE1 7RU

atkaaz

unread,
May 22, 2013, 9:47:35 AM5/22/13
to clo...@googlegroups.com
Thank you very much for this! I find it very interesting, I shall keep reading

atkaaz

unread,
May 22, 2013, 10:11:36 AM5/22/13
to clo...@googlegroups.com
Would you say that ontologies can be modeled on top of graphs? so in a way they can be seen as a specific use case for graphs? (maybe directed acyclic graphs), that's what I am getting the sense of so far

Jim

unread,
May 22, 2013, 10:33:38 AM5/22/13
to clo...@googlegroups.com
On 22/05/13 15:11, atkaaz wrote:
> Would you say that ontologies can be modeled on top of graphs? so in a
> way they can be seen as a specific use case for graphs? (maybe
> directed acyclic graphs), that's what I am getting the sense of so far

I am certainly not an ontology guru but I can confirm that what you
describe is sort of valid...Ontologies will indeed help you find
predicate-argument structures of the form subject->predicate->object
(i.e "John likes pizza"), but in order to do that you have to build the
domain-specific ontology first! But there is another way to get the same
information via deep-parsing. A syntactic parser like stanford's or enju
will give you back the nodes (tokens) and their dependencies
(relations). You can shove that into a (directed & acyclic) graph
structure and you're ready to query/navigate it as you like...

Jim

Paul Gearon

unread,
May 22, 2013, 12:23:43 PM5/22/13
to clo...@googlegroups.com
On Wed, May 22, 2013 at 9:24 AM, Phillip Lord <philli...@newcastle.ac.uk> wrote:


It's a good question; the library is more intended for people who know
ontologies and don't care, or have never heard about, clojure. So the
documentation is biased in that way.

This message originally confused me. For some reason I found that my email filters had put a message for public-owl-dev into my folder for Clojure emails. It was a pleasant surprise to see that there was no mistake. :-)

I'm wondering about the file formats. I see that RDF/XML (:rdf) and Manchester (:omn) are supported, as well as OWL/XML (:owl - which I don't really know). I don't see Turtle though, which is the main interchange format I try to use. Am I missing it?

Thanks!

Regards,
Paul Gearon

Phillip Lord

unread,
May 22, 2013, 5:09:31 PM5/22/13
to clo...@googlegroups.com
Jim <jimpi...@gmail.com> writes:
> I am certainly not an ontology guru but I can confirm that what you describe
> is sort of valid...Ontologies will indeed help you find predicate-argument
> structures of the form subject->predicate->object (i.e "John likes pizza"),
> but in order to do that you have to build the domain-specific ontology first!
> But there is another way to get the same information via deep-parsing. A
> syntactic parser like stanford's or enju will give you back the nodes (tokens)
> and their dependencies (relations). You can shove that into a (directed &
> acyclic) graph structure and you're ready to query/navigate it as you like...

This breaks down somewhat when you definitions get nasty enough. Take
these two examples: the first says in English

A VeggiePizza is a Pizza,
and not a thing which has at least one MeatTopping
and not a thing which has at least one FishTopping


The second says

A VeggiePizza is a Pizza
which only has a topping which is not
meat or rish


Now, any and only individuals that fulfil the first definition also
fulfil the second: or, alternatively, for any set of individuals we can
think of, these two classes always have the same set.


(defclass VegetarianPizza
:equivalent
(owland Pizza
(owlnot
(owlsome hasTopping MeatTopping))
(owlnot
(owlsome hasTopping FishTopping))))

;; different, but equivalent, definition
(defclass VegetarianPizza2
:equivalent
(owland Pizza
(only hasTopping
(owlnot (owlor MeatTopping FishTopping)))))


Most of the time, the practical upshot of this is that you can ask "give
me all the VegetarianPizza's" and you get an answer.

Pizza's are just a standing example, BTW. I don't know if any one has
ever built an e-commerce site with an ontological backend.

Phil

Phillip Lord

unread,
May 22, 2013, 4:59:19 PM5/22/13
to clo...@googlegroups.com

Ah, now, that is a complicated question with a long history. If I may
duck the question slightly, and just answer about OWL (it's not the only
ontology representation language).

Trivially, of course, the answer is yes. An ontology is representable as
a graph, but then a graph is a rich enough data structure to represent
most things. Some ontologies fall into this category and are explicitly
represented as DAGs; the Gene Ontology is my favourite example of this.

OWL has a more complex semantics, so representation as a graph is a bit
limiting; the formal, underlying semantics are either (a subset of)
first-order logic, or alternatively a set theoretic equivalent.

Trivially, for instance, with OWL you can distinguish between

some hasTopping MozzarellaTopping
only hasTopping MozzarellaTopping

(a thing that has at least one topping which is a MozzarellaTopping, and
a thing which can have any number of toppings including none, but all of
which are MozzarellaToppings). As you build up the complexity the graph
representation becomes unwieldy.

Having said all of that, you can represent structurally simple
ontologies in OWL, by only using a defined subset of the language. Tawny
uses the underlying java libraries to check this is happening correctly.

I should give a simple example; think of a library classification --
"science->biology->botany". This is a simple ontology. The SI system of
units is another, rather different one.

I realise that the barrier to entry for this is all quite high; it's one
of the reasons I created (and others wrote)
http://ontogenesis.knowledgeblog.org. Ontologies are currently still
what I would class as a research area; they are used in specialist areas
of (mostly) scientific development. Perhaps with tools like tawny, we
can widen this somewhat.

Phil

Phillip Lord

unread,
May 22, 2013, 5:16:06 PM5/22/13
to clo...@googlegroups.com
Paul Gearon <gea...@ieee.org> writes:

> On Wed, May 22, 2013 at 9:24 AM, Phillip Lord
> <philli...@newcastle.ac.uk>wrote:
>>
>>
>> It's a good question; the library is more intended for people who know
>> ontologies and don't care, or have never heard about, clojure. So the
>> documentation is biased in that way.
>>
>
> This message originally confused me. For some reason I found that my email
> filters had put a message for public-owl-dev into my folder for Clojure
> emails. It was a pleasant surprise to see that there was no mistake. :-)

It can be strange when different worlds collide. I keep on seeing people
here I know from my life as a minor Emacs hacker.


> I'm wondering about the file formats. I see that RDF/XML (:rdf) and
> Manchester (:omn) are supported, as well as OWL/XML (:owl - which I don't
> really know). I don't see Turtle though, which is the main interchange
> format I try to use. Am I missing it?

Yeah, that should work. Underneath, most of this is driven by the OWL
API. So as well as a keywords which I added for the lazy (that is, me),
you can pass an OWL API OntologyFormat object. So:

(save-ontology "pizza.turtle"
(org.coode.owlapi.turtle.TurtleOntologyFormat.))


does the job. For me, :omn is the nicest to read; tawny's syntax looks
similar, which is not an accident.

I'll add a keyword shortcut for the next release. I should have just
done all the known ones; like I say, lazy.

Phil

Rich Morin

unread,
May 22, 2013, 7:44:01 PM5/22/13
to clo...@googlegroups.com
On May 22, 2013, at 04:41, Phillip Lord wrote:
> I'm pleased to announce the release of tawny-owl 0.11.
>
> What is it?
> ==========
>
> This package allows users to construct OWL ontologies ...

Not surprisingly, most Clojurists are not familiar with ontologies
in general or OWL ontologies in particular. This is a large topic
area; this is a modest effort to provide background information.

-r


The word "ontology" is used in two different (though related) ways.
The historic meaning is mostly helpful as background:

Ontology ... is the philosophical study of the nature of being,
becoming, existence, or reality, as well as the basic categories
of being and their relations. Traditionally listed as a part of
the major branch of philosophy known as metaphysics, ontology
deals with questions concerning what entities exist or can be
said to exist, and how such entities can be grouped, related
within a hierarchy, and subdivided according to similarities
and differences.

-- http://en.wikipedia.org/wiki/Ontology


Computer-based ontologies (eg, OWL ontologies) are sets of facts
and rules about items in the domain of discourse:

In computer science and information science, an ontology formally
represents knowledge as a set of concepts within a domain, and
the relationships between pairs of concepts. It can be used to
model a domain and support reasoning about concepts.

-- http://en.wikipedia.org/wiki/Ontology_(information_science)

These facts and rules can allow programs to make inferences and
can also be used to establish a controlled vocabulary (allowing
human conversations to avoid ambiguity and confusion).


OWL ontologies are typically constructed as "is a" hierarchies
describing categories (eg, Thing > Food > Pizza). An item can
be placed in multiple categories (eg, Thing > Product > Pizza)
and relations (eg, Pizza goesWith Beer) are added to link them.
So, the ontology is really more of a directed graph than a tree.

OWL (Web Ontology Language) is a product of the Semantic Web
effort. It is generally used with technologies such as RDF
(Resource Description Framework), RDFS (RDF Schema), SPARQL,
and RDF Triplestores.

So, for example, someone might set up an RDF Triplestore with
a large number of facts about (say) medicine. RDFS and OWL
could be used to provide a framework for reasoning about these
facts. A query language (eg, SPARQL) could then be used to
answer questions.


Here are some relevant links, as starting points:

http://en.wikipedia.org/wiki/RDF_Schema
http://en.wikipedia.org/wiki/Resource_Description_Framework
http://en.wikipedia.org/wiki/Semantic_Web
http://en.wikipedia.org/wiki/SPARQL
http://en.wikipedia.org/wiki/Triplestore
http://en.wikipedia.org/wiki/Web_Ontology_Language
http://www.w3.org/TR/owl2-overview/


I also recommend these books, which include programmer-friendly
introductions to this area.

"Learning SPARQL"
Bob DuCharme

"Semantic Web for the Working Ontologist"
Dean Allemang, Jim Hendler

--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


Phillip Lord

unread,
May 23, 2013, 3:07:50 AM5/23/13
to clo...@googlegroups.com

Thank you for adding this. I've added some text to my README, so that
the next release will have more information. As I have said, in another
reply, Clojure developers are not my primary audience; this seems like a
reasonable excuse for early versions, but is much less plausible now I
approach a 1.0 release.

Phil
Reply all
Reply to author
Forward
0 new messages