Created
January 9, 2015 14:11
-
-
Save dvcama/679a9034acb165f3f43b to your computer and use it in GitHub Desktop.
virtuoso : load all graphs (triple dump)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE load_graphs | |
( IN dir VARCHAR := '{WRITE HERE YOUR EXPORT PATH (allowed dir in virtuoso.ini)}' ) | |
{ | |
DECLARE arr ANY; | |
DECLARE g VARCHAR; | |
arr := sys_dirlist (dir, 1); | |
log_enable (2, 1); | |
FOREACH (VARCHAR f IN arr) DO | |
{ | |
IF (f LIKE '*.ttl') | |
{ | |
DECLARE CONTINUE HANDLER FOR SQLSTATE '*' | |
{ | |
log_message (sprintf ('Error in %s', f)); | |
}; | |
g := file_to_string (dir || '/' || f || '.graph'); | |
dbg_printf ('g is %s', "g"); | |
DB.DBA.TTLP_MT (file_open (dir || '/' || f), g, g, 255); | |
} | |
} | |
EXEC ('CHECKPOINT'); | |
} | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment