Difference between revisions of "Template:Concept Table grouped by Collection 2"

From TDWG Terms Wiki
Jump to: navigation, search
m (refacoring: try to reduce template calls (dcterms:identifier vs. usage of template: Concept to imported URI during inline #ask); added dcterms:identifier)
m (+documentation)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template outputs a single term as a set of rows in a table (which must be opened and closed by an external template).
+
This template outputs a single table row (&lt;tr>) that contains generic information about ''one term'' (any wrapping &lt;table> must be provided by an external template):
 +
&lt;tr> ────────────────
 +
│ ''concept term name''
 +
┼───────────────┬───
 +
│ Normative URI │ …
 +
┼───────────────┼───
 +
│ Label        │ …
 +
┼───────────────┼───
 +
│ Definition    │ …
 +
┼───────────────┼───
 +
│ Defined By    │ …
 +
┼───────────────┼───
 +
│              │ Required: No/Yes — Repeatable: Yes/No
 +
┼───────────────┼───
 +
│ Notes:        │ …
 +
┼───────────────┼───
 +
&lt;/tr>
  
 
The template parameters (as created by ask in [[Template:Concept_Table_grouped_by_Collection_1]]) are:
 
The template parameters (as created by ask in [[Template:Concept_Table_grouped_by_Collection_1]]) are:
Line 29: Line 45:
  
 
It uses variables  
 
It uses variables  
* <code>constraintOfConcept</code> (repeatable, required is saved in [[property: cardinality]] but is contained in subobject [[property: constraint of concept |constraint of concept]], which will ask for <nowiki>{{#ask [[constraint of concept::concept-page-name i.e. {{{1}}}]]}}</nowiki>)
+
* <code>constraintOfConcept</code> (repeatable, required is saved in [[property: cardinality]] but is contained in subobject [[property: constraint of concept |constraint of concept]], which will ask for <code><nowiki>{{#ask [[constraint of concept::concept-page-name i.e. {{{1}}}]]}}</nowiki></code>)
  
 
Dependencies:
 
Dependencies:
Line 35: Line 51:
 
** <code><nowiki>#ask</nowiki></code>
 
** <code><nowiki>#ask</nowiki></code>
 
* [[mediawikiwiki: Extension:Variables|Extension:Variables]]
 
* [[mediawikiwiki: Extension:Variables|Extension:Variables]]
* [[template: Concept to imported URI]]
+
* <s>[[template: Concept to imported URI]]</s>
  
 
== TODO ==
 
== TODO ==
  
REDUCE TEMPLATE CALLS, e.g. <code><nowiki>{{Concept to imported URI}}</nowiki></code> --[[User:Andreas Plank|Andreas Plank]] ([[User talk:Andreas Plank|talk]]) 17:07, 23 January 2020 (CET)
+
* reduce template calls, e.g. <code><nowiki>{{Concept to imported URI}}</nowiki></code> --[[User:Andreas Plank|Andreas Plank]] ([[User talk:Andreas Plank|talk]]) 17:07, 23 January 2020 (CET)
 +
** check further optimisation, e.g. saving rendered table row on the concept level to an internal property ([[property: terms-internal:summary (as table rows) of concept term]]) --[[User:Andreas Plank|Andreas Plank]] ([[User talk:Andreas Plank|talk]]) 14:14, 27 January 2020 (CET)
 +
 
 
[[Category: SMW ask template]]
 
[[Category: SMW ask template]]
 
</noinclude><includeonly>
 
</noinclude><includeonly>
Line 78: Line 96:
 
|<!--examples--><tr>
 
|<!--examples--><tr>
 
<td style="text-align:right;vertical-align:top;background:#EEE;border-right:1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">Examples</td>
 
<td style="text-align:right;vertical-align:top;background:#EEE;border-right:1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">Examples</td>
<td style="border-right: 1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">{{{4|}}}</td></tr>  
+
<td style="border-right: 1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">{{{4|enExample}}}</td></tr>  
 
}}{{
 
}}{{
 
#if: {{{5|}}}
 
#if: {{{5|}}}
 
|<!--notes--><tr>
 
|<!--notes--><tr>
 
<td style="text-align:right;vertical-align:top;background:#EEE;border-right:1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">Notes:</td>
 
<td style="text-align:right;vertical-align:top;background:#EEE;border-right:1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">Notes:</td>
<td style="border-right: 1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">{{{5|}}}</td></tr>  
+
<td style="border-right: 1px solid #CCC; border-bottom: 1px solid #CCC; padding:0.5em;">{{{5|enNote}}}</td></tr>  
 
}}</includeonly>
 
}}</includeonly>

Revision as of 14:15, 27 January 2020

This template outputs a single table row (<tr>) that contains generic information about one term (any wrapping <table> must be provided by an external template):

<tr> ────────────────
│ concept term name
┼───────────────┬───
│ Normative URI │ …
┼───────────────┼───
│ Label         │ …
┼───────────────┼───
│ Definition    │ …
┼───────────────┼───
│ Defined By    │ …
┼───────────────┼───
│               │ Required: No/Yes — Repeatable: Yes/No
┼───────────────┼───
│ Notes:        │ …
┼───────────────┼───
</tr>

The template parameters (as created by ask in Template:Concept_Table_grouped_by_Collection_1) are:

Values from
Template:Concept Table grouped by Collection 1
Corresponding parameters here
(Template:Concept Table grouped by Collection 2)
= ? #-
= ?terms-internal:enLabel #-
= ?terms-internal:enDefinition #-
= ?terms-internal:enExample #-
= ?terms-internal:enNote #-
= ?rdfs:isDefinedBy #-
= ?dcterms:identifier #-
|1=
|2=
|3=
|4=
|5=
|6=
|7=

Technical Documentation

It uses variables

  • constraintOfConcept (repeatable, required is saved in property: cardinality but is contained in subobject constraint of concept, which will ask for {{#ask [[constraint of concept::concept-page-name i.e. {{{1}}}]]}})

Dependencies:

TODO