#owl #rdf #semantic-web

owlish

OWL 2 implementation with wasm support and turtle parsing

61 releases (25 breaking)

0.28.0 Jul 5, 2023
0.26.0 May 17, 2023
0.24.0 Mar 24, 2023
0.19.1 Dec 22, 2022
0.4.2 Jul 18, 2022

#624 in Web programming

Download history 77/week @ 2023-10-28 4/week @ 2023-11-04 1/week @ 2023-11-11 62/week @ 2023-11-18 126/week @ 2023-11-25 125/week @ 2023-12-02 1/week @ 2023-12-09 61/week @ 2023-12-16 122/week @ 2023-12-23 61/week @ 2023-12-30 6/week @ 2024-01-13 5/week @ 2024-01-20 122/week @ 2024-01-27 1/week @ 2024-02-03 259/week @ 2024-02-10

392 downloads per month

MIT/Apache

1MB
12K SLoC

owlish

github crates.io docs.rs npmjs.com

This library provides OWL2 datastructures that allow you to build and work with ontologies.

The OWL2 model is based on functional style syntax. E.g. the function

ClassAssertion( :Person :Mary )

Is represented as a similar tuple struct

pub struct ClassAssertion(pub(crate) ClassConstructor, pub(crate) IndividualIRI);

Usage

owlish provides two APIs:

  1. A low level representation of OWL based on functional syntax
    • This is exported in owlish::owl::*
  2. A conceptional api that concatenates OWL data for relevant types.
    • TBD

Usage (Node.js)

To initialize the module in a Node.js environment, it is currently recommend to load the WASM module via the fs API and pass it explicitly to the initialization function.

Example:

import path from 'path';
import { readFile } from 'fs/promises';
import { fileURLToPath } from 'url';

// The next two lines are only required if running the Node script as an ESM module
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Load .wasm file from the package
const owlishWasm = await readFile(path.join(__dirname, "../node_modules/owlish/owlish_bg.wasm"));
// Initialize module, after executing this line, all functions from `owlish` can be used like normal.
await owlish(owlishWasm)

Dev stuff

Build:

cargo build

Test:

cargo test

Run benchmark tests:

cargo bench

Commits and Releases

This crate uses convenentional commits to create automated releases whenever the main branch is updated. In addition the CHANGELOG.md is automatically generated.

Dependencies

~17MB
~304K SLoC