Archive for April, 2005

Apr 20 2005

Subtext

Published by Ian Davis under Uncategorized

I took a look at the subtext programming language. There’s a nice screencast which demonstrates why subtext is so different from conventional programming languages.

The key is that although Subtext is a functional language, it has no syntax! Programming is performed via the editor manipulating the data structures using primative operations such as copy and link. The linking is important. Rather than using a tree of operations, Subtext maintains a graph of interlinked functions. In a neat, prolog sort of way, the program you write is always live: results of functions are calculated as you edit the program.

Subtext is cool but ‘out there’ somewhere. It got me thinking about the nature of syntax in programming though, specifically around refactoring. The goal of refactoring is to “improve the design of a program without changing behaviour”. But in a system like Subtext, where you directly manipulate the behaviour: refactoring is impossible. To me, this implies that refactoring is an artifact of syntax. In fact it may just be an artifact of procedural and object oriented syntaxes. I wonder if anyone is busy refactoring in functional languages?

Comments Off

Apr 18 2005

Who Should You Vote For?

Published by Ian Davis under Uncategorized

Saw this first over at Leigh’s blog. Here’s my equivalent, which is exactly in line. Unfortunately I can’t vote Green since they’re not fielding a candidate in my constituency this time round. I voted Labour last time and regret it for so, many reasons.

Labour -24
Conservative -15
Liberal Democrat 30
UK Independence Party 0
Green 38

You should vote: Green

The Green Party, which is of course strong on environmental issues, takes a strong position on welfare issues, but was firmly against the war in Iraq. Other key concerns are cannabis, where the party takes a liberal line, and foxhunting, which unsurprisingly the Greens are firmly against.

Take the test at Who Should You Vote For

Comments Off

Apr 10 2005

Unique Name Assumption

Published by Ian Davis under Uncategorized

My son told me a riddle this morning that is a perfect illustration of the unique name assumption:

Two sons and two fathers went to a pizza restaurant. They ordered three pizzas. When they came, everyone had a whole pizza. How can that be?

I thought it was going to be a pun on the word whole, but it turned out to have a much better answer. I assumed that two sons and two fathers meant that there were four people. Of course there were only three: a grandfather, a father and a son.

This is something to watch out for when using OWL to represent a problem. OWL assumes non-unique names whereas in real life most people expect named things to be distinct. To model that assumption in OWL you have to explictly make owl:differentFrom assertions.

Comments Off

Apr 05 2005

Refactoring Bio With Einstein Part 1: First Steps

Published by Ian Davis under Uncategorized

I’m going to try to describe the life of Albert Einstein using the BIO vocabulary. I’m expecting this to be quite difficult but hopefully should understand better where the vocabulary is deficient. I’m keen to examine how ordering of events can be achieved using OWL-Time and I’d like to be able to enhance the BIO vocabulary to make expressing common biographical information easy.

I’m basing this micro-project on the Wikipedia biography of Einstein. That work is licensed under the GNU Free Documentation License and so I’m putting this article and associated RDF data under the same license.

Why Einstein? I chose Einstein because, being a former phycisist, I have an admiration for him and his theories. He is a popular icon, is the subject of dozens of biographies and, having lived in the modern era, there are photographs and movies that could also be relevant.

This exercise will use a combination of the BIO, FOAF and OWL-Time vocabularies. I’ll use the namespace prefixes bio, foaf and time for these.

My approach is to follow the Wikipedia article and translate each distinct event into RDF.

According to the article introduction, Einstein was born on March 14, 1879. A few paragraphs down is the following:

Einstein was born at Ulm in Württemberg, Germany; about 100 km east of Stuttgart. His parents were Hermann Einstein, a featherbed salesman who later ran an electrochemical works, and Pauline, whose maiden name was Koch. They were married in Stuttgart-Bad Cannstatt. The family was Jewish (and non-observant); Albert attended a Catholic elementary school and, at the insistence of his mother, was given violin lessons.

Here’s a skeleton document to start off:

