Wikidata import 2024-10-28 Virtuoso

From BITPlan cr Wiki
Revision as of 10:57, 3 November 2024 by Th (talk | contribs) (Created page with " == Storage Overview == <syntaxhighlight lang="bash"> ./hd/gamma/virtuoso ├── docker-compose.yml ├── scripts └── 10-bulkload.sql └── wikidata...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Storage Overview

./hd/gamma/virtuoso
├── docker-compose.yml
├── scripts
    └── 10-bulkload.sql
└── wikidata
    └── data
        └── latest-all.nt.bz2
        └── latest-all.nt.graph

Providing the Wikidata Dump

Downloading the Dump

$wget https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.nt.bz2

Splitting the Dump

To load the dump in parallel into Virtuoso we need to split the dump into several files.

$bzip2 -dk latest-all.nt.bz2
$ split -l 5 -d --additional-suffix ".nt" ./latest-all.nt wd-dump-chunk-


Virtuoso Docker

The password DBA_PASSWORD needs to be set before starting the docker container the first time.

version: "1.0"
services:
  virtuoso_db:
    container_name: wd_virtuoso
    image: openlink/virtuoso-opensource-7
    volumes:
      - ./data:/database/data
      - ./scripts:/opt/virtuoso-opensource/initdb.d
    environment:
      - DBA_PASSWORD=dba
      - VIRT_PARAMETERS_NUMBEROFBUFFERS=5450000
      - VIRT_PARAMETERS_MAXDIRTYBUFFERS=4000000
    ports:
      - "1111:1111"
      - "9700:8890"


Adjusted buffer size to 64GB of Memory usage (see https://vos.openlinksw.com/owiki/wiki/VOS/VirtRDFPerformanceTuning)

Bulk load script: 10-bulkload.sql

--
--  Copyright (C) 2022 OpenLink Software
--

--
--  Add all files that end in .nt
--
ld_dir_all ('data', '*.nt', NULL)
;

--
--  Add all files that end in .bz2, .gz, or .xz, to show that the Virtuoso bulk loader 
--  can load compressed files without manual decompression
--
ld_dir_all ('data', '*.bz2', NULL)
;

ld_dir_all ('data', '*.gz', NULL)
;

ld_dir_all ('data', '*.xz', NULL)
;

--
--  Now load all of the files found above into the database
--
rdf_loader_run()
;

--
--  End of script
--


Starting Docker Container and Bulk-load

Starting a new screen session

$screen -S wd_virtuoso

Stating the docker container

$docker compose up


Started the import at 2024-10-29T10:50:00 Load completed at 2024-11-01T12:13:43