Moeverse Database Guide
The Moeverse Database aims to provide well organized and structured data and documentation about subjects of interest of the Community.
This page explains its principles, which should then allow one to use the Database.
Moeverse Database Principles
The Database is not based on Software like MediaWiki or WikiData, though it take inspiration from these as well as from Object Oriented Programming Languages. The engine has been written from scratch to optimally suit the needs of Moeverse as well as other Stelo.xyz Projects, and not depend on third parties.
It is currently in development and subject to evolve a lot as issues are ironed out and planned features or improvements implemented.
Items, Classes and Properties
Items are the usual entities of the Database and consist of a collection of Properties characterizing them. Properties carry elementary Item Data, which can be of the following Types, based on some MariaDb Types:
- I64: a 64 bits Integer Number, based on MariaDb's Unsigned BigInt
- F64: a 64 bits Floating Number (to represent Real Numbers), based on MariaDb's Double
- Str8: a String that can contain up to 255 bytes worth of characters, based on MariaDb's VarChar(255)
- Str16: a String that can contain up to 65535 bytes worth of characters, based on MariaDb's Text
- Str24: a String that can contain up to 16777215 bytes worth of characters, based on MariaDb's MediumText
- Item: a reference to an existing Item from the Database
- File: a reference to an existing File from the Database
For each Property, the Type is fixed and strict.
Items and Properties have an unique Identifier which must be alphanumeric and start with a Letter. It is notably used to practically and unambiguously refer to an Item or access to its Page. This is a special Identifier referring to the Current Item, similar to C++'s this.
Properties themselves can be attributed some Variants, though this feature will likely be replaced or overhauled later so do not give this much attention for now, beyond the Variants "en" or "original" for Names.
The Report is a special Item Property meant for the composition of the Item's Page. It may make reference to Item Properties.
Classes for now simply provide templates for the Item's Pages and Edit Forms. It is planned to give them later more importance, for example enforcing some Properties of Type Item to also be of a particular Class.
Properties and Classes are managed by Moderators who create and edit these in accordance to the needs of the Database.
Moeverse Database Syntax
We have developed our own Syntax for the Items' Reports, inspired by but also quite distinct from Markdown/CommonMark.
Headings
Like Markdown, Headings are inserted with Hashes #.
# Main Heading (Level 1, equivalent to Html's H1) ## Level 2 Heading That Will Not Work! Do Not Do This! ----------------------------------- ### Heading 3 ###Heading3 - that will not work, put a Space after the Hashes! #### Heading 4 This may without it, but also try to insert a full empty Line before (unless the Heading is at the very start) and after a Heading. You are very unlikely to need Level 4 and beyond... You can go down to 6, don't even try beyond!
Italic/Bold
Again like Markdown, use Asterisks * to emphasize text (make them Italic or Bold):
This is how we *emphase* things. Oh, you did not hear me, should I **raise my voice**? *We can also **combine** both*! **Yeah, *combine* both, you don't hear me**? *Do I need to **repeat myself again***?! ***Oh sorry*, I'm just screaming for exhaustive purposes**... *Don't do that over several Lines*! Nor ****abuse***** it.
This is how we emphase things. Oh, you did not hear me, should I raise my voice? We can also combine both! Yeah, combine both, you don't hear me? Do I need to repeat myself again?! Oh sorry, I'm just screaming for exhaustive purposes...
*Don't do that
over several Lines*!
Nor abuse* it.
Lists
Use Dashes - (not asterisks) followed by a Space. Numbered Lists are currently not supported.
- 1 - 2 -- 21 -- 22 - 3 -- 31 --- 311 --- 312 - 4 - 5 - 6
- 1
- 2
- 21
- 22
- 3
- 31
- 311
- 312
- 31
- 4
- 5
- 6
Links and Images
The Syntax is similar to Markdown. If the Link or Image is an Identifier of an Existing Item or Image respectively, it automatically resolves to that resource.
For Images, a second pair of Parenthesis can be used to change the Image Css Style. Thumbs instead of the Original File can (and usually should) be used to save bandwidth by appending _ and a width in Pixels among 32, 64, 128, 256, 360, 480, 640, 720, 1024, 1280, 1600, 1920.
[Moella](Moella) [Moella](https://moeverse.xyz/db/Moella) [Moella](NonExistentItem) (width: 8em;) [(width: 8em;)](Moella)
Html
Just like Markdown, Html can be used to complement the basic Syntax. Also some things like Tables cannot be done with the basic Syntax unlike in Markdown, and require Html.
Supported Tags are: span div table tr th td figure figcaption
Supported Attributes are: style colspan rowspan
<table> <tr><th>Title 1</th><th>Title 2</th><th colspan="2">Title 3</th></tr> <tr><td>Cell 1 1</td><td>Cell 2 1</td><td>Cell 3 1</td><td>Cell 4 1</td></tr> <tr><td>Cell 1 2</td><td style="background-color: #FF00FF">Cell 2 2</td><td>Cell 3 2</td><td>Cell 4 2</td></tr> </table>
| Title 1 | Title 2 | Title 3 | |
|---|---|---|---|
| Cell 1 1 | Cell 2 1 | Cell 3 1 | Cell 4 1 |
| Cell 1 2 | Cell 2 2 | Cell 3 2 | Cell 4 2 |
Quotes
Use a Pair of Triple Double Quotes :p,
""" Lorem Ipsum Bla Bla Bla """
Lorem Ipsum Bla Bla Bla
Substitutions and Special Commands
The more technical part of our Syntax. Special features can be invoked with something of the form ${...}.
Let Item and Property be valid Identifiers, ItemOrProp either Item or Item.Property, and ItemOrProp2 (and 3,...) another combination for Item/Item.Property
${Item}or equivalently${#Eval|Item}will:- Evaluate to
Itemif an Item Identified by thatItemExists (and is not of Class Template), or nothing (an empty String) if it does not exist. - Evaluate
${Item.Code}if that Item Exists and is of Class Template.
- Evaluate to
${Item.Property}or equivalently${#Eval|Item.Property}will:- Evaluate to the Property's Value if the specified combination of Item and Property Exists, or nothing (an empty String) if it does not exist.
- If the Property is of Type Item or File, it will evaluate to that Item or File Identifier.
- Evaluate to the Property's Value if the specified combination of Item and Property Exists, or nothing (an empty String) if it does not exist.
${#IfSet|Expression|ValueIfExists|ValueIfNotExists}evaluates toValueIfExistsifExpressionExists,ValueIfNotExistsotherwise.ValueIfNotExistscan be omitted, in which case it is treated as an empty String.${#IfItemsEq|ItemOrProp,ItemOrProp2,...,ItemOrPropN|ValueIfEquals|ValueIfNotEquals}evaluates toValueIfEqualsif allItemOrProps Exist and Evaluate to the same String,ValueIfNotEqualsotherwise.ValueIfNotEqualscan be omitted, in which case it is treated as an empty String.${#IfEq|Expression|Expression2|ValueIfEquals|ValueIfNotEquals},ExpressionandExpression2being arbitrary Expressions, evaluates toValueIfEqualsif the Expressions Evaluate to the same String,ValueIfNotEqualsotherwise.ValueIfNotEqualscan be omitted, in which case it is treated as an empty String.
Superfluous Arguments are ignored.
Templates
Templates can take Arguments. If Item Identifies an Item of Class Template,
${Item|Arg1|Arg2}will invoke the Template' Code with "Temporary Items" Identified by0and1, which could then be used via the Template's Code (for example,${0}would evaluate here toArg1).
Code
Use pairs of Backticks to display Code, which will also inhibit Substitutions.
${NanamiMadobe.Name} ``${NanamiMadobe.Name}``
Nanami Madobe ${NanamiMadobe.Name}
Triple Backticks can also be used for large Code Sections or Preformatted Text.