- library
- semweb
- rdf_db.pl -- Core RDF database
- rdf_cache.pl -- Cache RDF triples
- rdfs.pl -- RDFS handling
- rdf_persistency.pl -- RDF persistency plugin
- rdf_litindex.pl -- Search literals
- rdf_ntriples.pl -- Process files in the RDF N-Triples format
- rdf11.pl -- RDF 1.1 API
- sparql_client.pl -- SPARQL client library
- turtle.pl -- Turtle: Terse RDF Triple Language
- rdf_turtle_write.pl -- Turtle - Terse RDF Triple Language writer
- rdf_http_plugin.pl -- RDF HTTP Plugin
- rdf_library.pl -- RDF Library Manager
- rdf_zlib_plugin.pl -- RDF compressed-data plugin
- semweb
- rdf_save_turtle(+Out, :Options) is det
- Save an RDF graph as Turtle. Options processed are:
- a(+Boolean)
- If
true
(default), usea
for the predicaterdf:type
. Otherwise use the full resource. - align_prefixes(+Boolean)
- Nicely align the @prefix declarations
- base(+Base)
- Save relative to the given Base
- canonize_numbers(+Boolean)
- If
true
(defaultfalse
), emit numeric datatypes using Prolog's write to achieve canonical output. - comment(+Boolean)
- It
true
(default), write some informative comments between the output segments - encoding(+Encoding)
- Encoding used for the output stream. Default is UTF-8.
- expand(:Goal)
- Query an alternative graph-representation. See below.
- indent(+Column)
- Indentation for ; -lists. `0' does not indent, but writes on the same line. Default is 8.
- graph(+Graph)
- Save only the named graph
- group(+Boolean)
- If
true
(default), using P-O and O-grouping. - inline_bnodes(+Boolean)
- if
true
(default), inline bnodes that are used once. - abbreviate_literals(+Boolean)
- if
true
(default), omit the type if allowed by turtle. - only_known_prefixes(+Boolean)
- Only use prefix notation for known prefixes. Without, some documents produce huge amounts of prefixes.
- prefixes(+List)
- If provided, uses exactly these prefixes. List is a list of prefix specifications, where each specification is either a term Prefix_-_URI or a prefix that is known to rdf_current_prefix/2.
- silent(+Boolean)
- If
true
(defaultfalse
), do not print the final informational message. - single_line_bnodes(+Bool)
- If
true
(defaultfalse
), write [...] and (...) on a single line. - subject_white_lines(+Count)
- Extra white lines to insert between statements about a different subject. Default is 1.
- tab_distance(+Tab)
- Distance between tab-stops. `0' forces the library to use only spaces for layout. Default is 8.
- user_prefixes(+Boolean)
- If
true
(default), use prefixes from rdf_current_prefix/2.
The option
expand
allows for serializing alternative graph representations. It is called through call/5, where the first argument is the expand-option, followed by S,P,O,G. G is the graph-option (which is by default a variable). This notably allows for writing RDF graphs represented asrdf(S,P,O)
using the following code fragment:triple_in(RDF, S,P,O,_G) :- member(rdf(S,P,O), RDF). ..., rdf_save_turtle(Out, [ expand(triple_in(RDF)) ]),
- Arguments:
-
Out - is one of stream(Stream)
, a stream handle, a file-URL or an atom that denotes a filename.