Code Monkey home page Code Monkey logo

sovrin-schema-matching's Introduction

Actions StatusActions Status

Matching Metadata on Blockchain for Self-Sovereign Identity

Schema matching on the Sovrin network using natural language processing.

Downloading the latest schemas from the ledger

Build the docker image for the pooling service:

$ docker build -t sovrin-schema-matching:pooling-service sovrinxplore/ledgers/

To run it you have to share the sovrinxplore/ledgers folder, which is where the RocksDB with the schemas resides:

$ docker run --mount type=bind,source="$(pwd)/sovrinxplore/ledgers",target=/app/ledgers sovrin-schema-matching:pooling-service

Furthermore, to sync the sandbox or builder ledgers, just add the ledger name at the end of the command line:

$ docker run --mount type=bind,source="$(pwd)/sovrinxplore/ledgers",target=/app/ledgers -it sovrin-schema-matching:pooling-service sandbox
$ docker run --mount type=bind,source="$(pwd)/sovrinxplore/ledgers",target=/app/ledgers -it sovrin-schema-matching:pooling-service builder

You can add those calls to a time-based job scheduler (cron) to always have the latest transactions, i.e. to effectively have a pooling service.

Schema matching

First you have to build the docker image for the schema matching CLI:

$ docker build -t sovrin-schema-matching:cli .

Whatever is provided on the stdio is queried. Also, the sovrinxplore/ledgers folder needs to be shared to get the latest schemas (or you can rebuild the docker image on your cron job):

$ echo "first name" | docker run --mount type=bind,source="$(pwd)/sovrinxplore/ledgers",target=/app/sovrinxplore/ledgers -i sovrin-schema-matching:cli
Total schemas: 149
+-------+-------+--------------------------------------------------------------+
| score | seqNo |                            values                            |
+=======+=======+==============================================================+
| 0.897 | 54605 | ['Time', 'First name', 'Date', 'Email', 'Webinar name',      |
|       |       | 'Last name', 'URL']                                          |
+-------+-------+--------------------------------------------------------------+
| 0.880 | 54517 | ['Account ID', 'Last Name', 'Email', 'First Name']           |
+-------+-------+--------------------------------------------------------------+
| 0.832 | 59004 | ['Company', 'Issue Date', 'Event Name', 'Attendee Type',     |
|       |       | 'Event Date', 'Last Name', 'Email', 'First Name', 'Event     |
|       |       | Identifier']                                                 |
+-------+-------+--------------------------------------------------------------+
| 0.831 | 59553 | ['Role', 'Employer', 'System Access', 'First Name',          |
|       |       | 'Location', 'Last Name']                                     |
+-------+-------+--------------------------------------------------------------+
| 0.824 | 55727 | ['QiqoURL', 'Company', 'Event Name', 'Purchase Date',        |
|       |       | 'Amount Paid', 'Event Date', 'Ticket Type', 'Email', 'First  |
|       |       | Name', 'Last Name']                                          |
+-------+-------+--------------------------------------------------------------+

Enlapsed time to schema match: 0:00:00.123772

Results

See the README.md on the experiments folder for more details.

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.