Extension:Rdf

This page is about an effort to provide an extensive RDF interface for MediaWiki. The idea is to create a flexible framework that goes beyond the ability of the code described at RDF metadata. There's an implementation by Evan Prodromou (see infobox), which is in production on Wikitravel (see WikiTravel:Wikitravel:RDF). The design arose from some discussions in 2005, mainly between Evan Prodromou and User:Duesentrieb.

Installation

 * 1) Download the files from SVN
 * 2) Place the downloaded files under extensions folder in your MediaWiki installation
 * 3) Add  into your wiki's LocalSettings.php
 * 4) The extension should be active now.

NOTE: Below is a copy of the original conceptual draft, it may not accurately describe the actual implementation by Evan!

Scope
The idea is to provide a way to query different kinds of information about a wiki page in RDF format. This may include
 * basic metadata as defined by the Dublin Core standard and/or the Creative Commons project.
 * List of all authors
 * List of all links to and from a page
 * List of keywords (Categories for a page)
 * List of members of a category
 * ...and a plugin interface for more.

Also, the RDF could be deliver in different notations, like
 * RDF/XML
 * N-Triple
 * Turtle
 * ..and maybe others.

This will probably implemented as an extension that provides a special page which, wehn called without parameters, would present a form where the user can specify what data is wanted in what format.

Another possible feature would be to allow users to add custom RDF information on any page, in Turtle format, in a ... block

Implementation
The implementation will probably be based on the RAP framework.

core
The core function will take a list of "models", i.e. datasets wanted, and return a RAP model which can then be serialized to create the actual output.

Here is the code for that function, as suggested by Evan:

$wgModelFunctions may be changed to contain a human readable description of the data set in addition to the function name. This would be displayed on the query form where the user can choose the data sets.

some example functions
Here's an example function for creating Dublin Core base data (code suggested by Evan):

Example function for listing all links from a page (also suggested by User:Evan):

It may however be better to have a more generic function that allows to build such a list directly from an SQL query. This would make it very easy to add new datasets.

custom RDF
Function for building a model from custum RDF stuff on the wiki page:

the code on the wiki page would use Turtle notation. The example below says that some of the text of the page was copied from another Wikipedia article, and that another part of the page was copied from some other random URL.

Links

 * RAP Homepage
 * Tutle Spec
 * Dublin Core Terms
 * Dublin Core Metadata
 * SKOS spec
 * EXIF RDF spec
 * Usemod: RdfForWikis
 * Wikipedia³ - a conversion of the English Wikipedia into RDF
 * DBPedia - Semantic information from wikipedia linked to other databases on the Semantic Web