Generate the URIs needed for the BONSAI knowledge graph
Project description
Copyright (c) 2019, BONSAI team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- Description: # Correspondence_tables
This is a work space for the correspondence tables working group for BONSAI
## Background BONSAI will draw data from multiple sources, e.g. national supply-use tables, statistical databases etc. These have their own native classification to define products, activities, elementary flows or, generally speaking, objects/activity flows.
The integration of these data requires correspondence tables. These establish a correspondence between the different classifications of flow-objects, activities and properties. These correspondance tables are sometimes available from data providers (e.g [UN Stats](https://unstats.un.org/unsd/trade/classifications/correspondence-tables.asp)). In other cases the correspondance tables are created by the group.
This repo contains the data and code to transform a series of correspondence table into a rdf files using ontologies compatible with bonsai. When possible, the code will generate the rdf files from the raw data as made available by the data provider.
## Installation ### manual
Call python setup.py install inside the repository:
` git clone git@github.com:BONSAMURAIS/correspondence_tables.git cd correspondence_tables python setup.py install ` ## Usage
This functionality is not working yet, but eventually users can use the command line tool correspondence_tables-cli to regenerate the rdf files using something like:
` correspondence_tables-cli regenerate output `
## Group members
[Michele De Rosa](https://github.com/MicDr)
[Miguel F. Astudillo](https://github.com/mfastudillo)
[Brandon Kuczenski](https://github.com/bkuczenski)
[Chris Mutel](https://github.com/cmutel)
[Stefano Merciai](https://github.com/Stefano-MRC)
[Arthur Jakobs](https://github.com/jakobsarthur)
[Tiago Morais](https://github.com/tgmorais1)
[Massimo Pizzol](https://github.com/massimopizzol)
## Goals and objectives The goal of this working group is to collect, validate and classify correspondence tables between existing classifications and to convert the correspondence tables into a RDF serialization format for entry into the BONSAI database.
## Working procedure
The correspondence tables currently available are stored as received in the folder dataraw. The raw data has often to be reformated into a standadised format and stored in the folder dataintermediate with their metadata encoded as a descriptor following the [frictionless data table schema](https://github.com/frictionlessdata/tableschema-py). From the _clean_ tables and their metadata the corresponding rdf file is created and stored in the folder datafinal.
# Overview of vocabulary used
In the RDF framework data is stored as statements of form subject-predicate-object. The existence of a predicate allows a more concise definition of the relation between the classifications. Here we provide an overview of the predicates used in correspondance tables.
note: in RDF subject object and predicate have unique identifiers (URIs), that makes the statements wordy for humans. The examples here are provided in Turtle serialization format. We use prefixes to make the sentences more readable.
prefixes: - @prefix brdffo: <http://rdf.bonsai.uno/flowobject/us_epa_elem/> . - @prefix owl: <http://www.w3.org/2002/07/owl#> . - @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
rdfs:label it may be used to provide a human-readable version of the resource name
e.g. brdffo:Chemical-Structure.11148 rdfs:label “HFC-41”
This means that what the chemical structure _11148_ is labelled as HFC-41,
OWL.SameAs this predicate indicates that subject and object are the same thing
e.g. : brdffo:Chemical-Structure.11148 owl:sameAs <http://www.chemspider.com/Chemical-Structure.11148> .
This links the taxonomy of US EPA elementary flows to substances in the chemspider taxonomy. This allows access to a wide wealth of [info](http://www.chemspider.com/Chemical-Structure.11148.html) available in Chemspider for the given substance.
rdfs:subClassOf
This means instances of one class are instances of another, e.g. HFC-41 is a subclass of HFC
Also, this predicate can be used to indicate that a class belongs to a specific classifications, such as “ISIC 4”.
bont:superClassOf
We need to declare this predicate for the BONSAI ontology:
bont:superClassOf owl:inverseOf refs:SuperClassOf
The inverse of rdfs:subClassOf, allowing to import/export a correspondance table between two classifications as a csv-file with 3 columns (classification 1, predicate, Classification 2)
Platform: UNKNOWN Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Scientific/Engineering :: Information Analysis Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Scientific/Engineering :: Visualization
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file correspondence_tables-0.1.tar.gz
.
File metadata
- Download URL: correspondence_tables-0.1.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c94a0a06a3ee0061d06bb9d766bca0f78414d805458dc08aad09aabd034401 |
|
MD5 | 55bb094fd86b3b8560c759901fe3d437 |
|
BLAKE2b-256 | cd419729566cd0966165915963af15b489674c7d0b2845a7adc4a0a36adc484b |
File details
Details for the file correspondence_tables-0.1-py3.7.egg
.
File metadata
- Download URL: correspondence_tables-0.1-py3.7.egg
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f19c7035aa0c0ea5d1eca01830d24eb17d16fdd7349cc5ca154950fcaf439f9f |
|
MD5 | 65023b1ad027129f744f4d1672cc85f9 |
|
BLAKE2b-256 | f9b9c3014c17030451a8b6ef514e9451b3a437ffc76ca5827183bad70f0abf93 |
File details
Details for the file correspondence_tables-0.1-py3-none-any.whl
.
File metadata
- Download URL: correspondence_tables-0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c5f1a1956e48c20848db5da982cd9c9ee54c5e1dd9c2dd83d9407505365687b |
|
MD5 | 7029e932cb2275c609c27e419f8ea71b |
|
BLAKE2b-256 | bb4c7a6a8a834bac2a5bc2ed13f1756949363c748beed91db84b489ae09dda63 |