Copyright: VU University Amsterdam
License: LGPL v3.0
TabLinker is experimental software for converting manually annotated Microsoft Excel workbooks to the RDF Data Cube vocabulary. It is used in the context of the Data2Semantics project to investigate the use of Linked Data for humanities research (Dutch census data produced by DANS).
TabLinker was designed for converting Excel or CSV files to RDF (triplification, RDF-izing) that have a complex layout and cannot be handled by fully automatic csv2rdf scripts.
A presentation about Linked Census Data, including TabLinker is available from SlideShare.
TabLinker takes annotated Excel files (found using the
srcMask option in the config.ini file) and converts them to RDF. This RDF is serialized to the target folder specified using the
targetFolder option in config.ini.
Annotations in the Excel file should be done using the built-in style functionality of Excel (you can specify these by hand). TabLinker currently recognises seven styles:
- TL Title – The cell containing the title of a sheet
- TL Data – A cell that contains data, e.g. a number for the population size
- TL ColHeader – Used for the headers of columns
- TL RowHeader – Used for row headers
- TL HRowHeader – Hierarchical header, used for multi-column row headers with subsumption/taxonomic relations between the values of the columns
- TL RowProperty – Typically used for the header cells directly above RowHeader or HierarchicalRowHeader cells. Cell values are the properties that relate Data cells to RowHeader and HierarchicalRowHeader cells.
- TL RowLabel – Used for cells that contain a label for one of the HierarchicalRowHeader cells in the same row.
An eight style, TL Metadata, is currently ignored (See #3).
Tip: If your table contains totals for HierarchicalRowHeader cell values, use a non-TabLink style to mark the cells between the level to which the total belongs, and the cell that contains the name of the total. Have a look at the example annotated Excel file to see how this is done (up to row 428).
Once you’re all set, start the TabLinker by cd-ing to the src folder, and running:
Editing the config.ini file can help you to get a more customized RDF output. Options are:
- format is the desired RDF serialization format (‘n3’ by default).
- srcMask is a mask matching the input XLS files. It works as a directory specifier, as well as wildcard specifier to filter only desired files.
- targetFolder is the target directory where you want the RDF files to be written to.
- verbose with value 1 (default) enables verbose mode (0 disables it).
- literalType is a URI specifying the datatype for the data cells in the spreadsheet (e.g. [http://www.w3.org/2001/XMLSchema])
- propertyName is the name of data cell property. Leave blank to use default ‘hasValue’.
- labels are language literals to be added for that property name (if needed).
- enabled with value 1 (default) generates an additional graph with the annotations (Excel comments) contained in the XLS files (if any) (0 disables it).
- model specifies the data model (‘oa’ by default) for generating the annotations graph.
TabLinker was developed under the following environment:
- Python 2.7
- The xlutils and xlrd packages from http://www.python-excel.org/
- RDFLib 4.0.1, from http://www.rdflib.net