Coverage for oc_ocdm / _types.py: 100%
24 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-07-06 20:05 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-07-06 20:05 +0000
1# SPDX-FileCopyrightText: 2026 Arcangelo Massari <arcangelo.massari@unibo.it>
2#
3# SPDX-License-Identifier: ISC
5from __future__ import annotations
7from typing import TypeAlias, TypedDict
9from rdflib import Literal, URIRef
10from rdflib.term import Node
11from triplelite import Triple
13JsonScalar: TypeAlias = str | int | float | bool | None
14JsonValue: TypeAlias = JsonScalar | list["JsonValue"] | dict[str, "JsonValue"]
15JsonObject: TypeAlias = dict[str, JsonValue]
16JsonLdDocument: TypeAlias = list[JsonObject]
17ContextMap: TypeAlias = dict[str, str | JsonObject]
18RdfLibObject: TypeAlias = URIRef | Literal
19RdfLibTriple: TypeAlias = tuple[Node, Node, Node]
20RdfLibQuad: TypeAlias = tuple[URIRef, URIRef, RdfLibObject, URIRef | None]
21SparqlBinding: TypeAlias = dict[str, str]
22SparqlResultRow: TypeAlias = dict[str, SparqlBinding]
23SparqlResultRows: TypeAlias = list[SparqlResultRow]
24TripleSet: TypeAlias = set[Triple]
25FrozenTripleSet: TypeAlias = frozenset[Triple]
28class SparqlResults(TypedDict):
29 bindings: SparqlResultRows
32class SparqlAskResult(TypedDict):
33 boolean: bool
36class SparqlQueryResult(TypedDict):
37 results: SparqlResults