Reconciliation API modules: recon-suggest-type

From CODECS Dev
Service for suggesting types (https://www.w3.org/community/reports/reconciliation/CG-FINAL-specs-0.2-20230410/#types). In MediaWiki core, a type translates to a Category. In SMW, it translates to either a Concept or a wiki page (e.g. Person) used as the value of a property that stores the class of a page.

Parameters

API documentation

Parameter name
Description
source
mw (for MediaWiki core) or smw (for Semantic MediaWiki).
profile
Used with source=smw.
cat
Used with source=mw. The top category, or categories, from which to search for lower-level subcategories (max. 250), up to a depth of 5 subcategory levels. Optional.
substrpattern
Substring pattern.
substr
The substring to autocomplete on.
offset
Result offset.
limit
Result limit.

with source=mw

When this module is used with source=mw, the type suggested is a MediaWiki Category. It also means that the internal mechanics of MediaWiki itself are used for retrieving Categories and their subcategories. It is currently untested if extensions like Semantic MediaWiki could provide a better alternative.

Search for any Category
Testing sitesearch widget...
Dev info. API: https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&origin=%2A&source=mw&substrpattern=stringprefix&substr=
Target URL: https://codecs.vanhamel.nl/Special:Search?search=
Footer URL: https://dev.vanhamel.nl/index.php?title=Special:Search&fulltext=1&search=
Search for Subcategories of 'Irish texts'
Testing sitesearch widget...
Examples from CODECS

with source=smw: Concepts

Testing sitesearch widget...
Dev info. API: https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&format=json&source=smw&substrpattern=allchars&substr=
Target URL: https://codecs.vanhamel.nl/Special:Search?search=
Footer URL: https://dev.vanhamel.nl/index.php?title=Special:Search&fulltext=1&search=

https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&source=smw&format=jsonfm&substr=A


with source=smw: 'class pages'

https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&source=smw&format=jsonfm&substr=A

...