algebraixlib.import_export.rdf module

Import and export facilities for RDF data.

algebraixlib.import_export.rdf.import_graph()[source]

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).
Parameters:
  • 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.
Returns:

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

algebraixlib.import_export.rdf.export_table()[source]

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.

Parameters: