@faubulous/mentor-rdf
    Preparing search index...

    @faubulous/mentor-rdf

    Mentor RDF API

    A TypeScript library for working with RDF vocabularies in Node.js and browsers. It powers the Mentor VS Code extension, providing structured access to ontologies through a repository pattern and lightweight structural reasoning.

    Access RDF resources through specialized repositories that provide type-safe, SPARQL-free querying:

    • VocabularyRepository – Query ontologies and SKOS concept schemes
    • ClassRepository – Retrieve OWL/RDFS classes with hierarchy traversal
    • PropertyRepository – Access object, datatype, and annotation properties
    • IndividualRepository – Query class instances and their properties
    • ShapeRepository – Work with SHACL node and property shapes

    Built-in reasoners expand your RDF graphs with inferred triples:

    • RdfsReasonerrdfs:subClassOf, rdfs:subPropertyOf, domain/range inference
    • OwlReasoner – OWL class expressions, property characteristics, equivalences
    • SkosReasoner – SKOS concept hierarchies and semantic relations
    • ShaclReasoner – SHACL shape target inference

    An RDF.js-compatible triple store with:

    • Multiple format support: Turtle, N3, N-Triples, N-Quads, TriG, RDF/XML
    • Named graph management
    • Bundled W3C ontologies (RDF, RDFS, OWL, SKOS, SHACL, XSD)

    Works in Node.js (>=16) and modern browsers:

    npm install @faubulous/mentor-rdf
    
    import { Store, VocabularyRepository, OwlReasoner } from '@faubulous/mentor-rdf';

    // Create a store with OWL reasoning
    const store = new Store(new OwlReasoner());

    // Load an ontology
    await store.loadFromTurtleStream(turtleData, 'http://example.org/my-ontology');

    // Query using repositories
    const repository = new VocabularyRepository(store);

    // Get all classes defined in the ontology
    for (const classUri of repository.getClasses('http://example.org/my-ontology')) {
    console.log(classUri);
    }

    // Get class hierarchy (includes inferred subclass relationships)
    const subClasses = repository.getSubClasses('http://example.org/my-ontology', 'http://example.org/MyClass');