LOAD

The SPARQL LOAD statement is used to load data to AnzoGraph from files that are in Turtle, N-Triple, N-Quad, or TriG format.

For information about load file directory requirements and load architecture, see Load File Requirements. For more information on the data types thatAnzoGraph uses to store loaded or inserted data, see AnzoGraph Data Type Handling. Also see Loading Data from Files for specific examples and guidance for using the LOAD command on different deployment platforms.

LOAD Syntax

Run the following statement to load data from Turtle, N-Triple, N-Quad, or TriG files.

LOAD [ SILENT ] [ WITH 'leader' | 'compute' | 'global' ] <URL> [ INTO GRAPH <graph_name> ]
Option Description
SILENT Include this optional keyword if you do not want AnzoGraph to return errors during the load.
  • When SILENT is omitted, AnzoGraph aborts the load upon hitting an error and reports the error to the client.
  • When SILENT is specified and AnzoGraph encounters an error, it logs the error to a graph and proceeds with the load. By default, any errors are captured in the <load_errors> graph. After a load completes, you can query the graph to review errors. To customize the load error graph URI, you can change the load_errors_graph setting value in the system configuration file, <install_path>/config/settings.conf. See Changing System Settings for instructions.
WITH 'leader' Include this optional clause when loading files that only the leader server can access. WITH 'leader' is the default value for the LOAD statement. When the WITH clause is omitted, the load proceeds as if WITH 'leader' was specified.
NoteThe "leader" keyword is case-sensitive. Type the term using lower case letters.
WITH 'compute' Include this optional clause when all servers will load files from their local file systems. Use this option if you have arranged the load files so that each AnzoGraph server has a unique subset of files on its local file system.
NoteThe "compute" keyword is case-sensitive. Type the term using lower case letters.
WITH 'global' Include this optional clause when all servers will load a subset of files from directories on a mounted file system. Include this option when every AnzoGraph server in the cluster has visibility to the entire data set. AnzoGraph automatically divides file selection among the servers.
NoteThe "global" keyword is case-sensitive. Type the term using lower case letters.
<URL> Required clause to specify the URL for the server and directory or file that you want to load. When you specify a directory, AnzoGraph loads all valid files in that directory.

For example, this URL loads a single file from the local filesystem:

<file:/home/user/data/tickit.ttl>

This example URL loads a directory of .ttl.gz files on a mounted file system:

<dir:/global/nfs/vpc_nfs_server/data/tickit_all.ttl.gz>
ImportantWhen specifying file: or dir: to load files from a file system, the file system must be accessible from AnzoGraph. In a Docker environment, the file or directory must be stored on the AnzoGraph container file system. For instructions on copying files or directories from a local file system to the AnzoGraph file system in a Docker container, see Loading Files from the AnzoGraph file system in Docker. For more information on loading data into AnzoGraph from HDFS data sources, see Loading Files from HDFS.
INTO GRAPH <graph_name> When loading files such as Turtle or N-Triple files without graph specifications, include this optional clause to specify the graph to load data into. If the graph does not exist, the system automatically creates it and then loads the data into it. If you do not specify a graph, AnzoGraph loads data into the default graph.

You can also include the INTO GRAPH option when loading N-Quad files. If the N-Quad files contain a mixture of quads and triples, AnzoGraph loads the triples into the specified graph. Quads are still loaded according to their graph specification. If you omit this option for N-Quad files, any triples without graph specifications are loaded into the default graph.

Related Topics