Coder Social home page Coder Social logo

jyucsiro / bald Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binary-array-ld/bald

0.0 2.0 0.0 4.76 MB

Python library for validating and managing binary array linked data files, e.g. HDF, netCDF.

License: BSD 3-Clause "New" or "Revised" License

Python 86.03% HTML 13.97%

bald's Introduction

Binary Array Linked Data: bald

Build Status

A Python library for managing binary array linked data files.

Parsing

This library processes payloads of various encodings and produces metadata graphs, in RDF, of the contents.

Input payloads are provided with an identity, elements within the payload are identified, with respect to that payload identity, unless they are otherwise identified, by prefix or by alias.

Only Object values (attribute values) may be literals, consistent with the RDF interpretation. All Subjects and Predicates are identified with URIs.

Some format specific implementation exists, due to the different capabilities available from different encodings.

netCDF

For netCDF files, no variable to variable reference definitions are provided by the API.

For a variable to variable reference to be interpreted, an externally provided alias or predicate graph must explicitly state that a particular attribute has an rdfs:range of http://binary-array-ld.net/latest/Subject or a subclass of that class.

netCDF parsing is working to support the emerging draft Open Geospaatial Consortium approach to netCDF-Linked-Data: https://github.com/opengeospatial/netCDF-LD/

HDF

HDF files and APIs have an object reference, indicating a reference from one element in the file to another.

These object refernces shall always be interpreted as references, regardless of the semantics of predicates (attribute names) provided by external graphs.

Validation

This library provides some limited validation capabilities.

It is expected that a valid input payload will be able to be processed into a graph.

Validation rules are limited in this implementation to require that provided HTTP URIs resolve.

Pre-requisites

Suggested configuration steps

conda create -n ncld-bald
conda config --add channels conda-forge
conda config --add channels bioconda
conda config --set show_channel_urls True
source activate ncld-bald
$ conda install --quiet --file requirements.txt

Alternative steps using virtualenv and pip

virtualenv bald
source bald/bin/activate
pip install -r requirements.txt

Quickstart

#install the bald module
$ python setup.py --quiet install

#running the tests
$ python -m unittest discover -s bald.tests -v

Command line tools

ncldDump

A HTML 'hot-linked' version of the ncdump command-line utility. The output of ncldDump is a something similar but with links to the standard names and definitions of the attributes to source documentation. See https://binary-array-ld.github.io/netcdf-ld/examples/avhrr-only-v2.19810901_a.html for example output HTML.

See more here https://github.com/jyucsiro/bald/tree/master/ncldDump

Getting started:

$ cd ncldDump
#Install requirements
$ pip install -r ../requirements.txt

#run
$ python ncldDump.py -a aliases.json -o test.html test.nc

nc2rdf

A command-line tool that takes a netCDF or CDL file and outputs an RDF or JSON-LD encoding of the content. The RDF can then be imported into RDF triple stores or used with RDF libraries for reasoning, SPARQL querying and the like.

The RDFLib package is used so serialisation options to RDF are: n3, nquads, nt, rdfxml, turtle or ttl.

See more here https://github.com/jyucsiro/bald/tree/master/nc2rdf

$ cd nc2rdf

# turn CDL into RDF
$ python nc2rdf.py  test.cdl

# turn NC into RDF
$ python nc2rdf.py  test.nc

# specify RDF formats/flavours 
$ python nc2rdf.py -o turtle test.nc

bald's People

Contributors

adamml avatar jimbiardcics avatar jjlevit avatar jyucsiro avatar marqh avatar mo-marqh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.