Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

MaastrichtUniversity/islandora_ontology_autocomplete

Repository files navigation

Islandora Ontology Autocomplete

Provides an ontology autocomplete for Islandora XML forms using EBI's Ontology Lookup Service (OLS). Islandora XML forms is a Drupal based extension to Fedora Core.

Screenshots

Search for ontology terms ols-1

Both the preferred label and the ontology URI is shown. Both are available to be inserted in the XML output of Islandora XML forms. ols-2

Installation

  • Download the zip file from the release page.
  • Unpack it in the sites/all/modules/contrib directory.
  • Enable the module on the Administration -> Module page of Drupal.

Alternatively, you can download directly from the source repository. You need to use bower to get all Javascript dependencies. Like this:

cd sites/all/modules/contrib
git clone https://github.com/MaastrichtUniversity/islandora_ontology_autocomplete.git
cd islandora_ontology_autocomplete
bower install

Configuration

By default the public version of OLS is used. You can set your own by setting the OLS_URL environment variable in PHP. You can for example run this Dockerized version of OLS with your own ontologies.

Basic

Make a field with type ontology_autocomplete. Add a field under it with type hidden called ontologyLabel. And add a field with type textfield called ontologyId. The ontologyId field you can best set to readonly=readonly in the HTML options. The field names ontologyLabel and ontologyId are fixed.

ols-3

The field ontologyLabel will contain the preferred label of the ontology class. It is available to the XML output by setting the CRUD fields.

The field ontologyId will contain the ontology class URI. It is also available to the XML.

ols-4

Limit to specific ontology or super class of ontology

You can limit to a specific ontology or even a super class of an ontology by setting the childrenOf or ontology option on the User Data options of the ontology_autocomplete field type.

ols-5