-
Notifications
You must be signed in to change notification settings - Fork 0
Conversion of taxonomies into skos format
Jo Cook edited this page Jan 21, 2021
·
3 revisions
Taxonomies such as at https://standards.esd.org.uk/? can be transformed into the correct format for use in GeoNetwork by using csv2skosxl.php
from https://gist.github.com/archaeogeek/36dbc4f0799d51cbed9591ef5003c76e
Prerequisites:
- The php executable for your operating system (I don't know if it's version specific)
- The file from https://gist.github.com/archaeogeek/36dbc4f0799d51cbed9591ef5003c76e saved as
csv2skosxl.php
- Download the required list from https://standards.esd.org.uk/? as a CSV
Make the CSV match the column order required by the tool, deleting those that are not needed:
- concept (mandatory) - Unique ID for the term
- prefLabel (mandatory) - Display label
- broader (optional) - Parent term
- definition (optional) - Description
- note (optional) - Additional note
- notation (optional) - Different ID (can equal concept)
path\to\php csv2skosxl.php http://id.esd.org.uk/list/[nameofcsv] [pathtocsv] [outputrdf]
Replace the top lines (up to but not including the first rdf:description
block with the following, filling in the correct dc:title
:
<rdf:RDF
xmlns="http://id.esd.org.uk/list/organisationTypes"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:ann="http://art.uniroma2.it/ontologies/annotation#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<skos:ConceptScheme rdf:about="https://home.esd.org.uk/">
<dc:title>IPSV Subjects List</dc:title>
<dc:description>Generated from standards.esd.org.uk.</dc:description>
<dc:creator>ESD-toolkit programme</dc:creator>
<dc:rights>http://www.nationalarchives.gov.uk/doc/open-government-licence/</dc:rights>
<dcterms:issued>2020-11-18 10:00:00</dcterms:issued>
<dcterms:modified>2020-11-18 10:00:00</dcterms:modified>
</skos:ConceptScheme>
eg:
php csv2skosxl.php http://id.esd.org.uk/list/areas ~/Downloads/areas.csv ~/Downloads/areas.rdf
- Sign in as admin and go to admin console -> Classification Systems -> Thesaurus
- Click Add Thesaurus and choose From local file
- Click Choose or drop files here and navigate to the rdf you created above
- Select the appropriate option from the dropdown list. If in doubt, Theme is probably OK
- Click Upload
- Check the thesaurus is available when adding keywords in a record