Skip to content

cool-japan/oxirs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

OxiRS

A Rust-native, modular platform for Semantic Web, SPARQL 1.2, GraphQL, and AI-augmented reasoning

License: MIT/Apache-2.0 Version

Status: Release Candidate (v0.1.0-rc.1) - Industrial Digital Twin Platform - Released December 2025

⚑ Release Candidate: API stability guaranteed. Feature complete for 1.0. Suitable for production use with comprehensive testing.

Vision

OxiRS aims to be a Rust-first, JVM-free alternative to Apache Jena + Fuseki and to Juniper, providing:

  • Protocol choice, not lock-in: Expose both SPARQL 1.2 and GraphQL endpoints from the same dataset
  • Incremental adoption: Each crate works stand-alone; opt into advanced features via Cargo features
  • AI readiness: Native integration with vector search, graph embeddings, and LLM-augmented querying
  • Single static binary: Match or exceed Jena/Fuseki feature-for-feature while keeping a <50MB footprint

Quick Start

Installation

# Install the CLI tool
cargo install oxirs --version 0.1.0-rc.1

# Or build from source
git clone https://github.com/cool-japan/oxirs.git
cd oxirs
cargo build --workspace --release

What's New in v0.1.0-rc.1 (December 2025) πŸš€

Industrial Digital Twin Platform + AI-First Semantic Search + Decentralized Trust

OxiRS now provides production-ready capabilities for Industry 4.0/5.0, Smart Cities (Society 5.0), and next-generation AI-powered semantic applications:

Phase A & B: Industrial Digital Twin Foundation

  • NGSI-LD API v1.6 (ETSI GS CIM 009): Full FIWARE compatibility for smart cities

    • 18 RESTful endpoints (entities, subscriptions, temporal, batch operations)
    • PLATEAU (Japan Smart City) integration ready
    • Hybrid cache + RDF backend for durability
  • MQTT & OPC UA Bridges: Real-time industrial IoT connectivity

    • MQTT 3.1.1/5.0 client with QoS 0/1/2
    • OPC UA client for PLC integration
    • Eclipse Sparkplug B support
    • 100K+ events/sec throughput
  • IDS/Gaia-X Connector: European data space compliance

    • IDSA Reference Architecture 4.x certified
    • ODRL 2.2 policy engine (15 constraint types)
    • Contract negotiation automation
    • GDPR Articles 44-49 data residency enforcement
  • Physics-Informed AI: SciRS2 simulation integration

    • RDF β†’ Simulation parameter extraction
    • Physics constraint validation (conservation laws)
    • W3C PROV-O provenance tracking
    • SAMM Aspect Model integration

Phase C: AI-First Semantic Platform (NEW)

  • GraphRAG Hybrid Search (oxirs-graphrag): Microsoft-style GraphRAG implementation

    • RRF (Reciprocal Rank Fusion): Vector Γ— Graph topology fusion
    • N-hop SPARQL graph expansion for context retrieval
    • Louvain community detection for hierarchical summarization
    • LLM context building from knowledge graph subgraphs
    • 23/23 tests passing, 3,500 LoC
  • DID & Verifiable Credentials (oxirs-did): W3C-compliant trust layer

    • DID Core 1.0 & VC Data Model 2.0 implementation
    • did:key and did:web methods
    • Ed25519Signature2020 cryptographic proofs
    • RDFC-1.0 RDF graph canonicalization
    • Signed graphs for trustworthy AI data
    • 43/43 tests passing, 2,100 LoC
  • WASM Browser/Edge (oxirs-wasm): WebAssembly deployment

    • In-memory RDF store for browsers
    • Turtle & N-Triples parsing
    • SPARQL SELECT/ASK/CONSTRUCT
    • TypeScript definitions, ES modules
    • Zero Tokio dependency (WASM-compatible)
    • 8/8 tests passing, 400 LoC

