Difference between revisions of "TaskForSaid"

From Openresearch
Jump to: navigation, search
Line 1: Line 1:
{{ #ask:[[IsA::Event]]  
+
{{ #ask:[[IsA::Event]] [[Ordinal::{{#urlget:ordinal}}]]  {{#ifeq: {{#urlget:limit}}  }} 
 
  |?Acronym
 
  |?Acronym
 
  |mainlabel=Event
 
  |mainlabel=Event
Line 7: Line 7:
 
  | ?Ordinal= ordinal
 
  | ?Ordinal= ordinal
 
  | format=datatables
 
  | format=datatables
  | limit=10
+
  | limit={{#urlget:limit|20}}
}}  
+
}}
 +
 
 +
= solution =
 
   
 
   
= Task =
+
1. this can be done by changing configuration parameters by the site administrators according to the configurations of the server. The maximum number of rows printed is set by the configuration parameter $smwgQMaxInlineLimit (500 by default) for setting the maximal number of rows ever printed by queries or the configuration parameter $smwgQMaxLimit (1000 by default) setting the maximal number of rows ever retrieved by queries in the "LocalSettings.php" file. The limit parameter will not normally help to increase the number beyond this limit.
Please modify the query above as follows:
+
 
# The limit is increased to the maximum value that is possible according to the current configuration of OpenResearch.
+
2-4. please see the query above. please try to use the URL to pass limit and ordinal parameters ([[https://www.openresearch.org/mediawiki/index.php?title=TaskForSaid?limit=10?ordinal=1]])
# The [https://www.semantic-mediawiki.org/wiki/Help:Datatables_format datatables format] is used to enable the data in the table to be searched.
+
 
# Add an additional frequently used field/column to be selected from the properties listed on the [[PropertyUsageSorted]] page, e.g., Ordinal.
+
5. The issue is not clear. What is meant by hide <code><nowiki>[[Category:{{#urlget:field}}]]</nowiki></code> in the #ask queries? In addition, there is no ‘field’ in the above query.
# The [https://www.mediawiki.org/wiki/Extension:UrlGetParameters UrlGetParameter extension is used so that a query parameter can be attached to the page URL], e.g., the ordinal value "1" is specified as an URL query parameter, such that the wiki pages shows a table only with entries for conferences that were the first in their series.
+
Anyway, #urlget: is used to get a parameter from the URL to assign it to a property. A default value is used to set the value if the URL does not contain this parameter.
# [https://github.com/SmartDataAnalytics/OpenResearch/issues/16 Issue #16] is avoided.
+
e.g., it should be <code><nowiki>[[Category:{{#urlget:field|chemistry}}]]</nowiki></code>.
 +
 
 +
=What improvements to that extension you could imagine?=
 +
The extension could support multi-value fields for the same parameter. e.g., consider the parameter city. If the user wants to retrieve conferences hold in only Berlin and Hannover, the parameter might be passed in the URL as <code>?city=Berlin, Hannover</code>.
 +
The values then can be easily retrieved by <code>.split(',')</code> method.
  
Explain how https://github.com/wikimedia/mediawiki-extensions-UrlGetParameters/blob/master/UrlGetParameters.php is part of your solution and what improvements to that extension you could imagine.
+
Another code improvement:
If you can't solve all parts of the problem, explain why.
+
The code should handle the case of parameters like city[[0] and city[0]].

Revision as of 23:12, 8 April 2021

Loading...

  • "]]" is not a number.
  • Some use of "[[" in your query was not closed by a matching "]]".

solution

1. this can be done by changing configuration parameters by the site administrators according to the configurations of the server. The maximum number of rows printed is set by the configuration parameter $smwgQMaxInlineLimit (500 by default) for setting the maximal number of rows ever printed by queries or the configuration parameter $smwgQMaxLimit (1000 by default) setting the maximal number of rows ever retrieved by queries in the "LocalSettings.php" file. The limit parameter will not normally help to increase the number beyond this limit.

2-4. please see the query above. please try to use the URL to pass limit and ordinal parameters ([[1]])

5. The issue is not clear. What is meant by hide [[Category:{{#urlget:field}}]] in the #ask queries? In addition, there is no ‘field’ in the above query. Anyway, #urlget: is used to get a parameter from the URL to assign it to a property. A default value is used to set the value if the URL does not contain this parameter. e.g., it should be [[Category:{{#urlget:field|chemistry}}]].

What improvements to that extension you could imagine?

The extension could support multi-value fields for the same parameter. e.g., consider the parameter city. If the user wants to retrieve conferences hold in only Berlin and Hannover, the parameter might be passed in the URL as ?city=Berlin, Hannover. The values then can be easily retrieved by .split(',') method.

Another code improvement: The code should handle the case of parameters like city[[0] and city[0]].