rlay-project / rlay-ontology Goto Github PK
View Code? Open in Web Editor NEWImplementation of the Rlay decentralized ontology format
License: Other
Implementation of the Rlay decentralized ontology format
License: Other
The Protobuf format is not that great. An overview from the current doc page of the pros and cons (https://rlay-project.github.io/rlay-client/docs/rlay-ontology-serialization-formats#protobuf-based-format):
Pros:
- Protobuf libaries were easily available for prototyping in Rust and Solidity at time of creation
- Via ordered fields in protobuf schemas, it is pretty easy to have a determenistic content-addressable format
- Low size overhead over contents
Cons:
- Protobuf is comparatively complex for the simple features we need of it
- As the protobuf encoding doesn't contain any information about the entity kind, the entity kind has to be known for the encoding to be correctly interpreted
- Per-EntityKind CID multicodecs would require a lot of codecs to be registered/coordinated
- Unwieldy to use in end-user applications
As a replacement for the Probuf format, I am proposing a CBOR-based format with included prefix. The major upside is that CBOR is standardized, and has robust implementations in many languages. The other major change would be an included prefix that makes it possible to deserialize the entity without externally provided information what entity kind the bytes represent.
annotations
would be 0
for Class
while it is 1
for DataProperty
.annotations
), or field names that appear in entity kinds that are used very often (e.g. all field names in DataProperty
).Parsing a FormatWeb3 often causes an error because it contains an additional "cid" field that is added during serialization.
Should be easy enough to ignore when deserializing.
For some operations (e.g. verifying the existence of all referenced CIDs), it would be nice to have a function that returns an iterator (or similar) over all fields that are supposed to contain CIDs.
According to @MichaelHirn, the currently published version of @rlay/ontology
throws an error on import:
Error: Cannot find module './rlay_ontology_js_nodejs_bg'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/mj/rlay-utils/rlay-client-lib/node_modules/@rlay/ontology/rlay_ontology_js_nodejs.js:1185:8)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
(Late night thoughts)
Currently the Entity fields (fields of the different entity kinds) are not that concretely specified. A lot of them are currently states as being either an "IRI" (taken from OWL spec, but not really applicable) or just plain bytes.
The rough idea is that all fields that represent relationships to other entities should be CIDs, while all fields that represent "data" should be Multicodec-prefixed bytes (which could also be CIDs given that multiformats/multicodec#49 is added).
By making the data fields Multicodecs, we bascially get a very good equivalent to Literals/Datatypes in OWL2 for free.
Data fields: Annotation->value
, (Negative)DataPropertyAssertion->target
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.