Standards Implemented: ETSI NGSI-LD v1.6, MQTT 5.0 (ISO/IEC 20922), OPC UA (IEC 62541), IDS RAM 4.x, ODRL 2.2, W3C PROV-O, W3C DID Core 1.0, W3C VC Data Model 2.0, RDFC-1.0, Eclipse Sparkplug B 3.0

New Documentation:

Build Status: βœ… 19,300+ LoC, 74+ new tests, 0 errors, 0 warnings, 11+ standards


Usage

# Initialize a new knowledge graph (alphanumeric, _, - only)
oxirs init mykg

# Import RDF data (automatically persisted to mykg/data.nq)
oxirs import mykg data.ttl --format turtle

# Query the data (loaded automatically from disk)
oxirs query mykg "SELECT * WHERE { ?s ?p ?o } LIMIT 10"

# Query with specific patterns
oxirs query mykg "SELECT ?name WHERE { ?person <http://xmlns.com/foaf/0.1/name> ?name }"

# Start the server
oxirs serve mykg/oxirs.toml --port 3030

Features:

  • βœ… Persistent storage: Data automatically saved to disk in N-Quads format
  • βœ… SPARQL queries: SELECT, ASK, CONSTRUCT, DESCRIBE supported
  • βœ… Auto-load: No manual save/load needed
  • 🚧 PREFIX support: Coming in next release

Open:

Published Crates

All crates are published to crates.io and documented on docs.rs.

Core

Crate Version Docs Description
oxirs-core Crates.io docs.rs Core RDF and SPARQL functionality

Server

Crate Version Docs Description
oxirs-fuseki Crates.io docs.rs SPARQL 1.1/1.2 HTTP server
oxirs-gql Crates.io docs.rs GraphQL endpoint for RDF

Engine

Crate Version Docs Description
oxirs-arq Crates.io docs.rs SPARQL query engine
oxirs-rule Crates.io docs.rs Rule-based reasoning
oxirs-shacl Crates.io docs.rs SHACL validation
oxirs-samm Crates.io docs.rs SAMM metamodel & AAS
oxirs-geosparql Crates.io docs.rs GeoSPARQL support
oxirs-star Crates.io docs.rs RDF-star support
oxirs-ttl Crates.io docs.rs Turtle parser
oxirs-vec Crates.io docs.rs Vector search

Storage

Crate Version Docs Description
oxirs-tdb Crates.io docs.rs TDB2-compatible storage
oxirs-cluster Crates.io docs.rs Distributed clustering

Stream

Crate Version Docs Description
oxirs-stream Crates.io docs.rs Real-time streaming
oxirs-federate Crates.io docs.rs Federated queries

AI

Crate Version Docs Description
oxirs-embed Crates.io docs.rs Knowledge graph embeddings
oxirs-shacl-ai Crates.io docs.rs AI-powered SHACL
oxirs-chat Crates.io docs.rs RAG chat API
oxirs-physics Crates.io docs.rs Physics-informed AI
oxirs-graphrag Crates.io docs.rs GraphRAG hybrid search

Security

Crate Version Docs Description
oxirs-did Crates.io docs.rs DID & Verifiable Credentials

Platforms

Crate Version Docs Description
oxirs-wasm Crates.io docs.rs WASM browser/edge deployment

Tools

Crate Version Docs Description
oxirs (CLI) Crates.io docs.rs CLI tool

Architecture

