Configuration - NatLibFi/Skosmos GitHub Wiki
Introduction
Skosmos is configured using a file called config.ttl
. Further customization can be done using .inc
files, see below.
You can start by copying config.ttl.dist to config.ttl:
cp config.ttl.dist config.ttl
The config.ttl
file consists of two sections: global configuration and vocabulary-specific configuration.
Global configuration
The global gonfiguration settings, usually set at the top of the config.ttl
file, affect the entire Skosmos installation. The global configuration is set using properties for an instance of the skosmos:Configuration
class.
Property | Required? | Description | Default value if not set |
---|---|---|---|
skosmos:sparqlEndpoint | optional | The default SPARQL endpoint URL | Value of SKOSMOS_SPARQL_ENDPOINT environment variable or <http://localhost:3030/ds/sparql> |
skosmos:sparqlDialect | optional | Default SPARQL query dialect, or "Generic" for plain SPARQL 1.1. Set to "JenaText" instead if you use Fuseki with the Apache Jena text index. | Generic |
skosmos:sparqlCollationEnabled | optional | Use Jena 3.4.0+ collation support to ensure that alphabetical index is in natural sort order for the language. | false |
skosmos:sparqlTimeout | optional | SPARQL request timeout in seconds. | 20 |
skosmos:httpTimeout | optional | External HTTP request timeout in seconds. | 5 |
skosmos:serviceName | optional | The service name displayed in the page titles. | "Skosmos" |
skosmos:serviceNameLong | optional | Long version of the service name displayed in the title of the landing page. May be given in different languages using language tags. If not set, skosmos:serviceName will be used as a fallback. New in 2.18. |
(unset) |
skosmos:serviceDescription | optional | Description of the service included in the HTML metadata of the landing page, used for social media sharing and SEO. May be given in different languages using language tags. New in 2.18. | (unset) |
skosmos:aboutDescription | optional | Description of the about page included in the HTML metadata, used for social media sharing and SEO. May be given in different languages using language tags. New in 2.18. | (unset) |
skosmos:feedbackDescription | optional | Description of the feedback page included in the HTML metadata, used for social media sharing and SEO. May be given in different languages using language tags. New in 2.18. | (unset) |
skosmos:baseHref | optional | Base URL of the installation, when running behind a ReverseProxy | (unset) |
skosmos:languages | optional | List of available user interface languages. | ( [ rdfs:label "en"; rdf:value "en_GB.utf8" ] ) |
skosmos:searchResultSize | optional | The number of search results to display per page | 20 |
skosmos:transitiveLimit | optional | How many items (maximum) to retrieve in transitive property queries. | 1000 |
skosmos:logCaughtExceptions | optional | Whether or not to log caught exceptions to the PHP error_log (usually Apache error.log). | false |
skosmos:logBrowserConsole | optional | Whether to log SPARQL queries to the browser JavaScript console. | false |
skosmos:logFileName | optional | Full path to file where to log SPARQL queries. | (unset) |
skosmos:templateCache | optional | Defines a location where Twig caches its rendered templates. Avoid using the same location for different Skosmos instances! | "/tmp/skosmos-template-cache" |
skosmos:customCss | optional | Customize the Skosmos CSS by adding a path to your own stylesheet here, eg. "resource/css/custom.css" |
(unset) |
skosmos:feedbackAddress | optional | Default email address where the feedback form sends the messages. | (unset) |
skosmos:feedbackSender | optional | Email address to set as the sender for the feedback messages. | (unset) |
skosmos:feedbackEnvelopeSender | optional | Email address to set as the envelope sender for the feedback messages. | (unset) |
skosmos:uiLanguageDropdown | optional | Whether to display the UI language selection as a dropdown. This can be useful if you have more than 3 user interface languages. | false |
skosmos:uiHoneypotEnabled | optional | Whether to include a more advanced honeypot in the feedback form. Should help with spam bots. Can be disabled in case of problems. | true |
skosmos:uiHoneypotTime | optional | Customize the minimum time that needs to pass before the feedback form is submitted. Default value of 5 seconds should be fast enough for real users. | 5 |
skosmos:globalPlugins | optional | List of global Plugins to enable | () |
Namespace prefixes
Skosmos uses the config.ttl
namespace prefixes when serializing RDF data. Some of the prefixes come from easyrdf and some are hard-coded in Skosmos. You can add more prefixes in the config.ttl
if you want them to be used. Finally, namespace prefixes are also generated from the local names of the URI of each vocabulary resource defined in config.ttl
. The only exception is downloading whole vocabularies as RDF data when a download link is configured - in these cases, the prefixes and RDF data come directly from the vocabulary file determined by the void:dataDump
property.
Namespaces are read in a specific order where the first occurrence of a NS declaration stays in effect:
- Prefixes that come from easyrdf
- Prefixes hard-coded in Skosmos GlobalConfig
- Prefixes set in
config.ttl
- Prefixes generated from the local names of each vocabulary resource
Vocabulary-specific configuration
The remainder of the config.ttl
file lists all the vocabularies. It also contains a small SKOS classification that defines the categories shown on the front page of Skosmos.
Each vocabulary is expressed as a skosmos:Vocabulary instance (subclass of void:Dataset). The localname of the instance determines the vocabulary identifier used within Skosmos (e.g. as part of URLs). The vocabulary instance may have the following properties:
Property | Required? | Description | Default value if not set |
---|---|---|---|
dc:subject | optional | Category of vocabulary (see below) | If not set, the vocabulary is not shown in the vocabulary list on the front page |
dc:title | required | Title of vocabulary (in different languages) | (unset) |
dc:description | optional | Descrioption of vocabulary (in different languages), used in HTML metadata on the vocabulary home page. | (unset) |
skosmos:language | required | Language(s) that the vocabulary supports. | (array) |
void:sparqlEndpoint | optional | URI of the SPARQL endpoint containing this vocabulary | If not set, the global default SPARQL endpoint will be used. |
void:uriSpace | required | The URI namespace for vocabulary objects. | (unset) |
skosmos:alphabeticalListQualifier | optional | Enables you to prepend preferred labels in alphabetical listing with qualifier values determined by the qualifier, e.g., skos:notation or skos:broader . Useful in classification systems. Note that qualifiers with single values are supported as you will get duplicate rows otherwise. (New in 2.4) |
(unset) |
skosmos:arrayClass | optional | Class of resources to display as arrays (subdivisions) of sibling concepts. Typical values are skos:Collection or isothes:ThesaurusArray. | (unset) |
skosmos:defaultLanguage | optional | Default language of the vocabulary. If the vocabulary supports multiple languages, this property is required. | If not set, the default language is the same as the value of skosmos:language . |
skosmos:explicitLanguageTags | optional | Set to true if you want Skosmos to always show language tags next to concept labels, even if they are in the current UI language. (New in 0.7) | false |
skosmos:fallbackLanguages | optional | Enables you to configure the order of languages used as a fallback when no label is found for a concept in the desired content language. The order is expressed as an ordered collection where the highest priority comes first e.g. ( "en" "fr" "de" ). (New in 2.0) | (unset) |
skosmos:feedbackRecipient | optional | If you want to direct the vocabulary specific feedback to an another e-mail adress enter it here. The default feedback recipient will also get a copy even if this has been set. | (unset) |
skosmos:fullAlphabeticalIndex | optional | If the vocabulary is relatively small (eg. 100 concepts) you can show the alphabetical index with all the concepts instead of showing only the concepts of one letter at a time. | false |
skosmos:groupClass | optional | Class of resources to display as concept groups. Typical values are skos:Collection or isothes:ConceptGroup. | (unset) |
skosmos:hasMultiLingualProperty | optional | Properties to be displayed with all language labels available. Typical values are skos:scopeNote and skos:definition . (New in 1.2) |
(unset) |
skosmos:loadExternalResources | optional | Set to false if you do not want Skosmos to query the mapping concept URIs for labels if they haven't been found at the configured SPARQL endpoint. (New in 0.7) | true |
skosmos:mainConceptScheme | optional | URI of the main skos:ConceptScheme instance of this vocabulary. Should be specified if the vocabulary contains multiple skos:ConceptScheme instances. | (unset) |
skosmos:marcSourceCode | optional | Enables you to set the MARC source code(s) for each language e.g. "yso/fin"@fi or "ysa" (New in 2.2) | (unset) |
skosmos:propertyOrder | optional | Set the order of properties on the concept and search result pages. See [Setting the property order]] for details. (New in 2.7) ](/NatLibFi/Skosmos/wiki/An-array-with-default-values-mentioned-here:-[[Setting-the-property-order) | |
skosmos:searchByNotation | optional | When set to true the scope of the search includes skos:notation codess in this vocabulary. N.B. The values of the notation property should be indexed in jena text if the global SPARQL dialect is set as "JenaText" (New in 2.4) | false |
skosmos:shortName | optional | Short name for the vocabulary, to display in the UI when there's not enough room for the full name. (New in 0.5, language codes added in 0.6) | Derived from the localname of the URI |
skosmos:showAlphabeticalIndex | optional | Set to false if you want to hide the alphabetical index tab from the sidebar. | true |
skosmos:showChangeList | optional | If the vocabulary concepts include timestamps (dc:created) you can choose to display the newest concept listing as a tab in the sidebar. (New in 1.4) | false |
skosmos:showDeprecatedChanges | optional | When set to true, shows deprecated concepts in the newest concepts sidebar tab. Requires skosmos:showChangeList set to true in order to show the newest concepts tab. (New in 2.13) | false |
skosmos:showDeprecated | optional | Set to true if you want deprecated concepts to be shown in alphabetical listing, hierarchical tree and full-text search results. See the data model page for more information. (New in 1.10) | false |
skosmos:showNotation | optional | Set to false if you do not want Skosmos to show notation codes (skos:notation) alongside concept labels. (New in 1.7) | true |
skosmos:showNotationAsProperty | optional | Set to false if you do not want Skosmos to show notation codes (skos:notation) and its optional datatype label in the properties on the concept page. (New in 2.12) | true |
skosmos:showPropertyInSearch | optional | Enables you to configure additional concept properties to be shown on the search results page e.g. skos:note, skos:broadMatch etc. | (unset) |
skosmos:showStatistics | optional | Set to false if you don't want Skosmos to show concept and label counts on the vocabulary home page - for large vocabularies they can be slow. (New in 1.5) | true |
skosmos:showTopConcepts | optional | Set to true if you want to enable the Hierarchy tab showing top-level concepts on the vocabulary home page. | false |
skosmos:sortByNotation | optional | Sort the concepts in the hierarchy display and on the concept page (e.g. narrower and related concepts) by their notation codes instead of their labels. Possible values are "lexical" (lexical sort order, e.g. "10" < "2" < "21") and "natural" (natural sort order, e.g. "2" < "10" < "21"). Setting this to true is interpreted as "lexical". (New in 2.12; in earlier versions, only true and false values are supported) | false |
skosmos:sparqlGraph | optional | Named graph within SPARQL endpoint containing the data for this vocabulary. | If not set, the default graph will be used. |
skosmos:useParamPlugin | optional | Enables you to activate a separately configured plugin (New in 2.5) | (unset) |
skosmos:usePlugin | optional | Activates a plugin for the vocabulary | (unset) |
skosmos:vocabularyPlugins | optional | Activates multiple plugins for the vocabulary (New in 2.13) | (unset) |
void:dataDump | optional | URL from where the vocabulary data will be downloaded (to be shown as a link on the vocabulary home page). As of Skosmos 0.7, you can specify both Turtle and RDF/XML download URLs as separate values | Skosmos will recognize the file extension from the URL (.ttl and .rdf) and show appropriate links. As of Skosmos 2.2, MARCXML is supported. In case of multilingual vocabularies, you may set the following triples dc:format "application/marcxml+xml" |
skosmos:conceptSchemesInHierarchy | optional | Boolean option to view multiple concept schemes in the same vocabulary's hierarchy tree | false |
skosmos:defaultSidebarView | optional | String option to open a specific tab on the side bar when loading the vocabulary page. 'group' 'hierarchy', 'new' and 'alphabetical' | 'alphabetical' |
skosmos:externalProperty | optional | A property URI or an array of property URIs to show links to external resources for the concepts in this vocabulary | (unset) |
skosmos:hierarchyProperty | optional | A property URI or an array of property URIs used for visualizing concept hierarchies | skos:broader |
skosmos:indexShowClass | optional | A property URI or an array of property URIs used to show in the alphabetical index and in the label statistics for the vocabulary page | (unset) |
skosmos:propertyLabelOverride | optional | Option for overriding the header labels displayed for concept properties in Skosmos concept info page. The object value is a blankNodePropertyList in the following format: [ skosmos:property <property uri to be overridden> ; rdfs:label "Label override for this property"@UiLang ; rdfs:comment "New tooltip text"@UiLang ] Can be used for overriding either the header label, or the tooltip text, or both. (New in 2.13) |
(unset) |
skosmos:sparqlDialect | optional | 'JenaText' or 'Generic' implementation used in the fuseki sparql endpoint | If not set, the global sparqlDialect setting will be used. |
skosmos:useModifiedDate | optional | Boolean whether to use Last-Modified header information and send HTTP 304 responses for the browser for subsequent requests | false |
In addition to vocabularies, the config.ttl
file also contains a classification for the vocabularies expressed as SKOS. The categorization is used to group the vocabularies shown in the front page. Currently, only a flat list of categories is supported. Each category should be a skos:Concept and should have a skos:prefLabel
property in all the UI languages configued for Skosmos.
about.inc
This file, found under the view
directory, can be used to set the text shown on the About page. It is interpreted as a Twig template.
footer.inc
This file, found under the view
directory, is intended for adding JavaScript tracking code (e.g. Google Analytics or Piwik) for all HTML pages. It is interpreted as a Twig template.
left.inc and right.inc
These files, under the view
directory, can be used to add additional boxes on the front page. They are interpreted as Twig templates. See left.inc.dist
for an example.
custom-favicon.ico
If you put a favicon with this filename in the root folder of the Skosmos install, it will be used instead of the default Skosmos favicon. (Skosmos 1.4+)