<foaf:Person rdf:nodeID="albert">
  <foaf:name>Albert Einstein</foaf:name>

  <bio:event>

    <bio:Birth rdf:nodeID="albert-birth">
     <rdfs:label>The birth of Albert Einstein</rdfs:label>
     <bio:date>1879-03-14</bio:date>
     <bio:place>Ulm, Württemberg, Germany</bio:place>
    </bio:Birth>

  </bio:event>

</foaf:Person>

That’s a bit dry. I’m not expressing any of the relationship information from the original article. Here’s what it could look like if I used the Relationship vocabulary:

<foaf:Person rdf:nodeID="albert">
  <foaf:name>Albert Einstein</foaf:name>

  <rel:childOf>
    <foaf:Person rdf:nodeID="hermann">
      <foaf:name>Hermann Einstein</foaf:name>
      <rel:fatherOf rdf:nodeID="albert" />
      <rel:spouseOf rdf:nodeID="pauline" />

    </foaf:Person>
  </rel:childOf>

  <rel:childOf>
    <foaf:Person rdf:nodeID="pauline">
      <foaf:name>Pauline Einstein</foaf:name>

      <rel:motherOf rdf:nodeID="albert" />
      <rel:spouseOf rdf:nodeID="hermann" />
    </foaf:Person>
  </rel:childOf>

  <bio:event>
    <bio:Birth rdf:nodeID="albert-birth">

     <bio:date>1879-03-14</bio:date>
     <bio:place>Ulm, Württemberg, Germany</bio:place>
    </bio:Birth>
  </bio:event>

</foaf:Person>

However, the problem is that the relationship vocabulary assumes a fixed point in time, whereas the bio vocabulary attempts to express different states across a period of time. Some relationships are immutable throughout time, e.g. childOf, whereas others apply for definite periods, e.g. spouseOf. One interpretation is to assume that the relationships hold for at least some period of time but it is not safe to use them for analysis of time-sensitive data. In other words you can ask “were these two people ever married” but you cannot ask “were the parents of this person married when he was born?”

It would be possible to use a modified relationship schema where the domain of the properties is some kind of “Person At Point In Time” but that feels unnatural. A better way, in my opinion, is to explicitly represent the marriage as a time interval. I can’t use the bio:Marriage class because that represents the actual marriage ceremony, instead I need to use an general Event instance:

<bio:Event rdf:nodeID="hermann-and-pauline-being-married">
  <rdfs:label>The event of Hermann and Pauline being married</rdfs:label>
</bio:Event >

In the BIO vocabulary Event is defined as “A general event, i.e. something that the person participated in.” - it can be any episode with a duration. I can also relate this event to Hermann and Pauline’s marriage:

  <foaf:Person rdf:nodeID="hermann">
    <foaf:name>Hermann Einstein</foaf:name>
    <bio:event>
      <bio:Marriage rdf:nodeID="hermann-and-pauline-marriage">

        <rdfs:label>The marriage of Hermman Einstein and Pauline Koch</rdfs:label>
        <bio:place>Stuttgart-Bad Cannstatt</bio:place>
        <time:intMeets rdf:nodeID="hermann-and-pauline-being-married" />
      </bio:Marriage>
    </bio:event>

    <bio:event rdf:nodeID="hermann-and-pauline-being-married" />
  </foaf:Person>

  <foaf:Person rdf:nodeID="pauline">
    <foaf:name>Pauline Einstein</foaf:name>
    <bio:event rdf:nodeID="hermann-and-pauline-marriage" />

    <bio:event rdf:nodeID="hermann-and-pauline-being-married" />
  </foaf:Person>

The intMeets property says that the married interval starts directly after the marriage event. I’ve also associated the event of being married with each person so they are explicitly participating in the event.

I can enrich the structure of the biography by asserting that Albert was born during his parent’s marriage. It seems to me that it should be possible to derive this fact, but until I understand more about this I need to state it explicitly can do this on the married interval:

<bio:Event rdf:nodeID="hermann-and-pauline-being-married">
  <rdfs:label>The time during which Hermann and Pauline were married</rdfs:label>
  <time:intContains rdf:nodeID="albert-birth" />

</bio:Event>

or, equivilently, in the Birth event itself:

