Difference between revisions of "Template:smwAsk CountPropertyRepetitionsOnSinglePage"

From TDWG Terms Wiki
Jump to: navigation, search
(Created page with "<noinclude>This template counts the number of separate values (repeated occurrences with values) of a single property on a single page. Parameters: Pagename, Propertyname : T...")
 
Line 4: Line 4:
 
: Test: using Pagename=dcterms:accessRights and Propertyname=skos:definition
 
: Test: using Pagename=dcterms:accessRights and Propertyname=skos:definition
 
: Result: {{smwAsk_CountPropertyRepetitionsOnSinglePage|Pagename=dcterms:accessRights|Propertyname=skos:definition}}
 
: Result: {{smwAsk_CountPropertyRepetitionsOnSinglePage|Pagename=dcterms:accessRights|Propertyname=skos:definition}}
 +
: (at time of writing, the correct result was "4")
  
 
Problem: with list, ol, ul, the separator sep= used for multiple values of a single property on a single page. However, no template can be called for each value, the template is called only once per page (original ideas was to use a template). Since we know due to the ask query that all property values are from a single page, we measure the string length once with a 1-char separator, then a 2-char separator, and calculate the difference.
 
Problem: with list, ol, ul, the separator sep= used for multiple values of a single property on a single page. However, no template can be called for each value, the template is called only once per page (original ideas was to use a template). Since we know due to the ask query that all property values are from a single page, we measure the string length once with a 1-char separator, then a 2-char separator, and calculate the difference.

Revision as of 22:07, 15 October 2012

This template counts the number of separate values (repeated occurrences with values) of a single property on a single page.

Parameters: Pagename, Propertyname

Test: using Pagename=dcterms:accessRights and Propertyname=skos:definition
Result: 4
(at time of writing, the correct result was "4")

Problem: with list, ol, ul, the separator sep= used for multiple values of a single property on a single page. However, no template can be called for each value, the template is called only once per page (original ideas was to use a template). Since we know due to the ask query that all property values are from a single page, we measure the string length once with a 1-char separator, then a 2-char separator, and calculate the difference. 0