ucd-library / jena-docker

Docker image for Apache Jena riot
Apache License 2.0
0 stars 0 forks source link

Allow for database initializations on input #2

Open qjhart opened 4 years ago

qjhart commented 4 years ago

The new init-dbs branch includes code that allows for databases to be initialized on startup. For example, if your use the following docker-compse file

version: '3.5'
  fuseki:
    image: ucdlib/jena-fuseki:3.14.0
    env_file:
      - ld.yml.env
    volumes:
      - fuseki-data:/fuseki
      - ./staging:/staging
    ports:
      - 3030:3030
volumes:
  fuseki-data:
    driver: local

Than any directories in the staging directory will be checked for databases and installed if they do not already exist. Any example directory would look like:

covid19
├── add_users.sparql-update
├── config.ttl
├── http%3A%2F%2Fiam.ucdavis.edu%2F
│   ├── experts.ttl
└── http%3A%2F%2Foapolicy.universityofcalifornia.edu%2F
    └── additions.n3

The config.ttl is the jena assembler file that is used to configure the database. It is copied into /fuseki/configurations/covid19.ttl file, (eg.) Directories are url encoded and treated as separate graphs, and added into those graph names using tdb2.tdbloader. Files ending in *.sparql-update are sent to the tdb2.update command.

This allows for sharing database initializations that include configuration for the fuseki database.

qjhart commented 4 years ago

@jrmerz / @jtyzzer here is a new fuseki server that allows data installation on setup. There are a number of databases that can be added located in this Drive

We should be able to share fuseki tests more easily this way.