Semantic MediaWiki and related extensions
|
When resolving a query request (i.e. resolving the parser function {{#ask ... }}
or {{#show: ... }}
) the QueryEngine
has two distinct tasks to accomplish:
QueryResult
object that contains the matched subjects and provide information on the requested printouts (equivalent of columns displayed in a table)src/ParserFunctions
AskParserFunction.php
defines the #ask
parser functionShowParserFunction.php
defines the #show
parser functionsrc/Query
Parser.php
interface to src/Query/Parser
to create a Description
and Query
object from an {{#ask: ...}}
stringPrintRequest.php
ResultPrinter.php
interface to concrete implementations found in src/Query/ResultPrinters
src/Query/Language
Each condition element (e.g. [[Has foo::bar]] || [[!Foo]]
) of a query is represented by a Description
object allowing to express a query condition as as description AST.
src/Query/Result
QueryResult.php
] the instance represents the matched subjects of a query request (i.e. rows of a table)ResultArray.php
] represents a lazy-object to contain the printouts (see PrintRequest
) for a particular subject (i.e. as columns for a particular row)src/Query/ResultPrinters
A ResultPrinter
is the user facing output formatter that takes a QueryResult
and transform its representation into a specific format by extending:
ResultPrinter.php
is an abstract base class to provide accessors and pre and postprocess the output after an individual printer returns the formatted result orFileExportPrinter.php
is an abstract base class for file export result printersDescripion
objects