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. ["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 = plpath.join(ROOT, "data/ores"),
  33. -- Base path of LSUP store for descriptive resources (RDF).
  34. dres_path = 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. dc = "http://purl.org/dc/terms/",
  42. foaf = "http://xmlns.com/foaf/0.1/",
  43. pas = "http://id.pkar.knowledgetx.com/schema#",
  44. par = "urn:pkar:resource/",
  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. }