algebraixlib.import_export.rdf module

Import and export facilities for RDF data.


Return an absolute clan that represents the RDF graph graph_file_or_filepath.

  • The graph is represented by a regular, absolute clan.
  • The left components are ‘s’ (subject), ‘p’ (predicate) and ‘o’ (object) (see triple).
  • Blank nodes are converted to IRIs (skolemization).
  • URI references are represented as rdflib.URIRef instances (embedded in an Atom).
  • Literals are converted to intuitive native Python types (embedded in an Atom).
  • graph_file_or_filepath – A string that is a path (relative or absolute) to the file to be imported, or a file object (like StringIO).
  • rdf_format – The format of the RDF graph that is being imported. See Pluginparsers for a list of supported formats and their corresponding strings. If none is given, the file name’s extension is used to guess a format. If that fails, Turtle is used as default.

An absolute clan that represents the RDF graph that has been imported.


Return a serialized table as string in a supported RDF format for table serialization.

Limitations: - Leading ‘?’ and ‘$’ are not stripped from lefts (variable names). - Non-printable characters are backslash-escaped. - table must be an absolute graph.