Skip to main content

Generate RDF from Excel spreadsheets.

Project description

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excel2rdf-0.1.9.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

excel2rdf-0.1.9-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file excel2rdf-0.1.9.tar.gz.

File metadata

  • Download URL: excel2rdf-0.1.9.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.2

File hashes

Hashes for excel2rdf-0.1.9.tar.gz
Algorithm Hash digest
SHA256 cf0539ea1651e15066a6d73ddd07137d39e8dede2b0ddaa1698fdfd8bb92c4f0
MD5 589c6e567b9455360c08e2e0cf8fde72
BLAKE2b-256 c1ee8ad1ef3516aa640cf2c7e2a887e483759a6112162bf88a8beaebdeef1e59

See more details on using hashes here.

Provenance

File details

Details for the file excel2rdf-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: excel2rdf-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.2

File hashes

Hashes for excel2rdf-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1c79fbfaebe285cd1e1f76ea91282428dc8b4fb716357ee51dc41531de4f4da9
MD5 dc1628d5e7ae94755782013c600b005c
BLAKE2b-256 f9e099c42e6fb3e196a7dde96c05058de09918ee6a5144fc46777a276a756d2f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page