Skip to content
Henri Ylikotila edited this page Sep 15, 2015 · 38 revisions

How to publish a new vocabulary with Skosmos, or update an existing one

Introduction

Vocabularies are managed in the RDF store accessed by Skosmos via SPARQL. The available vocabularies are configured in the vocabularies.ttl file.

Managing vocabulary data

Providing vocabularies as SKOS

The vocabulary needs to be expressed using SKOS in order to publish it via Skosmos. It is recommended that you preprocess your vocabularies using the Skosify tool. This will ensure, e.g., that the broader/narrower relations work in both directions and related relationships are symmetric. Also Skosify will report and try to correct lots of potential problems in SKOS vocabularies. It may also be used to convert non-SKOS RDF data into SKOS. See the Skosify wiki for details.

See the Data model page for more information about what is and isn't supported by Skosmos.

Putting vocabularies into the RDF store

How to get your vocabulary into the RDF store depends on the store you use. Many RDF stores nowadays support the SPARQL HTTP Graph Store protocol. If you use Jena Fuseki, you can use the SPARQL over HTTP tools such as s-put that come with the Fuseki distribution.

Example of adding a vocabulary into a specific named graph in Fuseki via s-put:

s-put http://localhost:3030/dataset http://example/my-vocabulary vocabulary.ttl

Vocabulary configuration: vocabularies.ttl

The vocabularies to show in Skosmos are configured in the file `vocabularies.ttl` which is an RDF file in Turtle syntax. You can copy the `vocabularies.ttl.dist` file as your starting point, as it contains many examples of vocabularies.

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
dc:title required Title of vocabulary (in different languages)
dc:subject required Category of vocabulary (see below)
void:uriSpace required The URI namespace for vocabulary objects. These may not overlap.
skosmos:language required Language(s) that the vocabulary supports.
skosmos:defaultLanguage optional Default language of the vocabulary. If the vocabulary supports multiple languages, this property is required.
void:sparqlEndpoint required URI of the SPARQL endpoint containing this vocabulary
skosmos:shortName optional Short name for the vocabulary, to display in the UI when there's not enough room for the full name. If not set, the vocabulary id (derived from the localname of the URI) will be used. (New in 0.5, language codes added in 0.6)
skosmos:sparqlGraph optional Named graph within SPARQL endpoint containing the data for this vocabulary. If not specified, the default graph is used.
void:dataDump optional URL 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.
skosmos:mainConceptScheme optional URI of the main skos:ConceptScheme instance of this vocabulary. Should be specified if the vocabulary contains multiple skos:ConceptScheme instances.
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.
skosmos:showTopConcepts optional Set to true if you want to enable the Hierarchy tab showing top-level concepts on the vocabulary home page.
skosmos:groupClass optional Class of resources to display as concept groups. Typical values are skos:Collection or isothes:ConceptGroup.
skosmos:arrayClass optional Class of resources to display as arrays (subdivisions) of sibling concepts. Typical values are skos:Collection or isothes:ThesaurusArray.
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)
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)
skosmos:hasMultilingualProperty optional  Property to be displayed with all language labels available. Typical values are skos:scopeNote and skos:definition. (New in 1.2)

In addition to vocabularies, the vocabularies.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 languages supported by Skosmos.