Difference between revisions of "Template:Show grouped labels of concept collection/doc"
From TDWG Terms Wiki
m |
m (removed TODO (done); +Category: Helper tool for ontologies) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Documentation/subpage}} | {{Documentation/subpage}} | ||
− | + | ||
− | + | '''Summary:''' Show and list (all) labels and concept names of one concept collection but format it nicely: | |
+ | * Concept collection is a section | ||
+ | * labels and concept names become grouped as a list | ||
== Usage == | == Usage == | ||
Line 10: | Line 12: | ||
|skos-inScheme=ABCD 2 | |skos-inScheme=ABCD 2 | ||
}} | }} | ||
+ | |||
+ | On a page named “''ABCD 2''” it is possible to use this template without parameters (so the Wiki page name will be used as value for the requested concept scheme): | ||
+ | <nowiki>{{</nowiki>{{BASEPAGENAME}}}} | ||
+ | |||
== Parameters == | == Parameters == | ||
Line 20: | Line 26: | ||
| '''<code><nowiki>|skos-inScheme=</nowiki></code>''' '''<code><nowiki>|1=</nowiki></code>''' | | '''<code><nowiki>|skos-inScheme=</nowiki></code>''' '''<code><nowiki>|1=</nowiki></code>''' | ||
| the name of the scheme, eg “ABCD 2” | | the name of the scheme, eg “ABCD 2” | ||
− | | | + | | (the Wiki page name is used) |
|- | |- | ||
− | | <code><nowiki>|limit=</nowiki></code> | + | | <code><nowiki>|skos-inScheme limit=</nowiki></code> |
− | | the requested limit | + | | the requested limit of [[property: skos:inScheme]] collections |
− | | | + | | 100 |
+ | |- | ||
+ | | <code><nowiki>|in collection concepts limit=</nowiki></code> | ||
+ | | the requested limit within one collection itself (not the overall limit) | ||
+ | | 1000 | ||
|} | |} | ||
Line 31: | Line 41: | ||
Dependencies: | Dependencies: | ||
<!-- * [[template: …]] --> | <!-- * [[template: …]] --> | ||
− | * [[Category: Concept collection]] (the name of the collections) | + | * [[:Category: Concept collection]] (the name of the collections) |
* [[property: skos:inScheme]] | * [[property: skos:inScheme]] | ||
* [[property: vann:termGroup]] | * [[property: vann:termGroup]] | ||
+ | * [[property: terms-internal:enLabel2Pagename]] (pre-formatted label link) | ||
+ | * [[property: terms-internal:has vannTermGroup]] | ||
* [[mediawikiwiki: Extension: Arrays | Extension: Arrays]] | * [[mediawikiwiki: Extension: Arrays | Extension: Arrays]] | ||
* [[mediawikiwiki: Extension: Semantic MediaWiki | Extension: Semantic MediaWiki]] | * [[mediawikiwiki: Extension: Semantic MediaWiki | Extension: Semantic MediaWiki]] | ||
+ | |||
+ | === Query and Rendering Optimisation === | ||
+ | |||
+ | It is fasted to use ''pre-formatted'' properties to just display them in conjunction of <code>#ask</code>. When using template rendering within <code>#ask</code> it slows down as the number of concepts grows. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Use Case !! Number of Concepts !! Response time | ||
+ | |- | ||
+ | | | ||
+ | * ''pre-formatted'' properties | ||
+ | | 1400 | ||
+ | | 2-3 sec. | ||
+ | |- | ||
+ | | | ||
+ | * inline query with template calls | ||
+ | | 1400 | ||
+ | | 5-7 sec. | ||
+ | |- | ||
+ | | | ||
+ | * global array that gets filtered for concept collections | ||
+ | | 1400 | ||
+ | | 5(6)-7(8) sec. | ||
+ | |} | ||
+ | |||
+ | Perhaps there is still room for optimisations. | ||
<!-- === See also === | <!-- === See also === | ||
Line 41: | Line 79: | ||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | ||
− | + | [[Category: Helper tool for ontologies]] | |
</includeonly> | </includeonly> |
Latest revision as of 16:48, 20 January 2020
Summary: Show and list (all) labels and concept names of one concept collection but format it nicely:
- Concept collection is a section
- labels and concept names become grouped as a list
Usage
{{Show grouped labels of concept collection|ABCD 2}}
or with parameter:
{{Show grouped labels of concept collection |skos-inScheme=ABCD 2 }}
On a page named “ABCD 2” it is possible to use this template without parameters (so the Wiki page name will be used as value for the requested concept scheme):
{{Show grouped labels of concept collection}}
Parameters
Bold parameters are mandatory, all other are optional:
Parameter | Comment, Example | Default |
---|---|---|
|skos-inScheme= |1=
|
the name of the scheme, eg “ABCD 2” | (the Wiki page name is used) |
|skos-inScheme limit=
|
the requested limit of property: skos:inScheme collections | 100 |
|in collection concepts limit=
|
the requested limit within one collection itself (not the overall limit) | 1000 |
Technical Documentation
Dependencies:
- Category: Concept collection (the name of the collections)
- property: skos:inScheme
- property: vann:termGroup
- property: terms-internal:enLabel2Pagename (pre-formatted label link)
- property: terms-internal:has vannTermGroup
- Extension: Arrays
- Extension: Semantic MediaWiki
Query and Rendering Optimisation
It is fasted to use pre-formatted properties to just display them in conjunction of #ask
. When using template rendering within #ask
it slows down as the number of concepts grows.
Use Case | Number of Concepts | Response time |
---|---|---|
|
1400 | 2-3 sec. |
|
1400 | 5-7 sec. |
|
1400 | 5(6)-7(8) sec. |
Perhaps there is still room for optimisations.