Getting started
Introduction
OCA is a pattern (architecture) that defines a new representation of data semantics. Official OCA documentation is under development hosted by Human Colossus Foundation. For years concept of OCA was incubated within communities like Inputs and Semantics Working Group at Trust over IP. And Hyperledger Aries RFC-0014.
Developers can follow current specification work in the official repository.
Due to a rapidly-evolving OCA core specification, future implementations may differ somewhat. The most up to date implementation is Rust, which would provide bindings to other languages.
- Rust with compile targets to other languages like JavaScript, Python and more planed.
- Deprecated:
Kotlin with compile target to JavaScript - Deprecated:
Ruby
Those core libraries allow the creation, parsing and management of OCA objects.
Quick Start
Pre-requisites
- Install docker and docker-compose
To serve OCA ecosystem on your machine, run the following commands in your command line:
curl https://raw.githubusercontent.com/THCLab/oca-ecosystem/main/docker-compose.yml > docker-compose.yml
docker-compose up
This command will serve OCA Browser on port 8000 by default.
with default layouts
- Download XLS Swiss Passport example
- Go to
Develop -> XLS to OCA Converter
and select XLS inSelect OCA File
field - Click
Convert
button and download generated file (OCA Bundle) - Download entries files and upload them to data-vault with listed command:
for f in examples/swiss_passport/entries/*; do;
curl -X POST "http://localhost:9293/api/v1/files" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@$f";
done;
Hosting entries in Data Vault allows to reuse complex entries in many OCAs. You can link Entry Code Overlay or Entries Overlay with entries in Data Vault by it's SAI instead of keeping all entries data inside Overlays.
- Go to
Preview
and select OCA Bundle file - As a result OCA Form and Credential are rendered with default layouts
custom layouts
- Download XLS Swiss Passport example and layouts files
- Download assets files and upload them to data-vault with listed command:
for f in examples/swiss_passport/assets/*; do;
curl -X POST "http://localhost:9293/api/v1/files" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@$f";
done;
Assets may be images, fonts etc. used in custom layout.
- In
Develop -> XLS to OCA Converter
select XLS file as before - In
Select Credential Layout file
andSelect Form Layout file
fields select downloaded layouts files - Click
Convert
button and download generated file (OCA Bundle) - Download entries files and upload them to data-vault with listed command:
for f in examples/swiss_passport/entries/*; do;
curl -X POST "http://localhost:9293/api/v1/files" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@$f";
done;
- Go to
Preview
and select OCA Bundle file - As a result OCA Form and Credential are rendered with custom defined layouts
Learn more about defining custom layouts
OCA References
TODO
Tutorial
Defining OCA in xls file
- Download template file
- In
Main
sheet columns A, B, C and D stores definition of Capture Base - Columns from E to N stores definition of Overlays that are not language specific
- Other sheets named by ISO_639-1 language code stores definition of language specific Overlays