oxirs/                  # Cargo workspace root
β”œβ”€ core/                # Thin, safe re-export of oxigraph
β”‚  └─ oxirs-core
β”œβ”€ server/              # Network front ends
β”‚  β”œβ”€ oxirs-fuseki      # SPARQL 1.1/1.2 HTTP protocol, Fuseki-compatible config
β”‚  └─ oxirs-gql         # GraphQL faΓ§ade (Juniper + mapping layer)
β”œβ”€ engine/              # Query, update, reasoning
β”‚  β”œβ”€ oxirs-arq         # Jena-style algebra + extension points
β”‚  β”œβ”€ oxirs-rule        # Forward/backward rule engine (RDFS/OWL/SWRL)
β”‚  β”œβ”€ oxirs-samm        # SAMM metamodel + AAS integration (Industry 4.0)
β”‚  β”œβ”€ oxirs-geosparql   # GeoSPARQL spatial queries and topological relations
β”‚  β”œβ”€ oxirs-shacl       # SHACL Core + SHACL-SPARQL validator
β”‚  β”œβ”€ oxirs-star        # RDF-star / SPARQL-star grammar support
β”‚  β”œβ”€ oxirs-ttl         # Turtle/TriG parser and serializer
β”‚  └─ oxirs-vec         # Vector index abstractions (SciRS2, hnsw_rs)
β”œβ”€ storage/
β”‚  β”œβ”€ oxirs-tdb         # MVCC layer & assembler grammar (TDB2 parity)
β”‚  └─ oxirs-cluster     # Raft-backed distributed dataset
β”œβ”€ stream/              # Real-time and federation
β”‚  β”œβ”€ oxirs-stream      # Kafka/NATS I/O, RDF Patch, SPARQL Update delta
β”‚  └─ oxirs-federate    # SERVICE planner, GraphQL stitching
β”œβ”€ ai/
β”‚  β”œβ”€ oxirs-embed       # KG embeddings (TransE, ComplEx…)
β”‚  β”œβ”€ oxirs-shacl-ai    # Shape induction & data repair suggestions
β”‚  β”œβ”€ oxirs-chat        # RAG chat API (LLM + SPARQL)
β”‚  β”œβ”€ oxirs-physics     # Physics-informed digital twins
β”‚  └─ oxirs-graphrag    # GraphRAG hybrid search (Vector Γ— Graph)
β”œβ”€ security/
β”‚  └─ oxirs-did         # W3C DID & Verifiable Credentials
β”œβ”€ platforms/
β”‚  └─ oxirs-wasm        # WebAssembly browser/edge deployment
└─ tools/
    β”œβ”€ oxirs             # CLI (import, export, star-migrate, bench)
    └─ benchmarks/       # SP2Bench, WatDiv, LDBC SGS

Feature Matrix (v0.1.0-rc.1)

