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. I (User:Duesentrieb) am working on this together with User:Evan. There's a sample implementation at http://wikitravel.org/~evan/mw-rdf-0.3.tar.gz, which is in production on Wikitravel (see WikiTravel:Wikitravel:RDF).

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 User: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 User: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