Difference between revisions of "Template:Validate and render identifier URI"
From TDWG Terms Wiki
m (Check semantic properties → Category:Internal - URI conflict) |
m (try fixing find "(" position correctly) |
||
Line 29: | Line 29: | ||
-->{{#if: {{#var: namespaceURIpageList}}<!-- | -->{{#if: {{#var: namespaceURIpageList}}<!-- | ||
check e.g. "(http://rs.tdwg.org/ac/terms/)" | check e.g. "(http://rs.tdwg.org/ac/terms/)" | ||
− | -->|{{#if: {{# | + | -->|{{#if: {{#rpos: {{#var: namespaceURIpageList}} | ({{#var: importNamespaceUri}}) }}<!-- |
-->|_is_definedURI<!-- | -->|_is_definedURI<!-- | ||
-->|{{#if: {{#var: importNamespaceUri}} <!-- | -->|{{#if: {{#var: importNamespaceUri}} <!-- | ||
Line 49: | Line 49: | ||
|importURI_is_definedURI={{#switch: {{lc: {{{return value|}}}}} | |importURI_is_definedURI={{#switch: {{lc: {{{return value|}}}}} | ||
|page and uri= {{#replace: {{#var: namespaceURIpageList}} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | |page and uri= {{#replace: {{#var: namespaceURIpageList}} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | ||
− | |uri and page= <!-- TODO: check if neccessary → {{#var: importNamespaceUri}} --> {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{# | + | |uri and page= <!-- TODO: check if neccessary → {{#var: importNamespaceUri}} --> {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{#rpos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} ({{ |
#sub: {{#var: namespaceURIpageList}} | #sub: {{#var: namespaceURIpageList}} | ||
| 0 | {{#expr: {{#pos: {{#var: namespaceURIpageList}} | ] }} + {{#len: ]] }} }} | | 0 | {{#expr: {{#pos: {{#var: namespaceURIpageList}} | ] }} + {{#len: ]] }} }} | ||
Line 62: | Line 62: | ||
|definedURI={{#switch: {{lc: {{{return value|}}}}} | |definedURI={{#switch: {{lc: {{{return value|}}}}} | ||
|page and uri= {{#replace: {{#var: namespaceURIpageList}} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | |page and uri= {{#replace: {{#var: namespaceURIpageList}} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | ||
− | |uri and page= {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{# | + | |uri and page= {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{#rpos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} ({{ |
#sub: {{#var: namespaceURIpageList}} | #sub: {{#var: namespaceURIpageList}} | ||
| 0 | {{#expr: {{#pos: {{#var: namespaceURIpageList}} | ] }} + {{#len: ]] }} }} | | 0 | {{#expr: {{#pos: {{#var: namespaceURIpageList}} | ] }} + {{#len: ]] }} }} | ||
}}) | }}) | ||
|uri=<!-- URI from e.g. "[[:Audubon Core|Audubon Core]] (http://rs.tdwg.org/ac/terms/)" | |uri=<!-- URI from e.g. "[[:Audubon Core|Audubon Core]] (http://rs.tdwg.org/ac/terms/)" | ||
− | -->{{#replace: {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{# | + | -->{{#replace: {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{#rpos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} |
}}<div style="display:none;" class="debug-template-Validate-and-render-identifier-URI">definedURI: {{lc: {{{return value|}}}}}</div>{{Warning about conflict of concept URI with SMW import and Concept or Collection | }}<div style="display:none;" class="debug-template-Validate-and-render-identifier-URI">definedURI: {{lc: {{{return value|}}}}}</div>{{Warning about conflict of concept URI with SMW import and Concept or Collection | ||
|import namespace URI={{#var: importNamespaceUri}} | |import namespace URI={{#var: importNamespaceUri}} |
Revision as of 15:29, 16 November 2012
Technical documentation
Dependent on: Template:Warning about conflict of concept URI with SMW import and Concept or Collection
Sets management category: Category: Internal - URI conflict (suppressed by parameter "set management category=no")
Uses variables: hasConflict
, importNamespaceUri
, namespaceURIpageList