Python excel2rdf
Generate RDF from Excel spreadsheets.
Installation
pip3 install excel2rdf
Usage
$ excel2rdf --help
Usage: excel2rdf [OPTIONS] INPUT_FILENAME OUTPUT_FILENAME
Options:
-f TEXT RDF format
--help Show this message and exit.
excel2rdf input.xlsx output.ttl
Excel Formatting
The first sheet in the Excel document (Sheet1) can be named anything. It is used as the data table.
Header
The first column of the header must be named uri. The value of the cells in the column uri will be the fully qualified URI of a resource for the given row. If left blank, excel2rdf will generate a random URI.
The other columns of the header denote the predicate of the triple statement in curie format. The cell values can be either a curie or any literal value.
Example Data Sheet
| uri | rdf:type | schema:name |
|---|---|---|
| schema:Person | John Smith | |
| https://w3id.org/tern/resources/dada3918-f119-457b-a2e8-d10032ba44de | schema:Person | Jane Smith@en |
Yes, you can also use language tags on your string literal values.
Prefix Declaration
A sheet named prefixes must exist. This sheet contains the prefix declarations. The first cell in the row must begin with a #. The second cell must be the prefix value and the third cell must be the fully qualified base URI of the prefix.
A single base URI is declared with the first cell containing ## and the second cell containing the base URI.
Example Prefix and Base URI Declaration
| ## | https://w3id.org/tern/resources/ | |
|---|---|---|
| # | schema | http://schema.org/ |
| # | rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# |
Full Excel Spreadsheet Example
See examples/manufacturers.xlsx for a full example.
Caveats
- The
.character cannot be used in the headings of each column.
Metadata
Release files for excel2rdf 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| excel2rdf-0.1.12.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| excel2rdf-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / excel2rdf-0.1.12.tar.gz
| Download URL | excel2rdf-0.1.12.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e938036dbc6ca4e4d51cee79e85838fc11a19b6219788ddeac0b62b7973ac954
|
|
BLAKE2b-256 checksum How to use checksums |
4f438bae4aeec720097c4267d5231c778f452ef63a2be07b6c469cc87cb01006
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
|
Release files / excel2rdf-0.1.12-py3-none-any.whl
| Download URL | excel2rdf-0.1.12-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2280569656bf4392c97abf7bea5a87580b16e4d70f3ea6872b199a8d9b5ed365
|
|
BLAKE2b-256 checksum How to use checksums |
d1a58034dd6d5d137b0643b0c8e9405237fb4e0fcacd94cbe71cf7359dc5b6de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6
|