Difference between revisions of "Template:Concept to imported URI"
From TDWG Terms Wiki
m (fix if no importURI) |
m (fix ] for link) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
-->{{#explode:<!-- | -->{{#explode:<!-- | ||
get 1st line=cut on 1st line break | get 1st line=cut on 1st line break | ||
− | -->{{#explode:{{MediaWiki:Smw import {{#var: importNameSpace}}}}| | + | -->{{#explode:{{MediaWiki:Smw import {{#var: importNameSpace}}}}|<nowiki></nowiki> |
− | |0}}<!-- | + | <nowiki></nowiki>|0}}<!-- |
cut on | of first line | cut on | of first line | ||
-->|{{!}}|0}}<!-- | -->|{{!}}|0}}<!-- | ||
− | add pagename to bas URL -->{{{1|property not set}}}<!-- | + | add pagename to bas URL -->{{#explode: {{{1|property not set}}}|{{#var: importNameSpace}}:|1}}<!-- |
-->}}<!-- | -->}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->{{#if: {{#var: importURI}}<!-- | -->{{#if: {{#var: importURI}}<!-- | ||
then-->|{{#var: importURI}}<!-- | then-->|{{#var: importURI}}<!-- | ||
− | else-->|{{{1|unknown URI}}}<!-- | + | else-->|{{{default|{{{1|unknown URI}}}}}}<!-- |
-->}}<!-- end if | -->}}<!-- end if | ||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
− | This template gets the [[Property:Equivalent URI|Equivalent URI]] of an imported concept | + | This template gets the [[Property:Equivalent URI|Equivalent URI]] of an imported concept from its MediaWiki import page, e.g. MediaWiki:Smw_import_<abbr title="impns=import name space (a locally defined import name space)">impns</abbr>. This template can be used only for {{Abbr|SMW}} data types [http://semantic-mediawiki.org/wiki/Help:Type_URL URL] and [http://semantic-mediawiki.org/wiki/Help:Type_Annotation_URI Annotation URI]. If you have data type [http://semantic-mediawiki.org/wiki/Help:Type_Page Page] you can make SMW to resolve to ther external URI by pointing to the property page where the impoert must be defined there (=has a <nowiki>[[Imported from::</nowiki><abbr title="impns=import name space (a locally defined import name space)">impns</abbr><nowiki>:conceptTerm]]</nowiki>). |
+ | |||
Usage:<pre> | Usage:<pre> | ||
[[my-URI-property::{{Concept to imported URI|dc:creator}}]] | [[my-URI-property::{{Concept to imported URI|dc:creator}}]] | ||
+ | {{Concept to imported URI|property|default=}} → returns default (i.e. "". Usually it returns the string and *not* "") | ||
</pre> | </pre> | ||
Notes: | Notes: | ||
− | * an SMW import page MediaWiki: | + | * an SMW import page, e.g. MediaWiki:Smw_import_<abbr title="impns=import name space (a locally defined import name space)">impns</abbr> must exist |
+ | |||
+ | == Technical documentation == | ||
+ | Uses variables: | ||
+ | * <code>#var importNameSpace</code> | ||
+ | * <code>#var importURI</code> | ||
+ | |||
+ | See also | ||
+ | * [[template: Concept to imported docURI]] | ||
+ | * [[template: Namespace_prefix_to_imported_namespace_URI]] | ||
[[Category: Helper tool for ontologies]] | [[Category: Helper tool for ontologies]] | ||
</noinclude> | </noinclude> |
Latest revision as of 13:55, 23 October 2012
This template gets the Equivalent URI of an imported concept from its MediaWiki import page, e.g. MediaWiki:Smw_import_impns. This template can be used only for SMW data types URL and Annotation URI. If you have data type Page you can make SMW to resolve to ther external URI by pointing to the property page where the impoert must be defined there (=has a [[Imported from::impns:conceptTerm]]).
Usage:[[my-URI-property::{{Concept to imported URI|dc:creator}}]] {{Concept to imported URI|property|default=}} → returns default (i.e. "". Usually it returns the string and *not* "")
Notes:
- an SMW import page, e.g. MediaWiki:Smw_import_impns must exist
Technical documentation
Uses variables:
-
#var importNameSpace
-
#var importURI
See also