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

From TDWG Terms Wiki
Jump to: navigation, search
m (+documentation)
m (+technical documentation)
 
Line 19: Line 19:
 
  ┼───────────────┼───
 
  ┼───────────────┼───
 
  </tr>
 
  </tr>
 
The template parameters (as created by ask in [[Template:Concept_Table_grouped_by_Collection_1]]) are:
 
{|
 
|-
 
! Values from<br />[[Template:Concept Table grouped by Collection 1]]
 
! Corresponding parameters here<br />({{FULLPAGENAME}})
 
|-
 
|
 
= ? #-
 
= ?terms-internal:enLabel #-
 
= ?terms-internal:enDefinition #-
 
= ?terms-internal:enExample #-
 
= ?terms-internal:enNote #-
 
= ?rdfs:isDefinedBy #-
 
= ?dcterms:identifier #-
 
|
 
<nowiki>|1=</nowiki>
 
<nowiki>|2=</nowiki>
 
<nowiki>|3=</nowiki>
 
<nowiki>|4=</nowiki>
 
<nowiki>|5=</nowiki>
 
<nowiki>|6=</nowiki>
 
<nowiki>|7=</nowiki>
 
|}
 
  
 
== Technical Documentation ==
 
== Technical Documentation ==
  
It uses variables
+
This template was used to render the summary of a concept term within #ask at query time, but later this functionality got shifted to save this generated table layout directly to a property via [[template: Concept]] to get quick #ask-inline query response times and limit the calls of templates during the Wiki rendering. To get a quick display [[property: terms-internal:summary (as table rows) of concept term]] is used like so:
* <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>)
+
 
 +
<pre>{{#ask: [[Category:Concept]] [[vann:termGroup::§]] [[vann:termGroup::{{{1|Audubon Core Attribution Vocabulary}}}]]
 +
| ?terms-internal:summary (as table rows) of concept term =<!-- the property’s content is generated by template:Concept_Table_grouped_by_Collection_2 in template:Concept -->
 +
| link=none
 +
| mainlabel=-
 +
| sep=
 +
| limit={{{limit concepts|500}}}
 +
| searchlabel=<i>&#32;…&nbsp;further results and concept collection §</i>
 +
| sort=terms-internal:lowercasePagename
 +
| intro =<div style="font-weight:bold; font-size:105%; margin:1.5em 0 1em 0;">Concept definitions in [[§]]</div>
 +
<table cellspacing="0" cellpadding="2" border="0" style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; margin-bottom:10px; width:100%;">
 +
| outro =</table>
 +
| default =
 +
}}</pre>
 +
 
 +
And [[property: terms-internal:summary (as table rows) of concept term]] is saved now by [[template: Concept]], i.e. for all concepts in this Wiki.
 +
 
 +
The older code took in more render time and has problems when there are a lot of concepts to query for:
 +
<pre>{{#ask: [[Category:Concept]] [[vann:termGroup::§]] [[vann:termGroup::{{{1|Audubon Core Attribution Vocabulary}}}]]
 +
| ? #-
 +
| ?terms-internal:enLabel #-
 +
| ?terms-internal:enDefinition #-
 +
| ?terms-internal:enExample #-
 +
| ?terms-internal:enNote #-
 +
| ?rdfs:isDefinedBy #-
 +
| ?dcterms:identifier #-
 +
| link=none
 +
| mainlabel=-
 +
| format=template
 +
| template=Concept_Table_grouped_by_Collection_2
 +
| limit={{{limit concepts|500}}}
 +
| searchlabel=<i>&#32;…&nbsp;see also further results in collection {{{1|Audubon Core Attribution Vocabulary}}}</i>
 +
| sort=terms-internal:lowercasePagename
 +
| intro =<div style="font-weight:bold; font-size:105%; margin:1.5em 0 1em 0;">Concept definitions in [[§]]</div>
 +
<table cellspacing="0" cellpadding="2" border="0" style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; margin-bottom:10px; width:100%;">
 +
| outro =</table>
 +
| default =
 +
}}</pre>
 +
 
  
 
=== Dependencies ===
 
=== Dependencies ===
* [[template: Concept]]
+
 
