hydra.rdf.utils module
Utility functions for working with RDF graphs and descriptions.
- hydra.rdf.utils.descriptions_to_graph(ds: Sequence[Description]) Graph
Convert a list of descriptions to an RDF graph.
- hydra.rdf.utils.empty_description(node: Node_) Description
Create an empty description with a given node.
- hydra.rdf.utils.empty_lang_strings() LangStrings
An empty LangStrings value.
- hydra.rdf.utils.for_objects(subj: Resource, pred: Iri, objs: Sequence[Node_]) Sequence[Triple]
Create triples from a subject, predicate, and list of object nodes.
- hydra.rdf.utils.merge_graphs(graphs: Sequence[Graph]) Graph
Merge a list of RDF graphs into a single graph.
- hydra.rdf.utils.next_blank_node(counter: int) tuple[Resource, int]
Generate the next blank node and an incremented counter.
- hydra.rdf.utils.property_iri(rname: Name, fname: Name) Iri
Construct a property IRI from a record name and field name.
- hydra.rdf.utils.subjects_of(descs: Sequence[Description]) Sequence[Node_]
Extract subjects from a list of descriptions.
- hydra.rdf.utils.triples_of(descs: Sequence[Description]) Sequence[Triple]
Extract all triples from a list of descriptions.