Skip to main content

ontocore_core/
lib.rs

1//! Core types, workspace scanning, path sandboxing, and resource limits for OntoCore.
2//!
3//! Published as [`ontocore-core`](https://crates.io/crates/ontocore-core).
4//!
5//! # API stability
6//!
7//! **Pre-1.0:** public types and constants may change between minor releases until
8//! [v1.0 stable core](https://github.com/eddiethedean/ontocode/blob/main/docs/design/v1.0_BACKLOG.md)
9//! is complete. See [workspace limits](https://github.com/eddiethedean/ontocode/blob/main/docs/workspace-limits.md).
10
11pub mod document_lookup;
12pub mod error;
13pub mod io;
14pub mod limits;
15pub mod model;
16pub mod path_jail;
17pub mod quick_fix;
18pub mod rdf_literals;
19pub mod scanner;
20
21pub use document_lookup::{
22    document_for_entity, document_for_ontology_id, document_matches_entity,
23    document_matches_ontology_id, file_uri_for_path, normalize_iri,
24};
25pub use error::{OntoCoreError, Result};
26pub use io::{read_file_capped, read_to_string_capped};
27pub use limits::{
28    MAX_ENTITIES, MAX_FILE_BYTES, MAX_OPEN_DOCUMENTS, MAX_QUERY_BYTES, MAX_SCAN_FILES,
29    MAX_SCAN_WALK_ENTRIES, MAX_SPARQL_RESULT_ROWS, MAX_SQL_RESULT_ROWS, MAX_TOTAL_TRIPLES,
30    MAX_TRIPLES_PER_FILE,
31};
32pub use model::{
33    Annotation, Axiom, Diagnostic, DiagnosticCode, DiagnosticSeverity, Entity, EntityKind, Import,
34    Namespace, OntologyDocument, OntologyFormat, ParseStatus, PropertyCharacteristics,
35    SourceLocation, AXIOM_KIND_CLASS_ASSERTION, AXIOM_KIND_DATA_PROPERTY_ASSERTION,
36    AXIOM_KIND_DISJOINT_CLASS, AXIOM_KIND_DOMAIN, AXIOM_KIND_EQUIVALENT_CLASS,
37    AXIOM_KIND_OBJECT_PROPERTY_ASSERTION, AXIOM_KIND_PROPERTY_CHAIN, AXIOM_KIND_RANGE,
38    AXIOM_KIND_SUB_CLASS_OF,
39};
40pub use path_jail::{
41    canonical_workspace_root, discover_git_repo_root, ensure_extract_path_within, file_uri_to_path,
42    is_path_within, is_path_within_any, resolve_document_path, resolve_lsp_document_path,
43    resolve_lsp_document_path_any, validate_workspace_scope, validate_workspace_scope_any,
44    workspace_uri_to_path,
45};
46pub use quick_fix::QuickFix;
47pub use rdf_literals::parse_boolean_literal;
48pub use scanner::{OntologyFile, WorkspaceScanner};