Category Archives: Vocabularies

Semantic Web terms

42

According to The Hitchhiker’s Guide to the Galaxy (which is still on my to-read list), “42” is The Answer to Life, the Universe, and Everything. However, I think there may be an exception when it comes to the question about httpRange-14, a long debated issue in web circles (see also http-range-14 no comment).

Earlier today, the Semantic Web Best Practices and Deployment Working Group sent word to the TAG, that it has resolved that an http URI without a hash MAY be used to identify an RDF property. Thus, we may have a partial answer to httpRange-14, one that isn’t “42”, but one that doesn’t answer other questions (not including “Life, the Universe, and Everything”).

I think the conclusion by the SWBPD WG is sound — while in an ideal world it could be useful to know just by looking at a URI whether it identified a document or something else, it isn’t strictly necessary. Sure, it might help a human out now and then, but in the long run, the machines will be doing the analyzing part, and according to the TAG’s finding on what URIs identify, URIs are opaque. It all comes down to semantics assigned by humans.

At the same time, it is often practical and useful to use fragment identifiers for RDF vocabulary terms, so wording that uses “MAY” is perfect in my book — even if it doesn’t answer or solve everything…

Visit Revisited

A few days ago, Norman Walsh was kind enough to let me know that there was something wrong with the way I had put together the visit vocabulary.

It turned out that I had mixed together some URIs while surfing around the DAML vocabularies, and the URIs I used to identify each of the states were wrong — the right ontology is http://www.daml.ri.cmu.edu/ont/USRegionState.daml.

The visit vocabulary has been updated to reflect this, and the WordPress plugin Semantic Visits has been fixed, you should upgrade if at all possible.

In addition to the fixes, it has been clarified that the right ISO 3166 country code for the United Kingdom is “GB”. This warranted a fix (or more precisely an addition) in the image generation code at MyWorld66, and Douwe Osinga was quick to respond — it now accepts “GB” as well as “UK” (for backwards compatibility reasons only, use “GB” from now on), thanks!

While I was twiddling, I added support for Canadian provinces — also supported by MyWorld66’s Visited Canadian Provinces and a DAML ontology for Canadian States and Teritories, for those that have had the privilege of visiting those parts of the world.

This last part turned out to be a little harder than expected, as the Canadian regions are divided into states and territories, and that required some investigations into OWL — I think I got it right, but if not you’ll likely see yet another correction soon…

Also, it turned out that there was an issue with the terms used to indicate the code, name, and other state properties — the terms are defined in the general DAML State Ontology as e.g. http://www.daml.ri.cmu.edu/ont/State.daml#code, but in the DAML US Region and State Ontology and the DAML ontology for Canadian States and Teritories they are used as e.g. http://www.daml.ri.cmu.edu/ont/CanadianState.daml#code.

I’m still not sure whether the error is because of a typo with regards to the default namespace declaration, or if it’s a misunderstanding of the semantics of owl:imports (actually daml:imports). In any case, I have decided not to propagate the error, so the WordPress Plugin and the vocabulary documentation uses the properties that are defined — but not used until now.

WordPress Plugin: Semantic Visits

When I came back from Madrid, after the Image Decription workshop, a few days in the city, and a hefty party in Getafe, I realised I could add another country to my list of visits.

The nice folks at World66 have created a nice interface for generating an image with visited countries highlighted, but while it would be easy to check a few boxes and copy the code to somewhere on my blog pages, that wouldn’t make it possible for the semantic web to figure out where I’ve been. For that reason, I decided to mint a set of vocabulary terms for visits according to Norm Walsh’s country counting rules, collected in the visit vocabulary, and have WordPress output the information in my FOAF profile – thanks to the extensibility of my FOAF Output Plugin. Of course, the FOAF Explorer now also understands these terms, displaying maps of the world, Canada and USA when appropriate — see for yourself!

Thus, here is a new plugin, the Semantic Visits Plugin (view source).

The current version is 1.1.

Changes since 1.0:
  • Added visits to Canadian regions.
  • Fixed “wrong” code/name/etc. properties.
  • The URIs for US states are now correct, pointing at the http://www.daml.ri.cmu.edu/ont/USRegionState.daml ontology containing state definitions instead of http://www.daml.ri.cmu.edu/ont/State.daml which only contains classes and properties.

Continue reading WordPress Plugin: Semantic Visits

Label Vocabulary in Spanish

The Label vocabulary now also contains labels in Spanish.

{Leandro Mariano López}, the master behind inkelog and the Speaks, Reads and Writes Schema, stepped up to plate last night and sent me a translation of the terms and comments – thanks!

That of course meant that I had to make it possible to navigate between the different language versions, and tweak the content negotiation a bit.

The owl2html XSLT is now up to version 0.2, and a new small tool has seen the light of day: rdf-path.

It’s a simple Perl script with an XPath interface to an RDF/XML document, with a bunch of prefixes and namespaces predeclared. It’s simple to the point of triviality, but does its job well, in this case extracting a list of available languages for an ontology, to automate the generation of HTML pages:

#!/bin/bash
base=http://purl.org/net/vocab`/bin/pwd|sed -e 's/^.*web//'`/
for lang in `rdf-path "/*/*[rdf:type[@rdf:resource='http://www.w3.org/2002/07/owl#Ontology']]/rdfs:comment/@xml:lang" $1.rdf`; do
  owl2html $1.rdf uri $base$1# lang $lang css "http://www.wasab.dk/morten/2004/06/owl2html.css" > $1.$lang.html 
done

Additional translations are of course more than welcome.

Transforming RDF/XML with XSLT

A couple of months ago, while working on a project that will hopefully see the light of day soon, I realised I needed terms for singular and plural labels for properties and classes. Even with the help of SchemaWeb I couldn’t find existing terms, so I decided to cook my own, resulting in the label vocabulary with two properties:

plural
A relation between a term and its label in literal plural form.
singular
A relation between a term and its label in literal singular form.

This was not the only vocabulary I was working on at that moment, and I needed to be able to get an overview, a human-readable version. Last year I did the RDFS Explorer for basically the same purpose, but since I was entering OWL territory, it wasn’t really up to the task. Back to square one.

Continue reading Transforming RDF/XML with XSLT