25 lines
617 B
Python
25 lines
617 B
Python
|
from dataclasses import dataclass, field
|
||
|
from itertools import count
|
||
|
|
||
|
from rdflib import BNode
|
||
|
from rdflib.graph import _QuadType as QuadType
|
||
|
|
||
|
from rdf_canonize.types import Hash, BNodeIDMapType, CanonicalIDMapType
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class CanonicalIssuer:
|
||
|
prefix: str = 'c14n'
|
||
|
counter: count = count()
|
||
|
issued_identifiers: CanonicalIDMapType = field(default_factory=dict)
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class CanonicalizationState:
|
||
|
bnode_quads: dict[BNode, list[QuadType]] = field(default_factory=dict)
|
||
|
hash_bnodes: dict[Hash, list[BNode]] = field(default_factory=dict)
|
||
|
issuer: CanonicalIssuer = CanonicalIssuer()
|
||
|
|
||
|
|
||
|
|