Différences entre les versions de « Issue/3387 »
De Semantic MediaWiki - Sandbox
(chg) |
(chg) |
||
Ligne 16 : | Ligne 16 : | ||
== Queried property values == | == Queried property values == | ||
− | === | + | === Wrong separator === |
; syntax | ; syntax | ||
<pre> | <pre> | ||
Ligne 39 : | Ligne 39 : | ||
}} | }} | ||
− | === | + | === Correct separator === |
− | ==== | + | ==== Syntax using #ask without specifying a result format ==== |
{{Callout | {{Callout | ||
|[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | |[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | ||
Ligne 70 : | Ligne 70 : | ||
}} | }} | ||
− | ==== | + | ==== Syntax using <code>#show</code> without specifying a result format ==== |
{{Callout | {{Callout | ||
|[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | |[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | ||
Ligne 99 : | Ligne 99 : | ||
}} | }} | ||
− | ==== | + | ==== Syntax using <code>#ask</code> and specifying a result format ==== |
+ | {{Callout | ||
+ | |[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | ||
+ | }} | ||
; syntax | ; syntax | ||
<pre> | <pre> | ||
Ligne 115 : | Ligne 118 : | ||
}} | }} | ||
− | ==== | + | ==== Syntax using <code>#show</code> and specifying a result format ==== |
+ | {{Callout | ||
+ | |[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format] | ||
+ | }} | ||
; syntax | ; syntax | ||
<pre> | <pre> |
Version du 2 septembre 2018 à 20:14
Hard coded property values
- syntax
{{#ask: [[Category:Song]] [[Is performer::David Bowie||Queen]] |format=broadtable }}
- result
000003 |
000023 |
000078 |
000126 |
Queried property values
Wrong separator
- syntax
{{#show: Under Pressure |?Is performer }}
- result
; syntax {{#ask: [[Category:Song]] [[Is performer::{{#show: Under Pressure |?Is performer }}]] |format=broadtable }}
- result
- → This does not work since the separator is "," while you need a "||" as separator. Thus you get nothing in return:
000003 |
000023 |
000078 |
000126 |
<ul><li>La partie « |David Bowie » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li> <!--br--><li>La partie « ]] » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li></ul>
Correct separator
Syntax using #ask without specifying a result format
#ask
defaults to the "list" format.
{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}
- result
David Bowie
- syntax
{{#ask: [[Category:Song]] [[Is performer::{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]] |format=broadtable }}
- result
- → This does not work since the "list" format adds extra formatting to the resulting data values. Specify the "plainlist" format for best results.
000003 |
000023 |
000078 |
000126 |
Syntax using #show
without specifying a result format
#show
defaults to the "plainlist" format.
{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}
- result
- syntax
{{#ask: [[Category:Song]] [[Is performer::{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}]] |format=broadtable }}
- result
000003 |
000023 |
000078 |
000126 |
<ul><li>La partie « |David Bowie » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li> <!--br--><li>La partie « ]] » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li></ul>
Syntax using #ask
and specifying a result format
- syntax
{{#ask: [[Category:Song]] [[Is performer::{{#ask: [[Under Pressure]] |?Is performer |format=plainlist |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]] |format=broadtable }}
- result
000003 |
000023 |
000078 |
000126 |
Syntax using #show
and specifying a result format
- syntax
{{#ask: [[Category:Song]] [[Is performer::{{#show: Under Pressure |?Is performer |format=plainlist |valuesep={{!!}} }}]] |format=broadtable }}
- result
000003 |
000023 |
000078 |
000126 |
<ul><li>La partie « |David Bowie » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li> <!--br--><li>La partie « ]] » de la requête n’a pas été comprise. Les résultats peuvent être inattendus.</li></ul>