-
Notifications
You must be signed in to change notification settings - Fork 15
Load and save
Wouter Beek edited this page Dec 30, 2015
·
1 revision
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]
andrdf_save/[1,2]
:- Using
open_any/5
andclose_any/1
,Input
can a (1) file, (2) stream, or (3) HTTP(S) IRI. - Using
archive_data_stream/3
, all archive streams ofInput
are processed in sequence.
- Using
- Properties of
rdf_load/[1,2]
:- If
format(-)
then userdf_guess_format/3
to determine the serialization format. - If
Input
is an HTTP(S) IRI then optionbase_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.
- If
Notes:
- Format guessing should probably be part of a new library, keeping the plugin based infrastructure for library
rdf_db
.
Observations:
-
rdf_load(+Input, +Options)
with optiongraph(+Graph)
does not make clear where quadruples are stored? -
rdf_save(+Input, +Options)
with optiongraph(+Graph)
does not allow a collection graphs to be saved to a quadruples file.
Proposal:
- For
rdf_load/2
optiondataset(-Default:atom, -Named:list(atom))
returns the graphs that data has be loaded into (i.e.,Named=[]
for triples). - For
rdf_save/2
optiondataset(+Default:atom, +Named:list(atom))
allows a subset of the currently loaded graphs to be saved to file. - Option
graph(?)
is a shorthand for optiondataset(?,[])
.
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/1
→rdf_xml_save_footer/1
-
rdf_save_header/2
→rdf_xml_save_header/2
-
rdf_save_subject/3
→rdf_xml_save_subject/3
-
The following formats are not supported:
- JSON-LD
- N3