Synopsis
MaRDI uses a knowledge graph to store items and their connections to other items. The rendering of an item is quite technical in a kind of tabular form (see e.g. this item). To make displaying an item more informative, we are creating explicit wiki-pages for each item based on so called templates. Users should only use these created wiki-pages to work with the portal. A template controls how properties of an item are shown in a (hopefully) visually appealing way (e.g. like this see here for the same example. We are using different templates for different item types, such as persons, publications or datasets. This document describes how to use and create templates.
Main Idea
- To connect an item to a template, the item needs to have the property MaRDI profile type (P1460) which specifies the type (e.g. publication) and needs to have a value from the list below (e.g. Q5976449 for the publication template - so: TEMPLATE_NAME = Publication).
- There is a generation script (see below) that does the following things:
- For each item where P1460 is set, a Wiki page with the name TEMPLATE_NAME:ITEMID is created (e.g. Publication:650331). The ITEMID is the actual QID (e.g. Q650331) of the item without the "Q".
- The content of that new wiki page is set to {{TEMPLATE_NAME}}. This means that the wiki page will use the given template to render the page content.
- Connect the (internal) item page with the generated wiki-page. Manually, this can be done on the item page (e.g. this item). Scroll down to the very bottom until you see a gray box "Mathematics". Hit "edit", type "mardi" in the left gray input box (which is prefilled with "wiki"). Then, write the name of the newly create wiki-page in the right gray input box (e.g. "Publication:3420082"). Click on the entry with the same name in the appearing drop-down list. Hit "save". Now you can purge the wiki-data page to show the result.
Template Types
We have the following profiles type available, which are instances of MaRDI profile type (Q5976451):
These types are:
Automatic Generation Script
As seen above, each profile type is assigned a matching namespace with the same name. To (re-)create the wiki-pages for a particular profile type (=namespace) automatically (and create the connection between the wiki-page and the item), run this script on the main MaRDI server (here: mardi02):
mardi02:~/portal-compose$ docker compose exec -T wikibase /var/www/html/w/maintenance/run /var/www/html/w/extensions/MathSearch/maintenance/ProfilePages create <namespace>
Add a new profile type
- Create a template. This is a normal wiki-page with the prefix "Template". For a template for a person, you can create a wiki-page called "Template:Person" (this of course already exists, see Template:Person).
- Create profile item. Create a new item that is a subclass of MaRDI profile type and an instance of MaRDI-specific concept and set the label and name accordingly as shown in this example.
- Create a namespace in mardi_namespaces.php.
- Create a config entry in LocalSettings
$wgMathProfileQIdMap['namespace']='profileItem'; // examples $wgMathProfileQIdMap['person']='Q5976445'; $wgMathProfileQIdMap['software']='Q5976450';
- Add SPARQL query if necessary, also in LocalSettings
$wgMathProfileQueries['namespace']='query'; // example $wgMathProfileQueries['dataset']='?item wdt:P1460 wd:Q5984635';
To do
Create new profile types
- Profile types for
- journals
- ticket
- potential starting point: Journal of Statistical Software (Q57539)
- datasets
- events
- theorems
- conjectures
- lemmas
- proofs
- topics
- perhaps separately for
- zbMATH
- MSC
- arXiv
- perhaps separately for
- journals
- external knowledge graphs
Modify existing profile types
- dataset
- Add a URL pointing to the dataset
Improve documentation
This refers to the profile-specific templates and modules as well as to help pages.
- All profile types