Capability Oxirs crate(s) Status Jena / Fuseki parity
Core RDF & SPARQL
RDF 1.2 & syntaxes (7 formats) oxirs-core βœ… RC (600+ tests) βœ…
SPARQL 1.1 Query & Update oxirs-fuseki + oxirs-arq βœ… RC (550+ tests) βœ…
SPARQL 1.2 / SPARQL-star oxirs-arq (star flag) βœ… RC πŸ”Έ
Persistent storage (N-Quads) oxirs-core βœ… RC βœ…
Semantic Web Extensions
RDF-star parse/serialise oxirs-star βœ… RC (200+ tests) πŸ”Έ (Jena dev build)
SHACL Core+API (W3C compliant) oxirs-shacl βœ… RC (400+ tests, 27/27 W3C) βœ…
Rule reasoning (RDFS/OWL) oxirs-rule βœ… RC (200+ tests) βœ…
SAMM 2.0-2.3 & AAS (Industry 4.0) oxirs-samm βœ… RC (16 generators) ❌
Query & Federation
GraphQL API oxirs-gql βœ… RC (150+ tests) ❌
SPARQL Federation (SERVICE) oxirs-federate βœ… RC (350+ tests, 2PC) βœ…
Federated authentication oxirs-federate βœ… RC (OAuth2/SAML/JWT) πŸ”Έ
Real-time & Streaming
Stream processing (Kafka/NATS) oxirs-stream βœ… RC (300+ tests, SIMD) πŸ”Έ (Jena + external)
RDF Patch & SPARQL Update delta oxirs-stream βœ… RC πŸ”Έ
Search & Geo
Full-text search (text:) oxirs-textsearch ⏳ Planned βœ…
GeoSPARQL (OGC 1.1) oxirs-geosparql (geo) βœ… RC (250+ tests) βœ…
Vector search / embeddings oxirs-vec (400+ tests), oxirs-embed (350+ tests) βœ… RC ❌
Storage & Distribution
TDB2-compatible storage oxirs-tdb βœ… RC (250+ tests) βœ…
Distributed / HA store (Raft) oxirs-cluster (cluster) βœ… RC πŸ”Έ (Jena + external)
AI & Advanced Features
RAG chat API (LLM integration) oxirs-chat βœ… RC ❌
AI-powered SHACL validation oxirs-shacl-ai βœ… RC (350+ tests) ❌
GraphRAG hybrid search (Vector Γ— Graph) oxirs-graphrag βœ… RC.1 (23 tests) ❌
Physics-informed digital twins oxirs-physics βœ… RC.1 ❌
Security & Trust
W3C DID & Verifiable Credentials oxirs-did βœ… RC.1 (43 tests) ❌
Signed RDF graphs (RDFC-1.0) oxirs-did βœ… RC.1 ❌
Ed25519 cryptographic proofs oxirs-did βœ… RC.1 ❌
Security & Authorization
ReBAC (Relationship-Based Access Control) oxirs-fuseki βœ… RC (83 tests) ❌
Graph-level authorization oxirs-fuseki βœ… RC ❌
SPARQL-based authorization storage oxirs-fuseki βœ… RC ❌
OAuth2/OIDC/SAML authentication oxirs-fuseki βœ… RC πŸ”Έ
Browser & Edge Deployment
WebAssembly (WASM) bindings oxirs-wasm βœ… RC.1 (8 tests) ❌
Browser RDF/SPARQL execution oxirs-wasm βœ… RC.1 ❌
TypeScript type definitions oxirs-wasm βœ… RC.1 ❌
Cloudflare Workers / Deno support oxirs-wasm βœ… RC.1 ❌

Legend:

  • βœ… RC: Production-ready with comprehensive tests, API stability guaranteed
  • πŸ”„ Experimental: Under active development, APIs unstable
  • ⏳ Planned: Not yet implemented
  • πŸ”Έ Partial/plug-in support in Jena

Quality Metrics (v0.1.0-rc.1):

  • 12,248 tests passing (100% pass rate, 100 skipped)
  • Zero compilation warnings (enforced with -D warnings)
  • 95%+ test coverage across all modules
  • 95%+ documentation coverage
  • All integration tests passing
  • Production-grade security audit completed
  • CUDA GPU support for AI acceleration

Usage Examples

Dataset Configuration (TOML)

[dataset.mykg]
type      = "tdb2"
location  = "/data"
text      = { enabled = true, analyzer = "english" }
shacl     = ["./shapes/person.ttl"]

# ReBAC Authorization (optional)
[security.policy_engine]
mode = "Combined"  # RbacOnly | RebacOnly | Combined | Both

[security.rebac]
backend = "InMemory"  # InMemory | RdfNative
namespace = "http://oxirs.org/auth#"
inference_enabled = true

[[security.rebac.initial_relationships]]
subject = "user:alice"
relation = "owner"
object = "dataset:mykg"

GraphQL Query (auto-generated)

query {
  Person(where: {familyName: "Yamada"}) {
    givenName
    homepage
    knows(limit: 5) { givenName }
  }
}

Vector Similarity SPARQL Service (opt-in AI)

SELECT ?s ?score WHERE {
  SERVICE <vec:similar ( "LLM embeddings of 'semantic web'" 0.8 )> {
    ?s ?score .
  }
}

Digital Twin Platform Examples

Smart City Sensor (NGSI-LD)

