Help:Debug format

From semantic-mediawiki.org
Jump to: navigation, search
Debug format
Debugging information for analysing problems in query answering.
Available languages
deenzh-hans
Further Information
Provided by: Semantic MediaWiki
Added: 0.7
Removed: still supported
Requirements: none
Format name: debug
Enabled by default: 
Indicates whether the result format is enabled by default upon installation of the respective extension.
yes
Authors: Markus Krötzsch
Categories: misc
Group:
Table of Contents

↓ INFO ↓

The result format debug is used to obtain background information on how Semantic MediaWiki has processed a query. This information helps to understand why a query might return unexpected results, and it is vital for developers to fix bugs in query answering.

Parameters

There are no inline query parameters specific to the debug format.

Parameter Type Default Description
sep text , The separator for values
template text empty The name of a template with which to display the printouts
named args yes/no no Name the arguments passed to the template
userparam text empty A value passed into each template call, if a template is used
introtemplate text empty The name of a template to display before the query results, if there are any
outrotemplate text empty The name of a template to display after the query results, if there are any

Example

{{#ask: [[Category:City]] [[located in::Germany]] 
| ?population
| ?area#km² = Size in km²
| format=debug
}}

This produces the following output:

Debug Output by SMWSQLStore3

Generated Wiki-Query

[[Category:City]] [[Located in::Germany]]

Query Metrics

Query-Size:3
Query-Depth:1

SQL Query

SELECT DISTINCT t6.smw_title AS t,t6.smw_namespace AS ns FROM `smw_object_ids` AS t6 INNER JOIN `smw_fpt_inst` AS t1 ON t6.smw_id=t1.s_id INNER JOIN `t2` AS t2 ON t1.o_id=t2.id INNER JOIN `smw_di_wikipage` AS t3 ON t1.s_id=t3.s_id INNER JOIN `t4` AS t4 ON t3.p_id=t4.id WHERE ((t3.o_id='779')) ORDER BY t6.smw_sortkey ASC LIMIT 55 OFFSET 0;

Auxilliary Tables Used

  • Temporary table t2
      Recursively computed hierarchy for element(s) ('490').
  • Temporary table t4
      Recursively computed hierarchy for element(s) ('86').

Errors and Warnings

None

How to read the debug output

The debug output contains some information that is only useful to developers, but it also gives some information that can be instructive to editors in a wiki for debugging a query.

The more readable parts are shown on top. This is usually a version of the wiki query as understood by SMW. The displayed query might be different from the user input. This may be due to SMW simply expressing some queries in different ways (different style of writing) but it may also show that some parts of the query were not understood or were wrongly understood by SMW.

Some statistical information on query size and query depth, and the encountered error messages are also shown. The size and depth are internal parameters used by SMW to limit the complexity of queries. The administrator of a wiki site may restrict queries to some maximal query size or depth (this will then be shown as an error if problematic), and this output may help to understand how size and depth work with certain queries.

The rest of the debug output is usually related to the internal storage functions executed by SMW to answer the query. This part also depends on the particular storage implementation and version of SMW, and usually developers will be the only ones to have any use for this.

Remarks

The details of the debug output depend on the version of SMW and the storage engine used. This information should be included into debug reports.



This documentation page applies to all SMW versions from 0.7 to the most current version.
      Other languages: dezh-hans

Help:Debug format en 0.7