aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/matcher/nodes.py
blob: 047e7d1bdd49a49ddf33dab851c3d6cb387cbafa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

# standard imports
from dataclasses import dataclass
import typing

# bsie imports
from bsie.utils import bsfs, ns

# exports
__all__: typing.Sequence[str] = (
    'Entity',
    'Face',
    'Node',
    'Person',
    'Preview',
    'Tag',
    )

@dataclass(kw_only=True, unsafe_hash=True)
class Node: # pylint: disable=missing-class-docstring
    # FIXME: Only allow changes to uri after init
    uri: typing.Optional[bsfs.URI] = None

@dataclass(kw_only=True, unsafe_hash=True)
class Entity(Node): # pylint: disable=missing-class-docstring
    node_type: bsfs.URI = ns.bsn.Entity
    ucid: str

@dataclass(kw_only=True, unsafe_hash=True)
class Face(Node): # pylint: disable=missing-class-docstring
    node_type: bsfs.URI = ns.bsn.Face
    ucid: str

@dataclass(kw_only=True, unsafe_hash=True)
class Person(Node): # pylint: disable=missing-class-docstring
    node_type: bsfs.URI = ns.bsn.Person

@dataclass(kw_only=True, unsafe_hash=True)
class Preview(Node): # pylint: disable=missing-class-docstring
    node_type: bsfs.URI = ns.bsn.Preview
    ucid: str
    size: int

@dataclass(kw_only=True, unsafe_hash=True)
class Tag(Node): # pylint: disable=missing-class-docstring
    node_type: bsfs.URI = ns.bsn.Tag
    label: str

## EOF ##