Another Excel-to-RDF converter for SKOS vocabs, but one that:
-
uses fixed templates to keep it simple
-
meets particular SKOS profile outcomes (VocPub)
-
is under active development, production use, and is commercially supported
An online version of VocExcel is available at https://tools.kurrawong.ai/tools/vocexcel.
The process to create an RDF vocabulary from an Excel template is:
-
Fill in a copy of an Excel template
-
Process it
-
Using one of the options, and export an RDF file
-
You can choose to validate the RDF produced while processing
-
The template files in this repository’s vocexcel/templates/ folder are to be used to create vocabularies. The templates hopefully contain all the information needed to understand how to fill them in.
Use one Excel workbook per vocabulary.
-
vocexcel/templates/VocExcel-template-085.xlsx
Unless you have a good reason to do something different, please use the latest version of the template.
Older templates still convert, so if you’ve used one and like it, keep using it.
To process an Excel template, you will need to either:
-
run the VocExcel Python script, or
-
use an online tool
-
for example https://tools.kurrawong.ai/tools/vocexcel
-
The Python script can also run as a Python module, i.e. within a larger Python workflow.
You will need to:
-
have Python installed on your computer
-
3.10+ required
-
-
install the required packages in your main Python environment or a virtual environment
-
you can use the uv tool Python build tool with the pyproject.toml file to install required Python packages
-
The Python script convert.py
in the vocexcel/
directory can be run on Windows/Unix/Linux/Mac systems like this:
python convert.py some-excel-file.xlsx
If you install this program using a Python packaging tool such as uv, then it will run like this:
vocexel some-excel-file.xlsx
An example, using one of the test data files to convert from Excel to RDF:
python convert.py tests/data/085.xlsx
To convert the other way - RDF to Excel - from with you’ll get a v0.8.x template result:
python convert.py tests/data/085_rdf.ttl
The command line argument options can be found by typing:
python convert.py -h
They are:
usage: vocexcel [-h] [-i] [-o OUTPUTFILE] [input_file] positional arguments: input_file The Excel file to convert to a SKOS vocabulary in RDF or an RDF file to convert to an Excel file. (default: None) options: -h, --help show this help message and exit -i, --info The version and other info of this instance of VocExcel. (default: False) -o OUTPUTFILE, --outputfile OUTPUTFILE An optionally-provided output file path. If not provided, output from Excel-> RDF is to standard out and RDF->Excel is input file with .xlsx file ending. (default: None)
The convert.py file uses the functions excel_to_rdf()
and rdf_to_excel()
to do conversions, so you can directly them in other Python programs by importing them like:
from vocexcel.convert import excel_to_rdf, rdf_to_excel from pathlib import Path rdf_to_excel(Path(".") / "path" / "to" / "vocab-file.xlsx") # or excel_to_rdf(Path(".") / "path" / "to" / "vocab-file.ttl")
KurrawongAI maintains an online VocExcel tool at https://tools.kurrawong.ai/tools/vocexcel
This code is licensed using the BSD 3-Clause. See the LICENSE for the deed. Note that Excel is property of Microsoft.
Commercial support:
https://docs.kurrawong.ai/products/tools/vocexcel/
info@kurrawong.ai
Lead Developer:
Nicholas Car
Data Architect
KurrawongAI
nick@kurrawong.ai