« Issue/3387 » : différence entre les versions

De Semantic MediaWiki - Sandbox
(chg)
(chg)
 
(13 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
== Hard coded property values ==
; syntax
<pre>
<pre>
{{#ask:
{{#ask:
Ligne 6 : Ligne 8 :
}}
}}
</pre>
</pre>
; result
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
Ligne 12 : Ligne 15 :
}}
}}


== Queried property values ==
=== Wrong separator ===
; syntax
<pre>
<pre>
{{#show: Under Pressure |?Is performer }}
{{#show: Under Pressure |?Is performer }}
</pre>
</pre>
; result
{{#show: Under Pressure |?Is performer }}
{{#show: Under Pressure |?Is performer }}
<pre>
<pre>
; syntax
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
Ligne 24 : Ligne 31 :
}}
}}
</pre>
</pre>
 
; result
: → This does not work since the separator is "," while you need a "||" as separator. Thus you get nothing in return:
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
Ligne 31 : Ligne 39 :
}}
}}


=== Correct separator ===
==== Syntax using #ask without specifying a result format ====
{{Callout
|[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format]
}}
{{Callout
|<code>#ask</code> defaults to the "list" format.
|info
}}
<pre>
<pre>
{{#ask: [[Under Pressure]] |?Is performer |format=list |limit=10000 |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}
{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}
</pre>
</pre>
{{#ask: [[Under Pressure]] |?Is performer |format=list |limit=10000 |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}
; result
{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}


; syntax
<pre>
<pre>
{{#show: Under Pressure |?Is performer |format=list |limit=10000 |valuesep={{!!}} }}
{{#ask:
[[Category:Song]]
[[Is performer::{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
|format=broadtable
}}
</pre>
</pre>
; result
: → This does not work since the "list" format adds extra formatting to the resulting data values. [[#Syntax_using_.23ask_and_specifying_a_result_format|Specify the "plainlist" format for best results.]]
{{#ask:
[[Category:Song]]
[[Is performer::{{#ask: [[Under Pressure]] |?Is performer |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
|format=broadtable
}}


{{#show: Under Pressure |?Is performer |format=list |limit=10000 |valuesep={{!!}} }}
==== Syntax using <code>#show</code> without specifying a result format ====
{{Callout
|[https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2488#issuecomment-381404426 Note the difference between the "list" and the "plainlist" format]
}}
{{Callout
|<code>#show</code> defaults to the "plainlist" format.
|info
}}
<pre>
{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}
</pre>
; result
{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}


; syntax
<pre>
<pre>
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
  [[Is performer::{{#ask: [[Under Pressure]] |?Is performer |format=list |limit=10000 |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
  [[Is performer::{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}]]
  |format=broadtable
  |format=broadtable
}}
}}
</pre>
</pre>
; result
{{#ask:
[[Category:Song]]
[[Is performer::{{#show: Under Pressure |?Is performer |valuesep={{!!}} }}]]
|format=broadtable
}}


==== 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
<pre>
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
  [[Is performer::{{#ask: [[Under Pressure]] |?Is performer |format=list |limit=10000 |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
  [[Is performer::{{#ask: [[Under Pressure]] |?Is performer |format=plainlist |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
|format=broadtable
}}
</pre>
; result
{{#ask:
[[Category:Song]]
[[Is performer::{{#ask: [[Under Pressure]] |?Is performer |format=plainlist |headers=hide |link=none |mainlabel=- |valuesep={{!!}} }}]]
  |format=broadtable
  |format=broadtable
}}
}}


 
==== 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
<pre>
<pre>
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
  [[Is performer::{{#show: Under Pressure |?Is performer |format=list |limit=10000 |valuesep={{!!}} }}]]
  [[Is performer::{{#show: Under Pressure |?Is performer |format=plainlist |valuesep={{!!}} }}]]
  |format=broadtable
  |format=broadtable
}}
}}
</pre>
</pre>
 
; result
{{#ask:
{{#ask:
  [[Category:Song]]
  [[Category:Song]]
  [[Is performer::{{#show: Under Pressure |?Is performer |format=list |limit=10000 |valuesep={{!!}} }}]]
  [[Is performer::{{#show: Under Pressure |?Is performer |format=plainlist |valuesep={{!!}} }}]]
  |format=broadtable
  |format=broadtable
}}
}}


[[Category:Issue]]
[[Category:Issue]]

Dernière version du 2 septembre 2018 à 20:15

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

David Bowie

; 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

David Bowie

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>

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.