Help:Special:Ask

From semantic-mediawiki.org
Jump to: navigation, search
SMW user manual
Introduction
Editing
Properties and types
Special properties
Inverse properties
Custom units

Semantic templates

Service links

Browsing interfaces
Special:Ask
Special:Browse
Semantic search
Selecting pages
Strict comparators
Displaying information
Result formats
Inline queries
Querying for queries
Concepts
Inferencing
Using the API
Semantic Web
RDF export

External tools

Importing vocabulary

SMW admin manual

The "Semantic search" page, which can be found at special page "Ask", provides an interface that assists users with creating and executing semantic queries.

Query construction

On the top of the page there are two text area fields. The first one, titled 'Query', is meant for the portion of the query for selecting pages. The second one, titled 'Additional data to display', is meant to hold the set of properties that are displayed for each queried page - see the help page on displaying information. Each property should be prepended with a question mark, just as is done in regular #ask queries. As of Semantic MediaWiki 1.5.2, this field has autocompletion on property names, meaning that you can start typing the beginning of a property name, and a set of completions will show up. You can also just type a question mark, and you will see the list of all properties defined on the wiki at once.

Query parameters

As of Semantic MediaWiki 1.5.0, additional controls are shown under the text fields, which allow the user to pass parameters to the query that give extra control over how the data is displayed. The controls shown change according to the result format selected, as different formats support different parameters.

Running the query

You can run the query by hitting the 'find results' button in the lower left corner of the page, after which the results will be shown.

Downloading the results

Semantic MediaWiki 2.4.0 introduced quick download links shown above the queried results to the right allowing to download them immediately in JSON, CSV, RSS and RDF.1 See the screenshot on this page.

Direct download links on "Special:Ask"

Customizing

Starting with Semantic MediaWiki 1.8.0 and Semantic MediaWiki 1.9.12 options for further customization were introduced:

CSS classes
  • .smw-ask-parameter-description can be used to change the parameter text display behaviour, e.g. font-size etc. (since Semantic MediaWiki 1.8.0)
  • .smw-ask-query can be used to change the query interface containing the following "sub-classes": (since Semantic MediaWiki 1.9.1)
  • .smw-ask-query-condition can be used to change the input field "Query" for entering query conditions (since Semantic MediaWiki 1.9.1)
  • .smw-ask-query-printout can be used to change the input field "Additional data to display" for entering the query printouts (since Semantic MediaWiki 1.9.1)
  • .smw-ask-query-format can be used to change the query interface containing the following "sub-class": (since Semantic MediaWiki 1.9.1)
  • .smw-ask-query-format-selector can be used to change the appearance of the drop-down menue used for selecting the result format (since Semantic MediaWiki 1.9.1)
User preferences
  1. A setting to allow toggling between the standard parameter text or a compact info tooltip based display (since Semantic MediaWiki 1.8.0)
  2. A setting to enable the option box to be collapsed by default (since Semantic MediaWiki 1.8.0)

Notes

$smwgLinksInValues set to true

Results of a query displayed on this special page are not parsed further. This means that results for properties of datatype "Text" containing links will be displayed as-is, i.e. links like SMW Project within the data value will be displayed as [[Help:SMW Project|SMW Project]] even if this configuration parameter is enabled.

See also


This documentation page applies to all SMW versions from 1.8.0 to the most current version.
Other versions: 1.5.2 – 1.7.11.5.0 – 1.5.11.0 – 1.4.2       Other languages: de

Help:Special:Ask en 1.8.0