- library
- semweb
- rdf_db.pl -- Core RDF database
- rdf_prefixes.pl -- RDF prefixes management
- rdfs.pl -- RDFS handling
- rdf11.pl -- RDF 1.1 API
- rdf_persistency.pl -- RDF persistency plugin
- rdf_litindex.pl -- Search literals
- rdf_ntriples.pl -- Process files in the RDF N-Triples format
- sparql_client.pl -- SPARQL client library
- rdf_http_plugin.pl -- RDF HTTP Plugin
- rdf_turtle_write.pl -- Turtle - Terse RDF Triple Language writer
- turtle.pl -- Turtle: Terse RDF Triple Language
- rdf_library.pl -- RDF Library Manager
- rdf_sandbox.pl -- Declare RDF API sandbox-safe
- rdf_cache.pl -- Cache RDF triples
- rdf_zlib_plugin.pl -- RDF compressed-data plugin
- semweb
- rdf_read_turtle(+Input, -Triples, +Options)
- Read a stream or file into a set of triples or quadruples (if
faced with TriG input) of the format
rdf(Subject, Predicate, Object [, Graph])
The representation is consistent with the SWI-Prolog RDF/XML and ntriples parsers. Provided options are:
- base_uri(+BaseURI)
- Initial base URI. Defaults to file://<file> for loading files.
- anon_prefix(+Prefix)
- Blank nodes are generated as <Prefix>1, <Prefix>2, etc.
If Prefix is not an atom blank nodes are generated as
node(1)
,node(2)
, ... - format(+Format)
- One of
auto
(default),turtle
ortrig
. The auto mode switches to TriG format of there is a{
before the first triple. Finally, of the format is explicitly stated asturtle
and the file appears to be a TriG file, a warning is printed and the data is loaded while ignoring the graphs. - resources(URIorIRI)
- Officially, Turtle resources are IRIs. Quite a
few applications however send URIs. By default we
do URI->IRI mapping because this rarely causes errors.
To force strictly conforming mode, pass
iri
. - prefixes(-Pairs)
- Return encountered prefix declarations as a list of Alias-URI
- namespaces(-Pairs)
- Same as
prefixes(Pairs)
. Compatibility to rdf_load/2. - base_used(-Base)
- Base URI used for processing the data. Unified to [] if there is no base-uri.
- on_error(+ErrorMode)
- In
warning
(default), print the error and continue parsing the remainder of the file. Iferror
, abort with an exception on the first error encountered. - error_count(-Count)
- If
on_error(warning)
is active, this option cane be used to retrieve the number of generated errors.
- Arguments:
-
Input - is one of stream(Stream)
,atom(Atom)
, ahttp
,https
orfile
url or a filename specification as accepted by absolute_file_name/3.