Skip to content
Wouter Beek edited this page Dec 30, 2015 · 1 revision

1 Uniform API for parsers/writers

Observations:

  • Reading/writing RDF files is currently spread over multiple modules.

Proposals:

  • Core predicates:
    • rdf_load(+Input, +Options)
    • rdf_save(+Input, +Options)
  • Wrapper predicates:
    • rdf_load(+Input)
    • rdf_save(+Input)
  • Properties or rdf_load/[1,2] and rdf_save/[1,2]:
    • Using open_any/5 and close_any/1, Input can a (1) file, (2) stream, or (3) HTTP(S) IRI.
    • Using archive_data_stream/3, all archive streams of Input are processed in sequence.
  • Properties of rdf_load/[1,2]:
    • If format(-) then use rdf_guess_format/3 to determine the serialization format.
    • If Input is an HTTP(S) IRI then option base_iri is automatically set.
    • Option format(?) can either be used to set a serialization format or it can be used to return the serialization format that was heuristically found.

Notes:

  • Format guessing should probably be part of a new library, keeping the plugin based infrastructure for library rdf_db.

2 Loading named graphs

Observations:

  • rdf_load(+Input, +Options) with option graph(+Graph) does not make clear where quadruples are stored?
  • rdf_save(+Input, +Options) with option graph(+Graph) does not allow a collection graphs to be saved to a quadruples file.

Proposal:

  • For rdf_load/2 option dataset(-Default:atom, -Named:list(atom)) returns the graphs that data has be loaded into (i.e., Named=[] for triples).
  • For rdf_save/2 option dataset(+Default:atom, +Named:list(atom)) allows a subset of the currently loaded graphs to be saved to file.
  • Option graph(?) is a shorthand for option dataset(?,[]).

3 Serialization format-specific parsers/writers

Proposal:

  • Rename predicates used for loading/saving XML/RDF:
    • rdf_load/[1,2]rdf_xml_load/[1,2]
    • rdf_save/[1,2]rdf_xml_save/[1,2]
    • rdf_save_footer/1rdf_xml_save_footer/1
    • rdf_save_header/2rdf_xml_save_header/2
    • rdf_save_subject/3rdf_xml_save_subject/3

4 Missing parsers/generators

The following formats are not supported:

  • JSON-LD
  • N3