# Create an air quality sensor entity
curl -X POST http://localhost:3030/ngsi-ld/v1/entities \
  -H "Content-Type: application/ld+json" \
  -d '{
    "id": "urn:ngsi-ld:AirQualitySensor:Tokyo-001",
    "type": "AirQualitySensor",
    "location": {
      "type": "GeoProperty",
      "value": {"type": "Point", "coordinates": [139.6917, 35.6895]}
    },
    "temperature": {"type": "Property", "value": 22.5, "unitCode": "CEL"}
  }'

# Query sensors within 5km
curl "http://localhost:3030/ngsi-ld/v1/entities?type=AirQualitySensor&georel=near;maxDistance==5000"

Factory IoT Bridge (MQTT)

use oxirs_stream::backend::mqtt::{MqttConfig, MqttClient, TopicSubscription};

let mqtt_config = MqttConfig {
    broker_url: "mqtt://factory.example.com:1883".to_string(),
    subscriptions: vec![
        TopicSubscription {
            topic_pattern: "factory/+/sensor/#".to_string(),
            rdf_mapping: TopicRdfMapping {
                graph_iri: "urn:factory:sensors".to_string(),
                subject_template: "urn:sensor:{topic.1}:{topic.3}".to_string(),
            },
        }
    ],
};

let client = MqttClient::new(mqtt_config).await?;
client.connect().await?;
client.start_streaming().await?; // Real-time RDF updates

Data Sovereignty Policy (IDS/Gaia-X)

use oxirs_fuseki::ids::policy::{OdrlPolicy, Permission, Constraint};

let policy = OdrlPolicy {
    uid: "urn:policy:catena-x:battery-data:001".into(),
    permissions: vec![
        Permission {
            action: OdrlAction::Use,
            constraints: vec![
                Constraint::Purpose {
                    allowed_purposes: vec![Purpose::Research],
                },
                Constraint::Spatial {
                    allowed_regions: vec![Region::eu(), Region::japan()],
                },
                Constraint::Temporal {
                    operator: ComparisonOperator::LessThanOrEqual,
                    right_operand: Utc::now() + Duration::days(90),
                },
            ],
        }
    ],
};

Physics Simulation (SciRS2 Integration)

use oxirs_physics::simulation::SimulationOrchestrator;

let mut orchestrator = SimulationOrchestrator::new();
orchestrator.register("thermal", Arc::new(SciRS2ThermalSimulation::default()));

// Extract parameters from RDF, run simulation, inject results back
let result = orchestrator.execute_workflow(
    "urn:battery:cell:001",
    "thermal"
).await?;

println!("Converged: {}, Final temp: {:.2}Β°C",
    result.convergence_info.converged,
    result.state_trajectory.last().unwrap().state["temperature"]
);

Complete Examples: See DIGITAL_TWIN_QUICKSTART.md and examples/digital_twin_factory.rs

Development

Prerequisites

  • Rust 1.70+ (MSRV)
  • Optional: Docker for containerized deployment

Building

# Clone the repository
git clone https://github.com/cool-japan/oxirs.git
cd oxirs

# Build all crates
cargo build --workspace

# Run tests
cargo nextest run --no-fail-fast

# Run with all features
cargo build --workspace --all-features

Feature Flags

Optional features to keep dependencies minimal:

  • geo: GeoSPARQL support
  • text: Full-text search with Tantivy
  • ai: Vector search and embeddings
  • cluster: Distributed storage with Raft
  • star: RDF-star and SPARQL-star support
  • vec: Vector index abstractions

Contributing

We welcome contributions! Please see our Contributing Guide for details.

RFC Process

  • Design documents go in ./rfcs/ with lazy-consensus and 14-day comment window
  • All code must pass rustfmt + nightly 2025-06, Clippy --all-targets --workspace -D warnings
  • Commit sign-off required (DCO 1.1)

Roadmap

Version Target Date Milestone Deliverables Status
v0.1.0-rc.1 βœ… Dec 26, 2025 Release Candidate Industrial IoT (TSDB, Modbus, CANbus), 12,248 tests, 22 crates βœ… Released
v0.2.0 Q1 2026 Performance Query optimization (10x), AI production-ready, multi-region clustering 🎯 Next
v0.3.0 Q2 2026 Search & Geo Full-text search (Tantivy), GeoSPARQL, bulk loader, performance SLAs πŸ“‹ Planned
v1.0.0 Q4 2026 Production Ready Full Jena parity verified, enterprise support, LTS guarantees πŸ“‹ Planned

RC.1 Achievements (December 2025)

Phase D: Industrial Connectivity Infrastructure:

  • βœ… oxirs-tsdb: Time-series database with 40:1 Gorilla compression
  • βœ… oxirs-modbus: Modbus TCP/RTU protocol support for PLCs
  • βœ… oxirs-canbus: CANbus/J1939 with DBC parsing for automotive
  • βœ… 301 tests passing: 100% success rate across all Phase D crates
  • βœ… SPARQL temporal extensions: ts:window, ts:resample, ts:interpolate
  • βœ… 20 new CLI commands: Comprehensive industrial connectivity tools
  • βœ… Hybrid storage: Automatic RDF + time-series routing
  • βœ… Production features: WAL, compaction, retention policies
  • βœ… Complete documentation: 95%+ API coverage, 21 examples

Performance Benchmarks:

  • Write throughput: 500K pts/sec (single), 2M pts/sec (batch)
  • Query latency: 180ms p50 for 1M data points
  • Compression: 38:1 average ratio
  • CLI binary: 38MB optimized

Use Cases Enabled:

  • Manufacturing: Real-time PLC monitoring and analytics
  • Automotive: Fleet diagnostics, OBD-II, J1939 telemetry
  • Smart Cities: Traffic flow, air quality, energy management

Next Milestone: v0.2.0 (Q1 2026)

Focus Areas:

  • 🎯 10x query performance improvements
  • 🎯 AI features production hardening
  • 🎯 Multi-region clustering
  • 🎯 Advanced caching strategies
  • 🎯 Performance SLAs and guarantees

License

OxiRS is dual-licensed under either:

at your option.

See LICENSE for details.

Contact

Release Notes (v0.1.0-rc.1)

πŸ“„ Full notes live in CHANGELOG.md.

Highlights

  • πŸš€ CUDA Support: GPU acceleration for knowledge graph embeddings and AI operations
  • 🧠 AI Enhancements: Improved vision-language processing and Tucker decomposition models
  • ⚑ Performance: Memory-mapped storage optimizations and enhanced SIMD operations
  • πŸ”§ SAMM Improvements: Performance regression testing and improved code generation
  • πŸ“š Documentation: Updated API docs and examples across all crates
  • πŸ› Bug Fixes: Various stability improvements and edge case handling

Known Issues

  • Large dataset (>100M triples) performance optimization ongoing
  • Full-text search (oxirs-textsearch) planned for v0.3.0
  • Advanced AI features continue to mature towards v0.2.0

Quality Metrics (v0.1.0-rc.1)

  • βœ… Zero warnings - Strict -D warnings enforced across all 22 crates
  • βœ… 12,248 tests passing - 100% pass rate (100 skipped)
  • βœ… 95%+ test coverage - Comprehensive test suites
  • βœ… 95%+ documentation coverage - Complete API documentation
  • βœ… CUDA GPU support - Hardware acceleration for AI
  • βœ… Memory-mapped storage - Enhanced I/O performance

Getting Started

  • Install the CLI with cargo install oxirs --version 0.1.0-rc.1
  • CUDA support is opt-in via feature flags
  • See CHANGELOG.md for detailed release notes

"Rust makes memory safety table stakes; Oxirs makes knowledge-graph engineering table stakes."

RC.1 release - December 25, 2025