Reconciliation API modules: recon-suggest-type
From CODECS Dev
- Main
- Configuration
- Local file settings
- JSON profiles
- Modules
- recon
- recon-suggest-entity
- recon-suggest-entity (MW)
- recon-suggest-property
- recon-suggest-type
- recon-suggest-propvalue
- Other
- Additional usage guide
- Implementation notes
- Implementation notes: SMW
- Implementation notes: MW and types
- Redirect service
- TypeaheadSearch
- Future
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
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
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=
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'
Dev info. API: https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&origin=%2A&source=mw&cat=Irish+texts&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=
Target URL: https://codecs.vanhamel.nl/Special:Search?search=
Footer URL: https://dev.vanhamel.nl/index.php?title=Special:Search&fulltext=1&search=
- Examples from CODECS
- https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&origin=*&source=mw&substrpattern=stringprefix&substr=sub (without parent category)
- https://codecs.vanhamel.nl/api.php?action=recon-suggest-type&source=mw&cat=Irish%20texts&substrpattern=allchars&substr=sc&offset=0 (with parent category)
with source=smw: Concepts
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=
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
...