Lorebooks2MediaWiki: Difference between revisions

No edit summary
No edit summary
Line 6: Line 6:


References for context:
References for context:
- World Info & Lorebook concepts: https://rentry.co/world-info-encyclopedia
 
- Character formatting (PLists + Ali:Chat): https://wikia.schneedc.com/bot-creation/trappu/creation
* World Info & Lorebook concepts: https://rentry.co/world-info-encyclopedia
 
* Character formatting (PLists + Ali:Chat): https://wikia.schneedc.com/bot-creation/trappu/creation


== What we will build ==
== What we will build ==
We’ll model a small universe called "Farlandia" with:
We’ll model a small universe called "Farlandia" with:
- Places (Environment): town, landmark, etc.
 
- Entities (Lore): monsters like "slime" with both PList-like traits and Ali:Chat-like example reactions.
* Places (Environment): town, landmark, etc.
- Keys and specificity (primary/secondary keys, AND/NOT), trigger rules and placement.
* Entities (Lore): monsters like "slime" with both PList-like traits and Ali:Chat-like example reactions.
- Recursive scanning (parent→child activation), constant vs conditional entries.
* Keys and specificity (primary/secondary keys, AND/NOT), trigger rules and placement.
- Exporters to JSON for use as a Lorebook, and transclusion for in-wiki pages.
* Recursive scanning (parent→child activation), constant vs conditional entries.
* Exporters to JSON for use as a Lorebook, and transclusion for in-wiki pages.


Technologies used:
Technologies used:
- Semantic MediaWiki (SMW) for structured data: properties, categories, queries.
 
- Scribunto (Lua) for lightweight logic: key matching, AND/NOT filters, recursion, and JSON export.
* Semantic MediaWiki (SMW) for structured data: properties, categories, queries.
* Scribunto (Lua) for lightweight logic: key matching, AND/NOT filters, recursion, and JSON export.


== Data Model (SMW) ==
== Data Model (SMW) ==
We use pages for concepts and SMW properties for fields. Minimal property set:
We use pages for concepts and SMW properties for fields. Minimal property set:
- [[Has type::Page]] properties:
 
* [[Has type::Page]] properties:
   * [[Property:Belongs to world]] — parent world (e.g., Farlandia)
   * [[Property:Belongs to world]] — parent world (e.g., Farlandia)
   * [[Property:Parent concept]] — parent concept to support recursion (e.g., Monsters → Slimes)
   * [[Property:Parent concept]] — parent concept to support recursion (e.g., Monsters → Slimes)
- [[Has type::Text]] properties:
 
* [[Has type::Text]] properties:
   * [[Property:Plist]] — serialized PList-like content (single-line or semicolon-separated)
   * [[Property:Plist]] — serialized PList-like content (single-line or semicolon-separated)
   * [[Property:AliChat]] — example dialogues (Ali:Chat-style text)
   * [[Property:AliChat]] — example dialogues (Ali:Chat-style text)
Line 35: Line 41:
   * [[Property:Placement]] — hints like after-character | before-character | depth:5
   * [[Property:Placement]] — hints like after-character | before-character | depth:5
   * [[Property:Non-recursable]] — yes/no (to opt out from recursion)
   * [[Property:Non-recursable]] — yes/no (to opt out from recursion)
Tip: Keep properties predictable, single purpose, and text-based for simple editing. You can always add more typed properties later (e.g., Has type::Boolean for Non-recursable).


== Minimal Page Templates ==
== Minimal Page Templates ==