Skip to content

Media Wiki Extension that parses Ottr code and produces media wiki code instead.

License

Notifications You must be signed in to change notification settings

RobFlo98/OttrParserExtension

Repository files navigation

OTTR Parser Extension

An extension for the (Semantic) Media Wiki. It parses text in the OTTR template language and produces code in Media Wiki Syntax. Triples are represented as subobjects.

More information about the extension: https://www.mediawiki.org/wiki/Extension:OttrParser.

The help page for wiki usage: https://www.mediawiki.org/wiki/Help:Extension:OttrParser.

Installation

See Media Wiki page of the extension: Install Instructions.

Pages as XML

The OTTR-Relevant-Pages.xml contains the data for the relevant pages and templates, that are part of the extension. Import them via the Special Page Import. (Special:Import)

Code

The extension uses the includes/Hooks.php. It calls the python script printOttrInSmw.py. The script parses the text in the passed file and the Listener (OTTRToSMWConverter.py) builds class objects (from the OTTRClassesForSMW.py) related to the parsed text. The SMWGenerator.py starts the generation of the final (Semantic) MediaWiki code based on the class objects and prints the result to the terminal. The Hook File reads the terminal output and returns the output to the media wiki page (with some additional information, e.g. the input text and wiki code in pre html-tags).

Settings.py

In the Settings.py you can add your namespaces, that are used in the automated forms, for requested arguments with the type restriction ottr:IRI.

Ideas

  • currently, it does not add new namespace ids to the wiki

About

Media Wiki Extension that parses Ottr code and produces media wiki code instead.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published