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 Foundationopen in new window. For years concept of OCA was incubated within communities like Inputs and Semantics Working Groupopen in new window at Trust over IPopen in new window. And Hyperledger Aries RFC-0014open in new window.

Developers can follow current specification work in the official repositoryopen in new window.

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.

Those core libraries allow the creation, parsing and management of OCA objects.

Quick Start

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 Browseropen in new window on port 8000 by default.

with default layouts

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

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 and Select Form Layout file fields select downloaded layouts files
  • Click Convert button and download generated file (OCA Bundle)
  • Download entries filesopen in new window 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

Last Updated:
Contributors: MichaƂ Pietrus