Node

class Node(*, id: str, lbl: str | None = None, meta: Meta | None = None, type: typing_extensions.Literal[CLASS, PROPERTY, INDIVIDUAL], reference: Reference | None = None, standardized: bool = False)[source]

Bases: BaseModel, StandardizeMixin

Represents a node in an OBO Graph.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes Summary

alternative_ids

Get the alernative identifiers for this node.

created_by

Get the creator of the node.

creation_date

Get the creation date of the node.

curie

Get the CURIE string representing this node or error if not normalized.

definition

Get the definition of the node.

definition_provenance

Get the provenance CURIEs for the definition.

deprecated

Get if the node is deprecated.

identifier

Get the identifier for the node if it has been standardized.

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

namespace

Get the OBO namespace.

prefix

Get the prefix for the node if it has been standardized.

properties

Get the properties for this node.

replaced_by

Get the identifier that this node was replaced by.

synonyms

Get the synonyms for the node.

xrefs

Get the xrefs for the node.

Methods Summary

get_provenance()

Get provenance CURIEs from definition and xrefs.

parse_curie()

Parse the identifier into a pair, assuming it's a CURIE.

standardize()

Ground the node to a standard prefix and luid based on its id (URI).

Attributes Documentation

alternative_ids

Get the alernative identifiers for this node.

created_by

Get the creator of the node.

creation_date

Get the creation date of the node.

curie

Get the CURIE string representing this node or error if not normalized.

definition

Get the definition of the node.

definition_provenance

Get the provenance CURIEs for the definition.

deprecated

Get if the node is deprecated.

identifier

Get the identifier for the node if it has been standardized.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'id': FieldInfo(annotation=str, required=True, description='The IRI for the node'), 'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, alias='lbl', alias_priority=2, description='The name of the node'), 'reference': FieldInfo(annotation=Union[Reference, NoneType], required=False), 'standardized': FieldInfo(annotation=bool, required=False, default=False, exclude=True), 'type': FieldInfo(annotation=Literal['CLASS', 'PROPERTY', 'INDIVIDUAL'], required=True, description='Type of node')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

namespace

Get the OBO namespace.

prefix

Get the prefix for the node if it has been standardized.

properties

Get the properties for this node.

replaced_by

Get the identifier that this node was replaced by.

synonyms

Get the synonyms for the node.

xrefs

Get the xrefs for the node.

Methods Documentation

get_provenance() List[Reference][source]

Get provenance CURIEs from definition and xrefs.

parse_curie() Tuple[str, str] | Tuple[None, None][source]

Parse the identifier into a pair, assuming it’s a CURIE.

standardize() Self[source]

Ground the node to a standard prefix and luid based on its id (URI).