** [[property: terms-internal:summary (as table rows) of concept term]] (contains content created by template {{PAGENAME}})
+
 
* [[mediawikiwiki: Extension:SemanticMediaWiki|Extension:SemanticMediaWiki]]
 
* [[mediawikiwiki: Extension:SemanticMediaWiki|Extension:SemanticMediaWiki]]
 
** <code><nowiki>#ask</nowiki></code>
 
** <code><nowiki>#ask</nowiki></code>
 +
* [[template: Concept]]
 +
** [[property: terms-internal:summary (as table rows) of concept term]] (contains content created by template {{PAGENAME}})
 +
* [[template: Concept Table grouped by Collection (AC1)]]
 
* [[mediawikiwiki: Extension:Variables|Extension:Variables]]
 
* [[mediawikiwiki: Extension:Variables|Extension:Variables]]
 +
** it uses variable <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>)
 
* <s>[[template: Concept to imported URI]]</s>
 
* <s>[[template: Concept to imported URI]]</s>
  
Line 61: Line 78:
 
* ✓ 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)
 
** ✓ 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)
 +
** ✓ refactoring also done for [[template: Concept Table grouped by Collection (AC1)]] --[[User:Andreas Plank|Andreas Plank]] ([[User talk:Andreas Plank|talk]]) 15:41, 28 January 2020 (CET)
  
 
[[Category: SMW ask template]]
 
[[Category: SMW ask template]]

Latest revision as of 15:41, 28 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 name  │ term
┼───────────────┼────────
│ Normative URI │ …
┼───────────────┼───
│ Label         │ …
┼───────────────┼───
│ Definition    │ …
┼───────────────┼───
│ Defined By    │ …
┼───────────────┼───
│               │ Required: No/Yes — Repeatable: Yes/No
┼───────────────┼───
│ Notes:        │ …
┼───────────────┼───
</tr>

Technical Documentation

This template was used to render the summary of a concept term within #ask at query time, but later this functionality got shifted to save this generated table layout directly to a property via template: Concept to get quick #ask-inline query response times and limit the calls of templates during the Wiki rendering. To get a quick display property: terms-internal:summary (as table rows) of concept term is used like so:

{{#ask: [[Category:Concept]] [[vann:termGroup::§]] [[vann:termGroup::{{{1|Audubon Core Attribution Vocabulary}}}]]
| ?terms-internal:summary (as table rows) of concept term =<!-- the property’s content is generated by template:Concept_Table_grouped_by_Collection_2 in template:Concept -->
| link=none
| mainlabel=-
| sep=
| limit={{{limit concepts|500}}}
| searchlabel=<i> … further results and concept collection §</i>
| sort=terms-internal:lowercasePagename
| intro =<div style="font-weight:bold; font-size:105%; margin:1.5em 0 1em 0;">Concept definitions in [[§]]</div>
<table cellspacing="0" cellpadding="2" border="0" style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; margin-bottom:10px; width:100%;">
| outro =</table>
| default =
}}

And property: terms-internal:summary (as table rows) of concept term is saved now by template: Concept, i.e. for all concepts in this Wiki.

The older code took in more render time and has problems when there are a lot of concepts to query for:

{{#ask: [[Category:Concept]] [[vann:termGroup::§]] [[vann:termGroup::{{{1|Audubon Core Attribution Vocabulary}}}]]
| ? #-
| ?terms-internal:enLabel #-
| ?terms-internal:enDefinition #-
| ?terms-internal:enExample #-
| ?terms-internal:enNote #-
| ?rdfs:isDefinedBy #-
| ?dcterms:identifier #-
| link=none
| mainlabel=-
| format=template
| template=Concept_Table_grouped_by_Collection_2
| limit={{{limit concepts|500}}}
| searchlabel=<i> … see also further results in collection {{{1|Audubon Core Attribution Vocabulary}}}</i>
| sort=terms-internal:lowercasePagename
| intro =<div style="font-weight:bold; font-size:105%; margin:1.5em 0 1em 0;">Concept definitions in [[§]]</div>
<table cellspacing="0" cellpadding="2" border="0" style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; margin-bottom:10px; width:100%;">
| outro =</table>
| default =
}}


Dependencies

TODO