1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- -- Application configuration.
- local plpath = require "pl.path"
- local ROOT = os.getenv("PKAR_ROOT")
- if not ROOT then
- print(
- "PKAR_ROOT environment variable is not set.\n" ..
- "Data will be written to a TEMPORARY location that " ..
- "may NOT SURVIVE a reboot!"
- )
- ROOT = "/tmp/pocket_archive"
- end
- return {
- id = {
- -- Length in ASCII characters of system-generated IDs.
- len = 16,
- --[[ Seed for the random ID generator.
- Set this to an arbitrary integer in a test environment, so that
- resource IDs will be generated with a consistent pattern for each run
- (not when using pkar_watch, though). Note that each call to e.g.
- `pkar deposit` will generate IDs starting from the same seed and will
- overwrite resources from a previous deposit.
- If nil, os.time() will be used, which generates always different random
- IDs. This is necessary in a real-world application to avoid the above
- mentioned overwriting.
- ]]
- seed = nil,
- },
- md = {
- -- Single-valued fields. TODO rely on content model cardinality.
- single_values = {
- ["content_type"] = true,
- ["label"] = true,
- ["archive_path"] = true,
- ["source_path"] = true,
- },
- -- Map of data types in prop definitions to RDF literal types.
- -- Non-mapped items are set to `xsd:string`.
- datatypes = {
- integer = "xsd:integer",
- decimal = "xsd:decimal",
- float = "xsd:double",
- boolean = "xsd:boolean",
- datetime = "xsd:datetime",
- }
- },
- fs = {
- -- Base path to write opaque resources.
- ores_path = os.getenv("PKAR_ORES") or plpath.join(ROOT, "data", "ores"),
- -- Base path of LSUP store for descriptive resources (RDF).
- dres_path = os.getenv("PKAR_DRES") or plpath.join(ROOT, "data", "dres"),
- -- How many bytes to read when handling files. Adjust to memory
- -- availability.
- stream_chunk_size = 1024 ^ 2, -- 1Mb
- },
- -- Namespace prefixes to populate the Pocket Archive NS map.
- namespace = {
- b2 = "blake2:",
- dc = "http://purl.org/dc/terms/",
- foaf = "http://xmlns.com/foaf/0.1/",
- par = "http://id.pkar.knowledgetx.com/resource/",
- pas = "http://id.pkar.knowledgetx.com/schema#",
- premis = "http://id.loc.gov/vocabulary/preservation/",
- rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
- rdfs = "http://www.w3.org/2000/01/rdf-schema#",
- sub = "http://id.pkar.knowledgetx.com/submission/",
- xsd = "http://www.w3.org/2001/XMLSchema#",
- },
- -- Static site (presentation) generation settings.
- pres_gen = {
- title = "Pocket Archive demo site",
- out_dir = plpath.join(ROOT, "out", "pres"),
- max_homepage_items = 12,
- },
- -- Content model doc generation settings.
- cmdoc_gen = {
- out_dir = plpath.join(ROOT, "out", "cmdoc"),
- },
- }
|