MetaData
<< Add Link Bookmarklet | Cookbook-V1 | PmWiki Watch >>
Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
Goal
The point is to provide Dublin Core (DC) metadata for wiki pages, according to the Dublin Core recommendation for encoding DC metadata in RDF/XML.
[(approve links) edit diff]
It should follow the suggestions for Dublin Core for wikis, as seen here:
http://www.emacswiki.org/cgi-bin/community/DublinCoreForWiki
There's also a variation for Creative Commons (http://creativecommons.org/) metadata, as defined here:
http://creativecommons.org/technology/metadata/implement
Solution
Discussion
This script was developed using PmWiki 1.0.5, but it should work with any 0.6.x or 1.0.x version.
Install
To install, unpack the tarball or zip file, and recursively copy all the contents of the directory it creates to your pmwiki directory:
tar zxvf pmwiki-metadata-0.6.tar.gz cp -R pmwiki-metadata-0.6/* /path/to/pmwiki
Add the following line to your 'local/config.php' file:
include_once('cookbook/metadata.php');
That should probably be enough.
Configuration variables
There are a number of configuration variables to change the output of this script.
- $AboutPage -- this is the page that will be defined for the <dc:publisher> element, if it exists. It defaults to '
$DefaultGroup
.$WikiTitle
'. - $CopyrightPage -- the page that explains the copyright policy for your wiki site. If this is defined and the page exists, it will be used as the URL for the <dc:rights> element.
- $LicenseUrl -- an URL that explains the copyright policy for your wiki site. Use this if you use a well-known content license like the GNU Free Documentation License, a Creative Commons license, or the like.
- $CopyrightText -- some plain text for your copyright policy (like 'Copyright 2004 My Company. All Rights Reserved'). This is only used if the $CopyrightPage is undefined or doesn't exist, and if the $LicenseUrl is undefined.
Note that you really only want to have one of $CopyrightPage or $CopyrightText defined.
- $RdfMimeType -- the MIME type to use for the returned Dublin Core RDF. The recommended MIME type for RDF is 'application/rdf+xml', but some processors (like Web browsers) choke on this. So, the default is to return 'text/xml'.
See Also
[(approve links) edit diff] for implementing Dublin Core in XML.
History
- 22 Mar 2004: 0.1. First release.
- 23 Mar 2004: 0.2. Added Creative Commons metadata, some bug fixes.
- 21 Apr 2004: 0.3. Support GPL and LGPL in Creative Commons code.
- 26 May 2004: 0.4. Support Creative Commons 2.0 licenses, fix some instructions in README.
- 31 May 2004: 0.5. Fixed bug when pagename was blank.
- 20 Jul 2004: 0.6. New layout per ComplexRecipes.
Comments & Bugs
Is there a reason the DublinCore script doesn't include dc:relation and the isPartOf qualifier, with a reference to the $DefaultPage
? Is this perhaps planned as a future extension?
I also want to re-architect the code so it uses [(approve links) edit diff] to build the model and serialize it. That'd separate out the data itself from the presentation. Finally, I'd also like to allow editing of a page's metadata in the page itself, with (say) Notation3.
For example,
%n3% <> dc:summary "This is the page summary." ; dc:subject "RDF", "Metadata", "Extensions" ; rdfs:seeAlso <http://www.w3.org/2000/10/swap/Primer> . %%
Contributors
Copyright
Copyright 2004, Evan Prodromou. Available under the General Public License (GPL). pmwiki-2.3.38 -- Last modified by {{EvanProdromou}}