<bio:event>
  <bio:Birth rdf:nodeID="albert-birth">
   <rdfs:label>The birth of Albert Einstein</rdfs:label>
   <bio:date>1879-03-14</bio:date>

   <bio:place>Ulm, Württemberg, Germany</bio:place>
   <time:intDuring rdf:nodeID="hermann-and-pauline-being-married" />
  </bio:Birth>
</bio:event>

The Wikipedia article mentioned that Albert attended a Catholic elementary school and took violin lessons. I’m going to express those as events:

<bio:event>

  <bio:Event rdf:nodeID="albert-attending-elementary-school">
    <rdfs:label>The event of Albert attending elementary school</rdfs:label>
    <time:intAfter rdf:nodeID="albert-birth" />
  </bio:Event>
</bio:event>

<bio:event>

  <bio:Event rdf:nodeID="albert-taking-violin-lessons">
    <rdfs:label>The event of Albert taking violin lessons</rdfs:label>
    <time:intAfter rdf:nodeID="albert-birth" />
  </bio:Event >
</bio:event>

So, what have I been able to represent from that single paragraph of biography? I’ve represented Albert Einstein’s date and place of birth; his parent’s marriage and the fact that Albert was born during the marriage; Albert attending elementary school and taking violin lessons. Each of the events is related to another event to assist with automatic ordering.

What haven’t I represented? His father’s occupation; his mother’s maiden name; the family’s faith. I haven’t explictly stated that Albert is the son of Hermann and Pauline and their participation in the marriage event isn’t strong enough to state that they were actually the couple getting married (other people can participate such as a minister or witnesses). Also the events have no colour - I have dry labels describing the mechanics of the event, but nothing with personality.

I need to be able to annotate events and provide commentary. I need also to be able to resolve the roles of participants in events. I’ll be thinking about those issues for part two.

Here’s an RDF file that collates what I’ve done so far and graphical representation of the graph.

11 responses so far

Apr 05 2005

OWL-Time Properties

Published by Ian Davis under Uncategorized

Following on from my recent diagram of the OWL-Time ontology, here’s one depicting some of the properties defined in the ontology and how they relate to instants and intervals:

Depiction of some properties relating to instants and intervals in the OWL-Time ontology

I don’t think it’s as clear as the previous one so here’s the key: t1, t2 and t3 are instants in time, P1, P2, P3, P4 are proper intervals. The blue arrows represent properties, the tails are attached to the subjects of the properties and the heads to the values. Read the first arrow at the top as the triple _:t1 :before _:t2 .

By the way both these images (1 and 2) are in the public domain so if you find them useful please take them.

2 responses so far

Apr 05 2005

Fried == Bad

Published by Ian Davis under Uncategorized

This is probably enough to tempt me back to Moveable Type. That and the little voice that keeps telling me that Aaron is still right

One response so far

Apr 04 2005

OWL-Time Ontology

Published by Ian Davis under Uncategorized

I’ve been examining the OWL-Time ontology, which is a successor to the earlier DAML-Time work. To help understand the ontology I drew this diagram:

A diagram of the OWL-Time ontology showing sub-class relationships

The arrows represent sub-classing: the arrowhead points to the superclass.

2 responses so far

Apr 01 2005

VANN Vocabulary Update

Published by Ian Davis under Uncategorized

See if I can still remember how to work this weblog thingamajig… :)

I’ve just updated the VANN vocabulary. This is little RDF vocabulary for making annotations on RDF schemas. I use it on vocab.org to annotate the vocabularies with usage notes, examples etc. VANN now validates as OWL Lite whereas before it was OWL Full, primarily due to laziness on my part. OWL Lite is the most restrictive of the OWL flavours and it means that vocabularies that import VANN won’t be importing OWL Full dependencies.

This change was prompted by the new OWL Time work. I’ve been waiting for a revision to the old DAML-Time ontology for both PlaceTime and the BIO vocabulary. I want to make BIO OWL DL compliant if possible, hence the update to VANN, which BIO uses.

Watch this space for some thoughts on where BIO will be going in the future.

Comments Off