4 Writing RDF graphs
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog RDF parser
        • Writing RDF graphs
          • rdf_write_xml/2
Availability::- use_module(library(rdf_write)).(can be autoloaded)
Sourcerdf_write_xml(+Stream, +Triples)
Write an RDF/XML document to Stream from the list of Triples. Stream must use one of the following Prolog stream encodings: ascii, iso_latin_1 or utf8. Characters that cannot be represented in the encoding are represented as XML entities. Using ASCII is a good idea for documents that can be represented almost completely in ASCII. For more international documents using UTF-8 creates a more compact document that is easier to read.
rdf_write(File, Triples) :-
        open(File, write, Out, [encoding(utf8)]),
        call_cleanup(rdf_write_xml(Out, Triples),
                     close(Out)).