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 "http://en.wikipedia.org/wiki/Main_Page". 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, "http://wikitravel.org/en/User:Evan". 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 http://purl.org/dc/elements/1.1/creator. So you could say:
http://www.fsf.org http://purl.org/dc/elements/1.1/creator 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:
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:
See also: Wikitravel:RDF templates
RDF and its uses are a complicated issue. These are some useful links for learning more.