https://github.com/field33/owlish
OWL2 representation in Rust
https://github.com/field33/owlish
owl2 rdf rust
Last synced: 11 days ago
JSON representation
OWL2 representation in Rust
- Host: GitHub
- URL: https://github.com/field33/owlish
- Owner: field33
- License: apache-2.0
- Created: 2022-05-10T12:55:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-12T13:30:40.000Z (over 2 years ago)
- Last Synced: 2025-09-14T20:29:06.315Z (2 months ago)
- Topics: owl2, rdf, rust
- Language: Rust
- Homepage: https://crates.io/crates/owlish
- Size: 1.31 MB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-semantic-web - owlish - An OWL library in Rust modeled on the OWL functional syntax. (Programming / Rust)
- awesome-ontology - Owlish - A Rust library for working with OWL 2 ontologies with Wasm support and turtle parsing. (Rust) (Programming / OWL-aware libraries)
README
# owlish
[
](https://github.com/field33/owlish)
[
](https://crates.io/crates/owlish)
[
](https://docs.rs/owlish)
[
](https://www.npmjs.com/package/owlish)
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
```rust
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:
```js
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](https://www.conventionalcommits.org/en/v1.0.0/) to create automated releases whenever the main branch is updated. In addition the CHANGELOG.md is automatically generated.