Help Wikitravel grow by contributing to an article! Learn how.
New users, please see Help or go to the Pub to ask questions.

Wikitravel:15 November 2005

From Wikitravel
Jump to: navigation, search

Complicated esoteric feature to enable better user experience[edit]

So, I've finally rolled out some code for doing in-page Turtle RDF. That may sound like gobbledy-gook, but I believe it's going to be a very useful platform for Wikitravel in the months to come.

The new feature means that users can add new RDF blocks to a page using Turtle, a version of the Notation3 syntax for RDF. Those RDF blocks are normally hidden, but they can be viewed using the Special:Rdf special page.

An example: the following RDF block might be appropriate for inclusion into Montreal.

<rdf>

Montreal dc:spatial place:Montreal .

place:Montreal

  dc:title "Montreal" ; 
  dc:identifier "7013051"^^dc:TGN ; 
  dcterms:isPartOf place:Quebec ;
  pos:lat "45.5" ; pos:long "-73.6" . 
Quebec dc:spatial place:Quebec .

</rdf>

...which, bit by bit, means this ("#" starts a comment):

<rdf>

  1. Wikitravel's "Montreal" article is about a place "Montreal".
Montreal dc:spatial place:Montreal .
  1. That place ...

place:Montreal

  dc:title "Montreal"@en , "Montréal"@fr ; # is called "Montreal" and "Montréal"
  dc:identifier "7013051"^^dc:TGN ; # has Getty Thesaurus ID "7013051"
  dcterms:isPartOf place:Quebec ; # is part of a place called Quebec  
  pos:lat "45.5" ; pos:long "-73.6" . # is at these lat/long coordinates
  1. Wikitravel's "Quebec" article is about a place "Quebec".
Quebec dc:spatial place:Quebec .

</rdf>

Note that these are for various vocabularies (the part before the : in the words); some are standard ones, but one ("place:") is a fake one I made up to represent places, so we can talk about articles and places separately.

Turtle is the Wiki syntax of RDF; it's a lot simpler than RDF/XML, but it's still kind of hard. Also note that template expansion works, so that we could have a [[Template:isIn]] which said:

<rdf>

{{PAGENAME}} dc:spatial place:{{PAGENAME}} .

place:{{PAGENAME}} dcterms:isPartOf place:{{{1}}} .

{{{1}}} dc:spatial place:{{{1}}} .

</rdf>

...and then {{isIn:Quebec}} added to the Montreal page would describe at least part of the geographic hierarchy.

Of course, the question becomes: what use is this and what problems does it solve? In and of itself, it's just interesting data-munging. However, I think it can be used for at least the following purposes:

  • Guiding RDF-enabled Web spiders and robots
  • Building "Bread-crumb" navigation, like "North America > Canada > Quebec > Montreal" .
  • Special presentation for certain kinds of articles (travel topics, itineraries, destination guides) and destinations (cities, countries, regions)
  • Organizing "clusters" of articles automatically (say, if you wanted to download Italy and all cities and regions in that country)
  • Automatic interface with mapping sites like Google Maps or Yahoo Maps.

Anyways, this is what's been going on. Please experiment with this, as I'm very interested in building up useful metadata in an automated way. My next step is to create bread-crumb navigation (with a template and pretty much the RDF laid out above); I hope that's going to be useful. --Evan 19:22, 15 Nov 2005 (EST)

Also note: code is here: http://wikitravel.org/mw-rdf-0.2.tar.gz --Evan 19:27, 15 Nov 2005 (EST)

Variants

Actions

Destination Docents

In other languages