Not logged in : Login

About: VirtBulkRDFLoader     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : vos.openlinksw.com associated with source document(s)

AttributesValues
type
Date Created
Date Modified
label
  • VirtBulkRDFLoader
maker
Title
  • VirtBulkRDFLoader
isDescribedUsing
has creator
content
  • ---+ Bulk Loading RDF Source Files into one or more Graph IRIs This document details how large RDF data set files can be bulk loaded into Virtuoso. The data sets may consist of multiple files, which may be loaded into one or several graphs. %TOC% ---++ Prerequisites * The Virtuoso Bulk Loader functions must be present. They are pre-loaded starting with commercial version 06.02.3129 and open source version 6.1.3, but must be [[VirtBulkRDFLoaderScript][manually loaded into older versions]]. * The directory containing the data set files must be included in the [[http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#fp_acliniallowed][DirsAllowed]] parameter defined in the virtuoso INI file, after which the Virtuoso server must be restarted. * The Virtuoso Server should be appropriately configured to use sufficient memory and other system resources as detailed in the [[VirtRDFPerformanceTuning][Virtuoso RDF Performance Tuning Guide]], or the load may take an unacceptably long time, approaching forever. * The file formats and file name extensions of the files to be loaded must be among the following, which the [[http://docs.openlinksw.com/virtuoso/fn_rdf_loader_run.html][rdf_loader_run()]] function understands. Any of these may be compressed in gzip (i.e., with the additional .gz file name extension), bz2 or xz compression formats to save space; in such case, they will be automatically expanded by the bulk loader. | .grdf | Geospatial RDF | | .nq | [[http://dbpedia.org/resource/N-Quads][N-Quads]] | | .nt | [[http://dbpedia.org/resource/N-Triples][N-Triples]] | | .owl | [[http://dbpedia.org/resource/Web_Ontology_Language][OWL]] | | .rdf | [[http://dbpedia.org/resource/RDF/XML][RDF/XML]] | | .trig | [[http://dbpedia.org/resource/TriG_(syntax)][TriG]] | | .ttl | [[http://dbpedia.org/resource/Turtle_(syntax)][Turtle]] | | .xml | [[http://dbpedia.org/resource/RDF/XML][RDF/XML]] | ---++ Bulk loading process 1 The name of the RDF graph into which the data set(s) should be loaded can be specified through a text file placed in the same source directory as the source data files. This file's contents will override any options specified in the [[http://docs.openlinksw.com/virtuoso/fn_ld_dir.html][ld_dir()]] or [[http://docs.openlinksw.com/virtuoso/fn_ld_dir_all.html][ld_dir_all()]] function call. The content of a file with the same name as a data file plus the .graph filename extension will be used for that data file (e.g., my_data.n3.graph will be used with my_data.n3). The content of a file named global.graph will be used for any and all other data files in that directory. %BR%%BR%Note: if the third parameter (graph_iri) of [[http://docs.openlinksw.com/virtuoso/fn_ld_dir.html][ld_dir()]] or [[http://docs.openlinksw.com/virtuoso/fn_ld_dir_all.html][ld_dir_all()]] is NULL, any data files that do not have a corresponding .graph file will not be loaded.. If datasets are *NQUAD* or *TRIG* then the graph name specified in such dataset files in quad format will *always* be used. . ..graph global.graph — e.g., — myfile.n3 ;; RDF data myfile.n3.graph ;; Contains Graph IRI name into which RDF data from myfile.n3 will be loaded global.graph ;; Contains Graph IRI name into which RDF data from any files that do not have a specific graph name file will be loaded 1 Place the graph IRI, , e.g., http://dbpedia.org, in the *.graph file. 1 Use isql to register the file(s) to be loaded by running the appropriate function, e.g. -- SQL> ld_dir ('/path/to/files', '*.n3', 'http://dbpedia.org'); * [[http://docs.openlinksw.com/virtuoso/fn_ld_dir.html][ld_dir()]] to load only from the specified directory, excluding any subdirectories -- SQL> ld_dir ('', '', 'graph iri'); * [[http://docs.openlinksw.com/virtuoso/fn_ld_dir.html][ld_dir_all()]] to load from the specified directory, including any and all subdirectories -- SQL> ld_dir_all ('', '', 'graph iri'); 1 The table DB.DBA.load_list can be used to check the list of data sets registered for loading, and the graph IRIs into which they will be or have been loaded. The ll_state field can have three values: 0 indicating the data set is to be loaded; 1 the data set load is in progress; or 2 the data set load is complete: SQL> select * from DB.DBA.load_list; ll_file ll_graph ll_state ll_started ll_done ll_host ll_work_time ll_error VARCHAR NOT NULL VARCHAR INTEGER TIMESTAMP TIMESTAMP INTEGER INTEGER VARCHAR _____________________________________________________________________________________________________________________________________ ./dump/d1/file1.n3 http://file1 2 2010.10.20 9:21.18 0 2010.10.20 9:21.18 0 0 NULL NULL ./dump/d2/file2.n3 http://file2 2 2010.10.20 9:21.18 0 2010.10.20 9:21.18 0 0 NULL NULL ./dump/file.n3 http://file 2 2010.10.20 9:21.18 0 2010.10.20 9:21.18 0 0 NULL NULL 3 Rows. -- 1 msec. SQL> 1 Finally, perform the bulk load of all data by executing the [[http://docs.openlinksw.com/virtuoso/fn_rdf_loader_run.html][rdf_loader_run()]] function: SQL> rdf_loader_run(); * Note: the rdf_loader_run() function prototype is: rdf_loader_run ( IN max_files INTEGER := NULL , IN log_enable INT := 2 ) One of the side effects of the default log_enable = 2 setting is that triggers are disabled, to speed the loading of data. If triggers are required (e.g., for RDF Graph replication between nodes), then the log_enable mode should be set to 3 when calling the rdf_loader_run() function as follows: rdf_loader_run (log_enable=>3); 1 Note at the end of the Bulk Load process the checkpoint command *MUST* be run to commit the bulk loaded data to the Virtuoso database file. This is because the default log_enable = 2 mode used by the bulk loader turns off transaction logging, thus if the database is shutdown before a checkpoint is run all the bulk loaded data would be lost. The bulk loader also disables checkpointing and the scheduler, which also need to be re-enabled post bulk load. checkpoint; checkpoint_interval(N); scheduler_interval(M); ---+++ Running multiple Loaders On a multi-core machine, it is recommended that data sets be split into multiple files, and that these be registered in the DB.DBA.load_list table with the ld_dir() function. Once registered for load, the rdf_loader_run() function can be run multiple times, it is recommended a maximum of no cores / 2.5, to optimally parallelize the data load and hence maximize load speed. A typical script that can be run from command line (e.g., bulk_load.sh) might look like -- . /opt/openlink/virtuoso/virtuoso-enterprise.sh isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & isql 1111 dba dba exec="rdf_loader_run();" & wait isql 1111 dba dba exec="checkpoint;" and be run with the command: sh /opt/openlink/virtuoso/bin/bulk_load.sh ---++ Stopping the bulk load process 1 All RDF loader threads can be stopped using the command [[http://docs.openlinksw.com/virtuoso/fn_rdf_load_stop.html][rdf_load_stop()]], at which point all currently running threads will be allowed to complete and then exit: SQL> rdf_load_stop(); ---++ Checking bulk load status 1 Once the rdf_loader_run() is complete, you can check the DB.DBA.load_list to confirm all data sets were loaded successfully. This is indicated by an ll_state value of 2 and an ll_error value of NULL.
    Note: The following query can be used to check if any errors occurred when loading datasets file during the bulk load: select * from DB.DBA.LOAD_LIST where ll_error IS NOT NULL ---++ Cluster-specific details 1 On a Virtuoso Clustered Server the "cl_exec('rdf_ld_srv(log_enable)')" commands (where log_enable is 2 or 3, as with the rdf_loader_run() function) can be used to invoke a single "rdf_loader_run()" on each node of the cluster: SQL> cl_exec('rdf_ld_srv()'); Done. -- 265956 msec. SQL> ---++ Related * [[VirtBulkRDFLoaderExampleSingle][Example of single file load]] * [[VirtBulkRDFLoaderExampleMultiple][Example of multiple file load]] * [[VirtBulkRDFLoaderExampleDbpedia][Example of Dbpedia datasets load]] * [[VirtRDFBulkLoaderWithDelete][Virtuoso RDF Bulk Update "with_delete" option]] * [[VirtTipsAndTricksGraphLoadTimes][How can I determine the time taken to load datasets with RDF Bulk Loader]]
id
  • df37b0d19f13f440c82efa7553d8329e
link
has container
atom:title
  • VirtBulkRDFLoader
atom:source
atom:author
atom:published
  • 2018-04-13T12:05:45Z
atom:updated
  • 2019-11-14T11:20:05Z
is made of
is container of of
is link of
is links to of
is creator of of
is atom:entry of
is atom:contains of
Faceted Search & Find service v1.17_git150 as of Jan 20 2025


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3332 as of Sep 11 2024, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (15 GB total memory, 865 MB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2025 OpenLink Software