1 Oct 2007 10:29
Embedding SMW-data into XHTML-headers (Was: [Mediawiki-l] Dublin Core metadata?)
On Freitag, 28. September 2007, Sean O'Connor wrote:
> Dan, thanks, I'll look at semantic mediawiki.
>
> > SMW has means of using Dublin Core and any other vocabulary, but it
> > does not embedd the annotations into the XHTML-header (as I know some
> > webpages do with DC).
>
> Markus, that would be a problem for me. Part of the reason I need DC
> on my site is to interact with applications such as Zotero [1],
> allowing researchers to grab bibliography/citation information from
> the page.
It would be possible to make certain properties available in the XHTML header,
but this is clearly not useful for all data SMW collects (this would make the
header really large). So the best solution would probably be an extension to
SMW which "knows" the DC properties and treats them in a special way. We are
planning to put together the infrastructure for adding predefined properties
in extensions more easily, but an ad hoc solution can be done with the
current version already. There might be some performance issues though, since
Meta-tags added to wiki-output are not cached. Should be OK for smaller
wikis.
But anyway, here is a sketch of the solution. Install SMW1.0alpha(SVN) and add
the following to your LocalSettings.php:
$wgHooks['BeforePageDisplay'][] = 'metaTest';
function metaTest(&$out) {
if ($out->isArticle()) {
$page = Title::newFromText($out->getPageTitle());
(Continue reading)
RSS Feed