Code Monkey home page Code Monkey logo

sql-json-bags's Introduction

datasets-br

Describing the datasets-br directives and using this project as point of generic discussions.

Dataset-BR directives

  1. To post qualified datasets in the Datahub.io;
  2. To unify, by curatory process, a set of Wikidata fragments if items, or commom instances of an item;
  3. To unify terminology to express CSV colunm names, table and column semantics (SchemaOrg conventions when possible)
  4. Digital preservation (CSV files and data dumps from original soruces) of the curated datasets;
  5. Monitoring/auditing Wikidata and OpenStreetMap changes, in the context of the curated datasets.

Use as an ecosystem of datasets

Example of use with 2 BR's datasets, state-codes and city-codes.

Operating with pure SQL or SQL-unifier will be easy to merge with other datasets... With PopstgreSQL you can offer datasets in an standard API with PostgreREST (or its descendents pREST and PostGraphile), or plug-and-play with SchemaOrg standards, FrictionlessData standards (and tools), etc.

Documentation

... under construction

Conventions for data provenance and prepare.


ย  Contents and data of this project are dedicated to

sql-json-bags's People

Contributors

ppkrauss avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sql-json-bags's Issues

Include filters for normalization

Some JSONb can be easylly transformated into valid bags:

  • a "bag" with nulls or zeros: must delete them.
  • an array of bags: must expand into sql-array
  • ... string filters for canonic element expression, but is application-specific.

So simple functions bag.std(JSONb) and bag.std_array(JSONb) that converts impercfect bags.

Use SQL-Domain

See https://www.postgresql.org/docs/current/static/sql-createdomain.html

jbag datatype

CREATE DOMAIN jbag AS JSONB
  CHECK(  VALUE IS NULL OR  jsonb_typeof(VALUE) IN ('object','null')  )
;  -- empty bag is JSON-null, and SQL NULL is "undefined"

Better a simple domain control and a validation function... The definition "... elementes are strings and the mutiplicity an positive non-zero integer" need a loop over all elements.
Complex checking is not good for performance, so validate only when request.

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.