shashankmc / nanopub-rs

πŸ”¬πŸ¦€ An experimental project to build a Rust package for RDF and Nanopublications with bindings to Python and JS (wasm)

Home Page:https://vemonet.github.io/nanopub-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ”¬πŸ¦€ Nanopub rs

Lint and Test Deploy docs to GitHub Pages

A rust toolkit to sign and publish Nanopublications, with bindings to python and javascript (wasm).

Nanopub signing process

  • preliminary nanopub is created with blank space in URIs at the places where the trusty URI code will appear (normalized URI: http://purl.org/np/ARTIFACTCODE-PLACEHOLDER/, cf. code); this includes the signature part, except the triple that is stating the actual signature
  • preliminary nanopub is serialized in a normalized fashion (basically each quad on four lines with minimal escaping)
  • Signature is calculated on this normalized representation (cf. most of the process in the trusty-uri python lib, see also SignatureUtils and trusty-uri)
  • Signature triple is added
  • Trusty URI code is calculated on normalized representation that includes signature
  • Trusty URI code is added in place of all the occurrences of blank spaces in the URIs, leading to the final trusty nanopub

Run the library to test

cd try/
cargo build
cargo run

Checkout the README in the python and js folder for the instructions for each language

Generate docs

./scripts/docs-serve.sh

Useful links

https://github.com/briansmith/ring

https://github.com/Vanethos/rust-wasm-example-rsa

https://github.com/Harzu/wasm-rsa

https://github.com/frehberg/wasm-sign

Building artefacts for many targets: https://github.com/oxigraph/oxigraph/blob/main/.github/workflows/artifacts.yml

About

πŸ”¬πŸ¦€ An experimental project to build a Rust package for RDF and Nanopublications with bindings to Python and JS (wasm)

https://vemonet.github.io/nanopub-rs

License:MIT License


Languages

Language:Rust 77.1%Language:Shell 8.3%Language:HTML 7.9%Language:Python 6.6%