Difference between revisions of "Template:Validate and render identifier URI"
From TDWG Terms Wiki
m (moved Template:Check URI conflict to Template:Validate and render identifier URI: name more precise) |
m (added return value=URI and page) |
||
Line 41: | Line 41: | ||
|importURI = {{#switch: {{lc: {{{return value|}}}}} | |importURI = {{#switch: {{lc: {{{return value|}}}}} | ||
|page and uri= [[MediaWiki:Smw import {{{namespace prefix|}}}]] ({{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) | |page and uri= [[MediaWiki:Smw import {{{namespace prefix|}}}]] ({{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) | ||
+ | |uri and page= {{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} ([[MediaWiki:Smw import {{{namespace prefix|}}}]]) | ||
|uri={{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} | |uri={{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} | ||
}}<nowiki></nowiki> {{{info message|}}}{{Warning about conflict of concept URI with SMW import and Concept or Collection | }}<nowiki></nowiki> {{{info message|}}}{{Warning about conflict of concept URI with SMW import and Concept or Collection | ||
Line 48: | 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= {{#var: importNamespaceUri}}{{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{#pos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} ({{ | ||
+ | #sub: {{#var: namespaceURIpageList}} | ||
+ | | 0 | {{#expr: {{#pos: {{#var: namespaceURIpageList}} | ] }} + {{#len: ]] }} }} | ||
+ | }}, <!-- | ||
+ | -->[[MediaWiki:Smw import {{{namespace prefix|}}}]]) | ||
|uri={{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} | |uri={{#var: importNamespaceUri}}{{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}} | ||
}}<nowiki></nowiki> {{{info message|}}} | }}<nowiki></nowiki> {{{info message|}}} | ||
Line 56: | 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: {{#pos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} ({{ | ||
+ | #sub: {{#var: namespaceURIpageList}} | ||
+ | | 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: {{#pos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | -->{{#replace: {{#sub: {{#var: namespaceURIpageList}} | {{#expr: {{#pos:{{#var: namespaceURIpageList}} | ( }} + 1 }} | -1 }} | ) | {{#explode: {{{concept page|{{PAGENAME}}}}}|:|1}}) }} | ||
Line 62: | Line 72: | ||
|concept namespace prefix={{{namespace prefix|}}} | |concept namespace prefix={{{namespace prefix|}}} | ||
}} | }} | ||
− | |#default={{#vardefine: hasConflict | 1 }}Warning: no namespace URI defined yet [[File:Warning_icon.svg|x10px|link=]]<nowiki></nowiki> {{{info message|}}} | + | |#default={{#vardefine: hasConflict | 1 }} Warning: no namespace URI defined yet [[File:Warning_icon.svg|x10px|link=]]<nowiki></nowiki> {{{info message|}}} |
}} | }} | ||
}}{{ | }}{{ | ||
Line 79: | Line 89: | ||
{{!}}concept page=<!-- optional (default is <nowiki>{{PAGENAME}}</nowiki>) --> | {{!}}concept page=<!-- optional (default is <nowiki>{{PAGENAME}}</nowiki>) --> | ||
{{!}}set management category=<!-- optional: value may be any string, e.g. "true", "1" ("0", "no", "false" is false) --> | {{!}}set management category=<!-- optional: value may be any string, e.g. "true", "1" ("0", "no", "false" is false) --> | ||
− | {{!}}return value=<!-- optional: "page and URI" or "URI" (default return: void or a collapsible warning message box) --> | + | {{!}}return value=<!-- optional: "page and URI", "URI and page" or "URI" (default return: void or a collapsible warning message box) --> |
{{!}}info message=<!-- optional: message that appears after URI but before any warnings, e.g. for forms with <nowiki>{{#info: message=text}}</nowiki> --> | {{!}}info message=<!-- optional: message that appears after URI but before any warnings, e.g. for forms with <nowiki>{{#info: message=text}}</nowiki> --> | ||
<nowiki>}}</nowiki></div> | <nowiki>}}</nowiki></div> | ||
Line 94: | Line 104: | ||
{{!}}concept page=<!-- optional (default is <nowiki>{{PAGENAME}}</nowiki>) --> | {{!}}concept page=<!-- optional (default is <nowiki>{{PAGENAME}}</nowiki>) --> | ||
{{!}}set management category=<!-- optional: value may be any string, e.g. "true", "1" ("0", "no", "false" is false) --> | {{!}}set management category=<!-- optional: value may be any string, e.g. "true", "1" ("0", "no", "false" is false) --> | ||
− | {{!}}return value=<!-- optional: "page and URI" or "URI" (default return: void or a collapsible warning message box) --> | + | {{!}}return value=<!-- optional: "page and URI", "URI and page" or "URI" (default return: void or a collapsible warning message box) --> |
{{!}}info message=<!-- optional: message that appears after URI but before any warnings, e.g. for forms with <nowiki>{{#info: message=text}}</nowiki> --> | {{!}}info message=<!-- optional: message that appears after URI but before any warnings, e.g. for forms with <nowiki>{{#info: message=text}}</nowiki> --> | ||
<nowiki>}}</nowiki></div> | <nowiki>}}</nowiki></div> |
Revision as of 14:43, 25 October 2012
Technical documentation
Dependent on: Template:Warning about conflict of concept URI with SMW import and Concept or Collection
Sets management category: Category: Check semantic properties (suppressed by parameter "set management category=no")
Uses variables: hasConflict
, importNamespaceUri
, namespaceURIpageList