In my last few posts (1, 2), I followed my readers' advice and have been reviewing the book "Programming the Semantic Web" published by O'Reilly. The full reference is below:
"Programming the Semantic Web by Toby Segaran, Colin Evans, and Jamie Taylor. Copyright 2009 Toby Segaran, Colin Evans, and Jamie Taylor, 978-0-596-15381-6."
Now we pick up at chapter 6 which deals with ontologies, which is the reason I starting working through this book. So without further ado, lets jump back in:
"The Web Ontology Language (OWL) is an RDF language developed by the W3C for defining classes and properties, and also for enabling more powerful reasoning and inference over relationships." (page 135)
The chapter explains the main classes on OWL. owl:Thing is a superclass for every other class (page 136), like 'Object' in Python new class syntax. The chapter also outlines owl:Class, owl
atatypeProperty, owl:ObjectProperty and rdf:XMLLiteral which you might be able to figure out from the names.
The chapter then outlines the following properties: rdf:type, rdfs:subClassOf, rdfs:domain and rdfs:range. Then on pages 137-140, the chapter defines a schema for films in OWL using RDFLib. The book is worth it just for this.
Using this schema we record the information that Harrison Ford played Rick Deckard in Blade Runner, directed by Ridley Scott. I have made a visualisation of that using GraphViz (as introduced in a previous chapter), you can download the image here and examine it on whatever image viewer your computer has. What a lot of noise for those few simple facts! But that is what it takes to get the applications to understand the semantics.
The chapter then moves to look at the GUI programme Protégé. I have already been introduced to this by Peter who is a big fan. Protege (I am bored with the accents already) is a Java program, so it will run fine on any system with Java (i.e. almost all of them). The chapter works through the GUI features of Protege in a matter of fact way, building up an ontology.
The approach the chapter outlines is to develop your ontology using Protege and then load the data using scripts and programs rather than using the GUI. On page 145, the chapter loads the ontology created using Protege into RDFLib by creating an instance of the ConjunctiveGraph class and then using the 'load' method.
Going back to the post before I started working through this book, namely Headfirst into the Semantic Web, this what seemed to be a simple approach to the work I need to do. However, there are many other packages outlined later in the book so I may change my mind.
On pages 146-147, the chapter goes back to some OWL theory, looking at 'Functional and Inverse Functional Properties', 'Inverse Properties' and 'Disjoint Classes'. The chapter then points out some ontologies available online that are worth examining (pages 148-149). Lastly the chapter then works through an ontology for beer (pages 149-151), an appropriate place to end, I might grab a cold ale myself.
<p>Wow, I see what you mean by noise. I guess you need a lot of tool support to event think about building ontologies like that...</p>
<p>Trying to program human knowledge into computers looks pretty tricky <img src="/static/forum/img/smilies/smile.png"></p>