Extension:Semantic Calendar

'''

Description
Semantic Calendar is an extension to MediaWiki that displays a monthly calendar displaying pages by their semantic date information. The heart of the extension is a parser function, #semantic_calendar, that displays a calendar on a page, with links to navigate backwards and forwards through time. The parser function takes as an input the name of the semantic property used for the date, as well as an optional set of semantic queries that can be used to filter the set of events. By default, the calendar displays the current month initially.

This extension requires the presence of Semantic MediaWiki, and preferably SMW 1.0 or later. It will work with previous versions of SMW, but not as well.

Also, it is important to note that this extension requires that caching be disabled in the wiki. You must disable caching for the extension to work. You can see the simple instructions for doing so here.

Code and download
You can download the Semantic Calendar code in either one of these two compressed files:


 * semantic_calendar_0.1.tar.gz
 * semantic_calendar_0.1.zip

You can also download the code directly via SVN from the MediaWiki source code repository, at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticCalendar/. From a command line, you can call the following:

To view the code online, including version history for each file, you can go here.

Installation
After you've obtained a 'SemanticCalendar' directory (either by extracting a compressed file or downloading via SVN), place this directory within the main MediaWiki 'extensions' directory. Then, in the file ' LocalSettings.php' in the main MediaWiki directory, add the following line somewhere below the calls for the Semantic MediaWiki extension (both the main 'include_once' line and the 'enableSemantics' line):

Languages supported
Semantic Calendar supports English and Dutch.

Authors
Semantic Calendar was written by Yaron Koren, reachable at yaron57 -at- gmail.com.

Version
Semantic Calendar is currently at version 0.1.

Code structure
The following are the directories and files in the Semantic Calendar extension:

/includes


 * SC_ParserFunctions.php - defines the parser function, '#semantic_calendar', used for the extension
 * SC_GlobalFunctions.php - functions and constants used by the rest of the Semantic Calendar code
 * SC_Settings.php - various settings for Semantic Calendar

/languages


 * SC_Language.php - parent class for all language files
 * SC_LanguageEn.php - English-language text

/skins


 * SC_main.css - main CSS file for Semantic Calendar

Creating calendars
To display a calendar on a page, showing all events that have a date represented by the property "Has date", add the following to the page:

Note that you can replace "Has date" with whatever property name you use.

You can also add a set of queries to filter the events being displayed; the query format used is the same as that used for Semantic MediaWiki's "ask" inline queries. For example, to display only those events that also belong to a category called "Corporate events" and have a value of "High" for a property called "Has priority", you can use the following call:

You can also display multiple sets of data on the same calendar, by separating the different date properties, and their corresponding sets of filter queries, with semicolons. There should be the same number of date properties and filter-query sets. For instance, here is how to get a calendar to display both the data from above, and the set of events of category "Projects", by their deadline:

Sites that use Semantic Calendar
Here are some sites that use Semantic Calendar in conjunction with Semantic MediaWiki:


 * Discourse DB (view calendar)
 * Region 3 Levees Wiki (view calendar)

Bugs and feature requests
Send any bug reports and requests to Yaron Koren, at yaron57 -at- gmail.com.

Contributing patches to the project
If you found some bug and fixed it, or if you wrote code for a new feature, please create a patch by going to the main "SemanticCalendar" directory, and typing:

svn diff >descriptivename.patch

Then send this patch, with a description, to Yaron Koren.

Translating
Translation of Semantic Drilldown is done through Betawiki. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on Betawiki, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.