app.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. -- Application configuration.
  2. local plpath = require "pl.path"
  3. local ROOT = os.getenv("PKAR_ROOT") or ""
  4. return {
  5. id = {
  6. -- Length in ASCII characters of system-generated IDs.
  7. len = 16,
  8. -- Two seeds for the random ID generator.
  9. seed = {256, 512},
  10. },
  11. md = {
  12. -- Single-valued fields. TODO rely on content model cardinality.
  13. single_values = {
  14. ["dc:identifier"] = true,
  15. ["pas:contentType"] = true,
  16. ["dc:title"] = true,
  17. ["path"] = true,
  18. ["pas:sourcePath"] = true,
  19. },
  20. -- Map of data types in prop definitions to RDF literal types.
  21. -- Non-mapped items are set to `xsd:string`.
  22. datatypes = {
  23. integer = "xsd:integer",
  24. decimal = "xsd:decimal",
  25. float = "xsd:double",
  26. boolean = "xsd:boolean",
  27. datetime = "xsd:datetime",
  28. }
  29. },
  30. fs = {
  31. -- Base path to write opaque resources.
  32. ores_path = os.getenv("PKAR_ORES") or plpath.join(ROOT, "data/ores"),
  33. -- Base path of LSUP store for descriptive resources (RDF).
  34. dres_path = os.getenv("PKAR_DRES") or plpath.join(ROOT, "data/dres"),
  35. -- How many bytes to read when handling files. Adjust to memory
  36. -- availability.
  37. stream_chunk_size = 1024 ^ 2, -- 1Mb
  38. },
  39. -- Namespace prefixes to populate the Pocket Archive NS map.
  40. namespace = {
  41. b2 = "urn:blake2:",
  42. dc = "http://purl.org/dc/terms/",
  43. foaf = "http://xmlns.com/foaf/0.1/",
  44. par = "urn:pkar:resource/",
  45. pas = "http://id.pkar.knowledgetx.com/schema#",
  46. premis = "http://id.loc.gov/vocabulary/preservation/",
  47. rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
  48. rdfs = "http://www.w3.org/2000/01/rdf-schema#",
  49. xsd = "http://www.w3.org/2001/XMLSchema#",
  50. },
  51. -- Static and dynamic site settings.
  52. site = {
  53. title = "Pocket Archive demo site"
  54. },
  55. -- Static site generation settings.
  56. htmlgen = {
  57. out_dir = "./out/html",
  58. },
  59. }