app.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. ["content_type"] = true,
  15. ["label"] = true,
  16. ["archive_path"] = true,
  17. ["source_path"] = true,
  18. },
  19. -- Map of data types in prop definitions to RDF literal types.
  20. -- Non-mapped items are set to `xsd:string`.
  21. datatypes = {
  22. integer = "xsd:integer",
  23. decimal = "xsd:decimal",
  24. float = "xsd:double",
  25. boolean = "xsd:boolean",
  26. datetime = "xsd:datetime",
  27. }
  28. },
  29. fs = {
  30. -- Base path to write opaque resources.
  31. ores_path = os.getenv("PKAR_ORES") or plpath.join(ROOT, "data/ores"),
  32. -- Base path of LSUP store for descriptive resources (RDF).
  33. dres_path = os.getenv("PKAR_DRES") or plpath.join(ROOT, "data/dres"),
  34. -- How many bytes to read when handling files. Adjust to memory
  35. -- availability.
  36. stream_chunk_size = 1024 ^ 2, -- 1Mb
  37. },
  38. -- Namespace prefixes to populate the Pocket Archive NS map.
  39. namespace = {
  40. b2 = "urn:blake2:",
  41. dc = "http://purl.org/dc/terms/",
  42. foaf = "http://xmlns.com/foaf/0.1/",
  43. par = "urn:pkar:resource/",
  44. pas = "http://id.pkar.knowledgetx.com/schema#",
  45. premis = "http://id.loc.gov/vocabulary/preservation/",
  46. rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
  47. rdfs = "http://www.w3.org/2000/01/rdf-schema#",
  48. xsd = "http://www.w3.org/2001/XMLSchema#",
  49. },
  50. -- Static and dynamic site settings.
  51. site = {
  52. title = "Pocket Archive demo site"
  53. },
  54. -- Static site generation settings.
  55. htmlgen = {
  56. out_dir = "./out/html",
  57. },
  58. }