aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xload-rdf.scm26
1 files changed, 24 insertions, 2 deletions
diff --git a/load-rdf.scm b/load-rdf.scm
index 3b82d55..aaf1b00 100755
--- a/load-rdf.scm
+++ b/load-rdf.scm
@@ -75,7 +75,6 @@ SET PWD=~s;
ld_dir('/var/lib/data', '*.ttl', '~a');
rdf_loader_run();
CHECKPOINT;
-quit;
"
port
password
@@ -83,6 +82,22 @@ quit;
OPEN_WRITE
"isql"))
+(define (index-data port password)
+ "Index all text data for quicker search"
+ (call-with-pipe
+ (lambda (out)
+ (format out
+ "SET DSN=localhost:~a;
+SET PWD=~s;
+DB.DBA.RDF_OBJ_FT_RULE_ADD (null, null, 'All');
+DB.DBA.VT_INC_INDEX_DB_DBA_RDF_OBJ();
+quit;
+"
+ port
+ password))
+ OPEN_WRITE
+ "isql"))
+
(define (time-thunk thunk)
"Run THUNK and return the time taken in seconds."
(let ((start-time (current-time)))
@@ -119,7 +134,14 @@ quit;
(cut bulk-load-data
(assq-ref connection-settings 'virtuoso-port)
(assq-ref connection-settings 'virtuoso-password)
- %graph-uri)))))
+ %graph-uri)))
+ ;; Index the data
+ (format (current-output-port)
+ "Indexing the data"
+ (time-thunk
+ (cut index-data
+ (assq-ref connection-settings 'virtuoso-port)
+ (assq-ref connection-settings 'virtuoso-password))))))
((arg0 _ ...)
(format (current-error-port) "Usage: ~a CONNECTION-SETTINGS-FILE~%" arg0)
(exit #f))))