Configuring Vocabularies (II)

Create custom query patterns

The query patterns can be managed in the Mappings tab of the admin pages.

Query patterns

The Vocabulary Control module comes with some predefined query patterns:

  • SKOS prefLabel: captures the prefered label modelled as skos:prefLabel
  • SKOS altLabel: captures the alternative label modelled as skos:altLabel
  • SKOS broader: captures the broader entry modelled as skos:broader
  • SKOS narrower: captures the narrower entry modelled as skos:narrower
  • WGS84 Lat: captures the latitude of the place, etc. modelled with the WGS84 vocabulary
  • WGS84 Long: the same for longitude

You may define custom query patterns by filling in the last row. The pattern must be a valid SPARQL GroupGraphPattern pattern with at least variables ?source and ?target. ?source identifies the entry, ?target the value or the refered entry. With the Regex field you may specify a regular expression to extract and retrieve only a part of the original value: If defined, the regular expression will be applied to the value of ?target and only the matching part is returned. For example, if a data source stores latitude and longitude together in one literal, separated by ";", you may define two query patterns, both with the same SPARQL patterns (and thus retrieveing the same value) but with different Regex'es: .+(?=;) for latitude and (?<=;).+ for longitude. The regular expressions follow PHP preg_* modalities.
The query pattern will be added when clicking on the Save button.

Displaying a map along a data record or in the infobox

If a group provides geo-coordinates (latitude + longitude), WissKI can show a map based on those coordinates. The map is computed by a static tile server like the one Google or OpenStreetMap provide. Further the map may be backed with a link to a dynamic map.

To include such a map, your group needs to provide two fields, one for latitude, one for longitude. Create a local vocabulary for the group (Site configuration -> WissKI module settings -> Vocabulary control -> Add). When specifying the field mappings, choose the appropriate paths for the predefined fields "latitude" and "longitude" (see here).

To show the map along the data record, you need to position the Block "Vocabulary Information" (Site buildung -> Blocks) on your page, e.g. on the "Left" region. Then configure the block and enable the fields "Latitude", "Longitude", and "A Google Map". Optionally, you may wish to disable other fields or to rearrange them.

To show the map in the infobox, go to the Infobox tab on the vocabulary control admin page. Set the options as for the block. Further down the page, you may also adjust the URLs for map creation.

Advanced Indexing

Since 23.01.2013 (GitHub 4a2246a17a) the tab Advanced Indexing provides cron-triggered vocabulary indexing.
As the normal indexing methods can lead to complications when indexing big vocabularies, use advanced indexing to better control the indexing process. Note that only vocabularies can be indexed this way that have indexing enabled and automatic re-indexing disabled! Vocabularies backed on the local accesspoint are thus excluded!

Indexing is done by creating an indexing task for a specific vocabulary. The task is run at creation (optionally) and each time cron is triggered. (See here for how to set up cron.) If there are multiple active tasks, only one is executed on each cron run. On each run, the task will index at max a given number of instances in the vocabulary.

On the tab, a list of active and terminated tasks shows their current status.

Creating an indexing task

You can create a new indexing task by clicking on the collapsed frame Add indexing task. Fill out the form and click the button Add indexing task.

You can specify the following parameters:

  • Vocabulary: the vocabulary that shall be indexed.
  • Limit per run: the maximum number of instances that get indexed per step/cron run. Depending on the endpoint's performance and server timeout settings this value may be increased or decreased. The default value of 2000 should work well in every case, although with big vocabularies it may take some time till indexing is finished.
  • Run immediately: Number of times the task is run directly after creation. Can be used if you don't want to wait for cron to run. Usually you should choose 0 (wait for cron) or 1 (do one run now, leave all others to cron).
  • Disable timeout: Disable the PHP execution timeout. Note that depending on your server's configuration, changing the timeout may not be allowed.

Currently a task will always index the fields Label and Alternate Label. Note that fields are indexed subsequently, not in parallel. I.e. Indexing of Alternate labels is done after indexing of Labels.

Further troubleshooting

  • If you still experience timeouts, also try to change the timeout option for the accesspoint.
  • If the browser presents a blank page or reports a timeout after creating a task, this does not necessarily mean, the task failed. Reload the page after a reasonable amount of time (depending on the limit you set few minutes till one hour) and check the status list if the task ran successfully.