Difference between revisions of "Template:Concept to imported docURI"

From TDWG Terms Wiki
Jump to: navigation, search
m (fix for closing ])
 
(One intermediate revision 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
 
   -->|{{!}}|1}}<!--  
 
   -->|{{!}}|1}}<!--  
Line 20: Line 20:
 
-->}}<!--
 
-->}}<!--
 
-->{{#if: {{#var: importDocURI}}<!--
 
-->{{#if: {{#var: importDocURI}}<!--
   then-->|{{#vardefineecho: importDocURI | {{#var: importDocURI}}<!-- fix closing ] -->{{#if: {{#pos: {{#var: importDocURI}}|[}}|<!-- has [ check closing ] -->{{#if: {{#pos:{{#var: importDocURI}}|]}}|<!-- all OK -->|<!-- should have closing ] -->]}}|<!-- has no beginning '[' and probably no closing ']' -->}}}}<!--
+
   then-->|{{#var: importDocURI}}<!--
 
   else-->|{{{1|unknown documentation URI}}}<!--
 
   else-->|{{{1|unknown documentation URI}}}<!--
 
-->}}<!-- end if
 
-->}}<!-- end if
Line 36: Line 36:
 
* <code>#var importNameSpace</code>
 
* <code>#var importNameSpace</code>
 
* <code>#var importDocURI</code> (is in general an already formatted Wiki link)
 
* <code>#var importDocURI</code> (is in general an already formatted Wiki link)
 +
 +
See also [[template: Concept to imported URI]]
 
[[Category: Helper tool for ontologies]]
 
[[Category: Helper tool for ontologies]]
 
</noinclude>
 
</noinclude>

Latest revision as of 12:24, 19 October 2012

This template gets the documentation 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 docURI|dc:creator}}]] → Dublin Core Metadata Element Set, Version 1.1

Notes:

  • an SMW import page, e.g. MediaWiki:Smw_import_impns must exist

Technical documentation

Uses variables:

  • #var importNameSpace
  • #var importDocURI (is in general an already formatted Wiki link)

See also template: Concept to imported URI