Reconciliation API: additional guide
Tips and tricks
How do you recommend I set up my semantic properties?
For each page that you want to be findable, use properties for the following:
- Information to be displayed in search results:
- Label. After all, a page title may not be the most informative or flexible choice. A natural option may be to use the special property "Display title of" (https://www.semantic-mediawiki.org/wiki/Help:Special_property_Display_title_of). For best multilingual suppprt, you could also consider creating a property with Monolingual Text datatype.
- Description. One to identify the subject or page scope more nearly and maybe to disambiguate between multiple items of the same name (cf. Wikidata). Preferably under 200 characters.
- Image thumbnail (@todo)
- For internal use:
- Searchable string, i.e. the string - invisible to the user - on which the search must operate. It is equivalent to the label above, but 'flattened' to be most efficiently usable in a search: lowercase, stripped of HTML tags and unhelpful punctuation, stripped of diacritics (e.g. a not á). A parser function will be made available to help you accomplish this om your wiki.
- potentially, you may want to add alternate descriptors and spelling variants, either to this property or a dedicated additional one.
- A string for improved sortability (@todo)
- Searchable string, i.e. the string - invisible to the user - on which the search must operate. It is equivalent to the label above, but 'flattened' to be most efficiently usable in a search: lowercase, stripped of HTML tags and unhelpful punctuation, stripped of diacritics (e.g. a not á). A parser function will be made available to help you accomplish this om your wiki.
What can I do if my SMW query returns pages that have not been created (yet)?
This can happen if you use inverse queries.
If you DO NOT want those pages to be included, you should modify your query to exclude non-existing pages. An easy solution is to restrict your query to pages that have a property 'Modification date' ([[Modification date::+]]
).
If you DO want to include those pages, you need to decide where to send users when they select an existing or non-existing page from the list.
- MediaWiki’s built-in solution is to direct all requests to
Special:Search
, with the page name appended to the 'search' parameter. Special:Search is the page familiar to wiki users that allows for further site searches to be made. If the page exists (and the standard behaviour is not suppressed through &fulltext=1), the user is automatically redirected. Unfortunately, the usefulness of Special:Search may be limited. - Another solution is to set up a custom wiki page for search results. Make sure that the user gets sent to (
targeturl
) ... this page works with a URL query string and make sure- @todo add a similar special page that redirects users to existing pages or to custom search pages. Scope for conditions like 'page must exist', 'page must be accessible', 'contains a semantic property that states if it is published or not', ...
https://codecs.vanhamel.nl/Special:Search?fulltext=1&search= //index.php?title=Special%3ASearch&fulltext=1&search=
https://codecs.vanhamel.nl/Special:Search?search=
- But you can also