Wikitravel's guides and other articles have great user-contributed text and pictures meant for human beings to read and understand. Our wiki technique lets us describe people, places, languages, attractions, destinations, temples, routes, museums, restaurants, hotels and thousands of other kinds of things with prose and pictures.

But there are also a lot of things that can be said about people, places, and things that we want computers to understand. To make machine-readable descriptions, we use a tool called the Resource Description Framework or RDF. This document describes briefly what RDF is and how it works for Wikitravel.

What is RDF?編集

RDF is a framework for making statements about resources. Statements are in the form:

subject predicate object

Here, "subject" is a "resource" such as a person, place, idea, Web page, picture, concept, or whatever. "Predicates" are names of properties of a resource, like its color, shape, texture, size, history, or relationships to other "resources". The object is the value of the property. So "car color red" would be a statement about a car; "Evan isFatherOf Amita" would be a statement about a person and his relationship to another person.

Of course, it's important to be definite about which resources and which properties we're discussing. In the Web world, each "resource" is identified with a URI (usually an URL).

For electronic resources, this is usually pretty easy; the main page of English-language Wikipedia, for example, has the URI "". However, for analog subjects like people or ideas or physical objects, this can be a little trickier.

There's no general solution, but the typical workaround is to use real or made-up URIs to "stand in" for offline entities. For example, to identify User:Evan, you could use the URI for his Wikitravel user page, "". Or you could use his email address in URI form, like "mailto:[email protected]".

People who need to agree on statements often create 'vocabularies' or 'schemas' that map concepts, object, and relationships to URIs. By popularizing such a mapping, we can all agree about what a particular URI "means".

For example, the Dublin Core Metadata Initiative (DCMI) has a schema for very simple metadata, such as you'd find on a library card. They've defined (among other things), that the idea of authoring or creating something is represented by the URL So you could say: mailto:[email protected]

... means that the creator of the Free Software Foundation is Richard Stallman.

There are a lot of RDF models out there; you can also create your own if you want.

RDF statements can be encoded in a number of different ways. By far the most popular is as XML, sometimes called "RDF/XML". "Turtle" is another format, which uses plain text rather than XML; and "Ntriples" is still another.

Getting RDF from Wikitravel編集

It's possible to retrieve RDF statements about articles and related resource from the Wikitravel server. The Special:Rdf lets you choose which article you're interested in, and what kinds of data to retrieve. Many interesting bits of information about pages -- history, contributors, licenses, links -- can be read in RDF-encoded format.

The RDF for a page is also linked (invisibly) from each page, in a <link> tag in the headers for the page. Although this is invisible to human readers, some browser tools and Web spiders can read and understand the encoded RDF information.

Adding RDF to Wikitravel pages編集

It's also possible to add RDF statements to Wikitravel pages through the regular editing process. RDF statements -- or groups of statements -- are written between tags in the source of the page. RDF statements in these blocks should be encoded in Turtle RDF format -- an easy-to-use format that mirrors English syntax.

RDF that's stored in the page can be retrieved using the "in-page" model on the Special:Rdf page.

Possible uses for RDF on Wikitravel編集

Wikitravel's use of RDF for in-page data is in its very earliest of infancies, and there's a lot of room for experimentation. Some possible internal uses:

  • License info. Adding multi-licensing information using "cc:licence".
  • Noting that a Wikitravel article is derived from another article on the Web (like the CIA Factbook, say) and information about who wrote it.
  • Listing related articles; articles about similar places, linking destinations with the phrasebook for the language spoken there, linking itineraries to a destination guide
  • Describing places (cities, countries, regions) and their geographical relationships to each other (nearby cities, bordering countries, ...)
  • Article status
  • Geo-spatial lat/long information, including GPS data (See Wikitravel:Geocoding)
  • Building "Bread-crumb" navigation, like "North America > Canada > Quebec > Montreal" (See Wikitravel:Breadcrumb navigation) .
  • 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.

There is an RDF Expedition about the uses for RDF on Wikitravel. Join the expedition if you are interested in more details.

RDF and templates編集

Although it's pretty simple to use, the syntax for Turtle RDF might be daunting for people who just want to tag an article with a little information. To make it simpler, it's possible to create Mediawiki templates that encapsulate the RDF into an easy-to-use form. For example:

  • Template:IsIn contains RDF that says the destination described in the current guide "is in" another place. For example, {{IsIn|Veneto}}, added to the Venice page, says that Venice is in the Veneto region of Italy. This data will be used to build up breadcrumb navigation links.
  • Template:Geo contains RDF to say that the destination described by the current guide has given lat/long coordinates. This is used for geocoding.

See also: Wikitravel:RDF templates

External links編集

RDF and its uses are a complicated issue. These are some useful links for learning more.