rdf_writer module
- class py_amr2fred.rdf_writer.RdfWriter
Bases:
objectA class for converting a hierarchical structure of nodes into an RDF graph using rdflib.
This class manages RDF graph construction, namespace binding, serialization, and visibility handling.
- static get_uri(var: str) str
Resolves a variable name into a full URI based on predefined namespaces.
- new_graph()
Creates a new RDF graph and a secondary graph for non-visible triples. Also, assigns the namespace manager to both graphs.
- serialize(rdf_format: RdflibMode) str
Serializes the RDF graph into the specified format.
- Parameters:
rdf_format (Glossary.RdflibMode) – The format in which to serialize the RDF graph.
- Returns:
The serialized RDF data as a string.
- Return type: