πΊοΈ Architecture details
This page presents the project architecture and some technical details.
ποΈ Folder structure
curies.rs/
βββ lib/
β βββ src/
β β βββ π¦ Source code for the core Rust crate
β βββ tests/
β β βββ π§ͺ Tests for the core Rust crate
β βββ docs/
β βββ π Markdown and HTML files for the documentation website
βββ python/
β βββ π Python bindings
βββ js/
β βββ π¨ JavaScript bindings
βββ r/
β βββ π R bindings
βββ scripts/
β βββ π οΈ Development scripts (build, test, gen docs)
βββ .github/
βββ workflows/
βββ βοΈ Automated CI/CD workflows for testing and building releases
β¨ Features
List of features available per language binding, based on features defined in curies.readthedocs.io
Feature | Rust (core) | Python | JS | R |
---|---|---|---|---|
compress | β | β | β | β |
expand | β | β | β | β |
compress_list | β | β | β | |
expand_list | β | β | β | |
standardize (prefix, curie, uri) | β | β | β | |
is_uri() and is_curie() | β | β | β | |
expand_or_standardize() and compress_or_standardize() | β | β | β | |
chain converters | β | β | β | |
Record object and converter.add_record() | β | β | β | |
converter.add_prefix(prefix, ns) | β | β | β | |
converter.get_prefixes() and .get_uri_prefixes() | β | β | β | |
Load from prefix map | β | β | β | |
Load from extended prefix map | β | β | β | |
Load from JSON-LD context | β | β | β | |
Load from SHACL prefix definition | β | β | β | |
Load OBO converter | β | β | β | |
Load GO converter | β | β | β | |
Load Bioregistry converter | β | β | β | β |
Load Monarch converter | β | β | β | |
Write converter to prefix map | β | β | β | |
Write converter to extended prefix map | β | β | β | |
Write converter to JSON-LD | β | β | β | |
Write converter to SHACL | β | β | β | |
.get_subconverter() | ||||
Prefixes discovery |
β οΈβ Differences between Rust core and language bindings
- The functions to Load prefix map, extended prefix map and JSON-LD can take
HashMap
as input in rust. But for JS and python, we currently need to pass it asString
(we need to figure out how to pass arbitrary objects). You can pass either a URL or a JSON object as string, the lib will automatically retrieve the content of the URL if it is one. The original python lib was taking directly JSON objects for all loaders, apart from SHACL which takes a URL (which was not convenient when wanting to provide a local SHACL file) - In rust chain() is a static function taking a list of converters,
chained = Converter::chain([conv1, conv2])
. In JS and python we cannot easily pass a list of complex objects like converters, so chain is a normal function that takes 1 converter to chain:chained = conv1.chain(conv2)
- In the rust lib, currently the functions to write prefix map returns a HashMap, write extended map returns a JSON as string, and write JSON-LD returns
serde::json
type. The JS and python equivalent directly return a string. In the original python lib it was writing to a file.