Contents
20.6Query templates: ready-made questions on Wikidata
A query template is a ready-made question on a public knowledge graph (Wikidata today). Examples include companies of a kind in a country by size and age, a company's subsidiaries, parent companies, leaders and board, owners, its figures over time, products, the largest things of a kind by a figure, people who worked at an organisation, founders in an industry, positions a person held, cities in a region, everything recorded about one item, and a general list with filters.
Bmator ships these out of the box. Each was tested on Wikidata before being made available and is re-tested every night. A template failing three nights in a row is suspended until someone looks. Every template contains a structured description: what it answers, Does not answer and which query template does, What you fill in, the columns, Example questions, and Limitations.
Every Wikidata identifier is shown with its name, identifier first (for example, Q142: France, P452: industry). This applies to the blanks you fill, the matches returned by Find, the classes and properties in graph exploration, and identifiers listed under a query.
Running a Query Template
When running a query template, no AI is used. The query is sent directly to Wikidata, whose data is public and free. Your sentences and files never leave Bmator; only the identifiers and values you filled in are sent.
- Open a query template.
- Fill in the blanks. For a company, country, or category, type a name and press Find, then select the correct match (or type a Wikidata identifier such as Q142 directly). Numbers and dates are typed.
- Press Run.
Results include the rows, how long Wikidata took, the source, and its licence. A coverage note appears when filtering on properties that Wikidata records for relatively few items (such as employee counts, known for about 1% of businesses; companies without one are not listed). When nothing comes back, Bmator explains how many rows each optional filter removed.
Results requested again within 24 hours load From the cache. To bypass cached data, press Refresh to query Wikidata again. Press Show as a query to view the SPARQL that ran along with additions made by Bmator before sending. Rows can be searched, filtered, and sorted directly on the page.
When opened from Ask Bmator → Knowledge graphs, a query template automatically populates the question's blanks and runs at once.
Handling Busy Wikidata Traffic
Wikidata serves public traffic from a single infrastructure and can be busy. Instead of aborting, Bmator continues attempting the query on its servers, reporting the attempt count and scheduled next attempt. You can navigate away from the page and return later; if you remain, the rows load automatically once complete.
Pressing Stop waiting stops the page from monitoring the query, but the run continues in the background. Pressing Run a few minutes later typically loads the finished result immediately. If Wikidata remains busy for several minutes, Bmator stops and states that Wikidata is busy. If a query is structurally too heavy for Wikidata, Bmator states this clearly and suggests adjustments, such as specifying a smaller region, a narrower company category, or a shorter list.
Managing Templates and Visibility
The Query templates screen organizes items across four tabs:
- Bmator's
- Mine
- Shared with me
- Workspace
Templates under Bmator's and Shared with me are read-only. You can run them or press Duplicate to create an independent draft that does not follow the original.
You can share your own templates directly with people (read-only) or with your workspace. Press Retire to stop offering a template while allowing existing users to keep their version. Only drafts and retired templates can be removed with Delete. Select Don't use for my questions to stop Ask Bmator → Knowledge graphs from selecting the template automatically while retaining manual execution from its page (use Use for my questions to re-enable it).
Creating and Editing Query Templates Manually
Press New query template to access the editor, or press Edit on an existing draft:
- Specify the Name.
- Write the SPARQL query. Blanks use
{{slot}}syntax, and conditional sections use{{#slot}}...{{/slot}}so they are included only when filled. - Define the blanks and test fillings.
- Complete the description: provide the Summary, what it answers, Does not answer, at least three entries under Example questions, at least one counter-example, and Limitations.
- Press Save to create a new version.
Press Try to test the latest draft against its first test filling on Wikidata. Press Activate to test all fillings against Wikidata and confirm example questions resolve correctly; if checks do not pass, What blocks activation lists the issues. Activation checks embed description texts, which incurs a small workspace cost. A template in Draft state can only be run by its author from its own page.
To view previous edits, inspect the version history. On your own templates, press Restore on an older version to make it the newest version without overwriting past history, then press Activate to put it into production.
Generating and Changing Templates with AI
Creating from a Description
Press Describe what it should do to draft a template using natural language:
- In What should it answer?, specify the required output (such as board members of companies in a given industry and country), optionally add example questions, and press Continue.
- Bmator displays These may already do it if existing templates match. You can select Use it, Duplicate and adjust, or Write a new one anyway.
- If prompted with up to three clarification questions, choose an answer or select No preference.
- Press Write it. The AI explores Wikidata, writes the SPARQL with slots and test fillings, generates the description, and validates every test against Wikidata. This takes one to two minutes and costs at most €0.20 from your workspace (displayed upfront). The model only uses identifiers found on Wikidata.
- When finished, a draft marked Written by AI — check it before activating is returned. You can review Its tests on Wikidata and How it was written.
- Press Open the draft to open the editor, then run Try and Activate.
If the automated generator cannot produce a passing query, it reports why, showing what it found and the final attempted query.
Drafts can also be created from Ask Bmator → Knowledge graphs: selecting the option to save keeps an AI-generated query as a template with pre-filled blanks and drafted documentation to inspect before activation.
Changing an Existing Template in Words
Press Change it in words on any template page to modify it through instructions (for example, requesting to also show countries, or restricting results to listed companies):
- Enter your adjustments and press Change it.
- Bmator tests the modified query on Wikidata and presents the differences side-by-side as Now beside Changed.
- Press Apply as a new version to accept the update (or press Discard to cancel). On templates you do not own, applying adjustments creates a personal copy.