Category Archives: RDF

http://www.w3.org/RDF/
skos:related http://crschmidt.net/blog/archives/author/crschmidt/skos.rdf#c8 RDF

SKOS Output from WordPress

Waiting for the bus to the medieval banquet at Dunguaire Castle for the FOAF Galway Workshop (photos), I remembered I had tweaked the FOAF Output Plugin to also output SKOS concepts — and possibly mappings to others’ categories.

Get it before your neighbour, the FOAF Output Plugin, version 1.11 — the Galway Release…

See also the SKOS development toolshed.

In passing, being here in Galway/Ireland is great, not only do I get to meet a lot of smart and interesting people, very much like at FOAF Camp, I also get to add another country to my list of visits

WordPress Plugin: seeAlso’s

What is now several weeks ago, Christoph Görn hacked a bit on my FOAF Output plugin, and asked for seeAlso links to be included. Short of the mythical WordPress triple store (factory?) I couldn’t see a better way to do it than building on the concept from the Semantic Visits add-on: Using the link manager.

I challenged Danny Ayers to write the plugin/add-on, but he’s been busy lately, with the RSS book and all, so here it is, the seeAlso’s Plugin (view source). While I was at it, I also fixed a few buglets in the FOAF Output Plugin and added trust ratings for friends and bio:olb.

The current version is 1.0 (this blog entry will serve as a changelog).

Continue reading WordPress Plugin: seeAlso’s

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.

“They Rule” as RDF

Yesterday Dan Brickley reported success on getting Josh On to release “They Rule” data. This has been a somewhat long standing goal for the FOAFCorp effort, and According to Josh, who created it, the data is free.

Dan asked for conversion into RDF/XML, so here it is — created by theyrule2ntriples.pl, which was inspired by Dan’s own scripts from last year: “They Rule” 2004 as RDF/XML (gzipped, 175k) or “They Rule” 2004 as NTriples (gzipped, 168k)

I’m sure Jim Ley will have this loaded into foafnaut before long, for everyone to browse…

Concise Bounded Resource Descriptions in Redland/MySQL

While I’m not sure about the merits of the entire URIQA proposal by Patrick Stickler, it does introduce the very nice concept of CBD‘s.

The concept is similar to — actually a superset of — FOAF’s notion of minimally identifying set of properties, the set of properties for a person that is needed to identify, display and get more information about the person, usually including a name (or nickname), at least one inverse functional property and a link, rdfs:seeAlso.

For this reason, and a few others, I decided to implement this in Redland and the Redland/MySQL storage engine as a method for the Model “class”, librdf_model_cbd_as_stream. Since I wanted to leave it up to each storage implementation how to implement it, it turned out to require quite a few source file changes, but I will be handing them over to Dave Beckett for inclusion in the next version of Redland if he sees it fit.

The definition of CBD is recursive, as for each bnode object the statements where it appears as a subject must be included in the result and so on, but implementing infinite recursive queries in SQL is impossible. To overcome this issue, I decided to go with the following algorithm (node is the input resource for which a CBD is wanted):

list of nodes = (node)
count of nodes = 1
REPEAT
  last count of nodes = count of nodes
  list of nodes = SQL(bnodes objects of statements with subject in list of nodes) + node
  count of nodes = COUNT(list of nodes)
UNTIL count of nodes = last count of nodes
RETURN statements with subject in list of nodes

The SQL generated for the query for bnode objects looks like this (operating on the most recent Redland/MySQL storage engine database schema):

select distinct ID
from Statements join Bnodes on Object=ID
where Subject=7972813756443468730 or Subject=10313337636846108089

While the algorithm works, and doesn’t put too much strain on the connection between the client and server, it does require at least one extraneous query, since the loop ends when two subsequent queries yield the same result. Hints on improving this will be much appreciated.

Please note that I have left out step 3 of the CBD definition, the reification part. This is mostly due to the reason that I don’t work with reification in my models, but also because I don’t see reification in the RDF sense to be of much use in practical implementations.

Also, in contrast to the CBD definition, this algorithm and implementation allows for CBDs for bnodes, not just URIs.