This project is not covered by Drupal’s security advisory policy.
Browse, search and publish SKOS thesauri and controlled vocabularies that are
stored in a SPARQL triple store, inside a Drupal 11 site. A Drupal port of
Skosmos (based on v3.6).
- Pages: landing page, vocabulary home with statistics, concept pages,
hierarchy / A-Z / groups / new-concepts browsing, search with suggestions. - A JSON REST API modelled on the Skosmos REST API (a subset, see below).
- Not tied to any vocabulary: every vocabulary is a configuration entity that
you create in the UI and that can be exported with the configuration system.
Requirements
- Drupal 11, PHP 8.3.
- A SPARQL 1.1 endpoint: Apache Jena Fuseki (with a jena-text index) or
Virtuoso. No extra Composer packages are needed.
Configuration
Everything is configured in the UI under Configuration > Web services >
Skosmos (/admin/config/services/skosmos) and is stored as exportable
configuration (skosmos.settings, skosmos.vocabulary.*).
Settings: base path of the public pages (default skosmos), default
timeout and cache lifetime, page size, landing page text.
Vocabularies (one config entity each):
| Setting | Meaning |
|---|---|
| Triple store | Apache Jena Fuseki or Virtuoso. Selects the SPARQL dialect automatically. |
| SPARQL endpoint | Query endpoint URL, e.g. http://localhost:3030/skosmos/sparql or http://localhost:8890/sparql. |
| Named graph | Graph holding the vocabulary. Empty = the endpoint's default graph. |
| Languages / default language | Content languages offered in the UI. |
| Concept scheme, group class | Optional. Where the hierarchy starts, and which classes are groups. |
| Timeout, cache lifetime | Optional per-vocabulary overrides. |
The vocabulary form has a Test connection button.
Grant the permission Browse Skosmos vocabularies to the roles that may use
the pages and the API; Administer Skosmos to site builders.
URLs (base path skosmos)
/skosmoslanding page,/skosmos/search?q=search all vocabularies/skosmos/{vocabulary}vocabulary home/skosmos/{vocabulary}/page?uri={concept URI}&clang={language}concept page/skosmos/{vocabulary}/search?q=search one vocabulary
REST API (/skosmos/rest/v1/...)
vocabularies, and per vocabulary {id}/info, search?query=&lang=&type=&scheme=&parent=&group=&maxhits=&offset=,
topConcepts, narrower?uri=, broader?uri=, hierarchy?uri=, index and
index/{letter}, groups, groupMembers?uri=, new, modified, data?uri=,
label?uri=, labelStatistics, vocabularyStatistics.
JSON shapes follow Skosmos where practical, but data is plain JSON, not JSON-LD.
SPARQL dialects
GenericSparql (SPARQL 1.1, FILTER based label matching) is the base class.
Dialects are plugins in src/Plugin/SkosmosSparql (attribute #[SparqlDialect]);
their IDs are the "Triple store" options.
JenaTextSparql(fuseki): label search withtext:query(Lucene), as in
Skosmos'JenaTextSparql.VirtuosoSparql(virtuoso): label search withbif:contains. Limits that
the class works around by falling back to FILTER matching: a wildcard needs
at least 4 leading characters, leading wildcards (*land) and exact matches
are not supported by the full-text index.
To add a triple store, extend GenericSparql and override searchCondition().
Virtuoso performance note
Virtuoso's full-text index is global, not per graph. On an endpoint with large
unrelated graphs, a very frequent search stem can be slow because the index is
consulted before the graph restriction. See VirtuosoSparql for how the query
is shaped; keep the "Named graph" set so queries stay restricted.
Tests
tests/src/Unit/SparqlDialectTest.php covers the query generation of the
dialects (run with PHPUnit from a Drupal development install).
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Content display
- Created by asanchez75 on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
