from pathlib import Path
from typing import Optional, List, Union, Tuple, Dict
from rdflib import Graph, Dataset
from rdflib.query import Result
from rdflib.store import Store
version: str
class Ontology:
@property
def id(self) -> str: ...
@property
def name(self) -> str: ...
@property
def imports(self) -> List[str]: ...
@property
def location(self) -> Optional[str]: ...
@property
def last_updated(self) -> Optional[str]: ...
@property
def version_properties(self) -> Dict[str, str]: ...
@property
def namespace_map(self) -> Dict[str, str]: ...
def __repr__(self) -> str: ...
class OntoEnv:
def __init__(
self,
path: Optional[Union[str, Path]] = None,
recreate: bool = False,
create_or_use_cached: bool = False,
read_only: bool = False,
search_directories: Optional[List[str]] = None,
require_ontology_names: bool = False,
strict: bool = False,
offline: bool = False,
use_cached_ontologies: bool = False,
resolution_policy: str = "default",
root: str = ".",
includes: Optional[List[str]] = None,
excludes: Optional[List[str]] = None,
include_ontologies: Optional[List[str]] = None,
exclude_ontologies: Optional[List[str]] = None,
temporary: bool = False,
remote_cache_ttl_secs: Optional[int] = None,
graph_store: Optional[object] = None,
init_from_store: bool = False,
) -> None:
...
def __repr__(self) -> str: ...
def update(self, all: bool = False) -> None:
...
def refresh_from_store(self) -> None:
...
def add(
self,
location: Union[str, Path, Graph],
overwrite: bool = False,
fetch_imports: bool = True,
force: bool = False,
) -> str:
...
def add_no_imports(
self,
location: Union[str, Path, Graph],
overwrite: bool = False,
force: bool = False,
) -> str:
...
def get_graph(self, uri: str) -> Graph:
...
def get_ontology(self, uri: str) -> Ontology:
...
def get_ontology_names(self) -> List[str]:
...
def get_importers(self, uri: str) -> List[str]:
...
def list_closure(
self,
uri: Union[str, Graph],
recursion_depth: int = -1,
) -> List[str]:
...
def get_closure(
self,
uri: str,
destination_graph: Optional[Graph] = None,
rewrite_sh_prefixes: bool = True,
remove_owl_imports: bool = True,
recursion_depth: int = -1,
) -> Tuple[Graph, List[str]]:
...
def import_graph(
self,
destination_graph: Graph,
uri: str,
recursion_depth: int = -1,
) -> None:
...
def import_dependencies(
self,
graph: Graph,
recursion_depth: int = -1,
fetch_missing: bool = False,
) -> List[str]:
...
def get_dependencies(
self,
graph: Graph,
graph_name: Optional[str] = None,
recursion_depth: int = -1,
fetch_missing: bool = False,
) -> Tuple[Graph, List[str]]:
...
def missing_imports(
self,
uri: Optional[Union[str, Graph]] = None,
) -> List[str]:
...
def get_namespaces(
self,
ontology: Optional[str] = None,
include_closure: bool = False,
) -> Dict[str, str]:
...
def snapshot_as_dataset(
self,
backend: str = "auto",
store: Optional[Store] = None,
) -> Dataset:
...
def to_rdflib_dataset(self, mode: str = "auto") -> Dataset:
...
def dump(self, includes: Optional[str] = None) -> None:
...
def is_offline(self) -> bool: ...
def set_offline(self, offline: bool) -> None: ...
def is_strict(self) -> bool: ...
def set_strict(self, strict: bool) -> None: ...
def requires_ontology_names(self) -> bool: ...
def set_require_ontology_names(self, require: bool) -> None: ...
def resolution_policy(self) -> str: ...
def set_resolution_policy(self, policy: str) -> None: ...
def store_path(self) -> Optional[str]: ...
def flush(self) -> None: ...
def close(self) -> None: ...
class OntoEnvStore:
def __init__(self, configuration: Optional[str] = None, identifier: Optional[object] = None) -> None: ...
@classmethod
def from_env(cls, env: OntoEnv, mode: str = "auto") -> OntoEnvStore: ...
def open(self, configuration: Optional[str], create: bool = False) -> int: ...
def close(self, commit_pending_transaction: bool = False) -> None: ...
def destroy(self, configuration: str) -> None: ...
def refresh_from_env(self, env: OntoEnv, mode: Optional[str] = None) -> None: ...
def add(self, triple: Tuple[object, object, object], context: object, quoted: bool = False) -> None: ...
def addN(self, quads: List[Tuple[object, object, object, object]]) -> None: ...
def remove(self, triple_pattern: Tuple[Optional[object], Optional[object], Optional[object]], context: Optional[object] = None) -> None: ...
def triples(self, triple_pattern: Tuple[Optional[object], Optional[object], Optional[object]], context: Optional[object] = None) -> object: ...
def contexts(self, triple: Optional[Tuple[object, object, object]] = None) -> object: ...
def query(self, query: object, initNs: Dict[str, object], initBindings: Dict[str, object], queryGraph: str, **kwargs: object) -> Result: ...
def dataset_from_env(env: OntoEnv, store: Optional[object] = None, mode: str = "auto") -> Dataset: ...
def refresh_dataset_from_env(dataset: Dataset, env: OntoEnv) -> None: ...