Template:LinkClass: Difference between revisions
From DBpedia Mappings
Jump to navigationJump to search
(Created page with '<includeonly>{{#ifeq:{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|0}}|schema\|[http://schema.org/{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|1}} {{item|{{{1|}}}|{{{2|}}}}}]|[[OntologyClas...') |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{# | <includeonly>{{#switch:{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|0}} | ||
|schema\ =[http://schema.org/{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|1}} {{item|{{{1|}}}|{{{2|}}}}}] | |||
|bibo\ =[http://purl.org/ontology/bibo/{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|1}} {{item|{{{1|}}}|{{{2|}}}}}] | |||
|wikidata\ =[http://wikidata.org/entity/{{#explode:{{item|{{{1|}}}|{{{2|}}}}}|:|1}} {{item|{{{1|}}}|{{{2|}}}}}] | |||
|[[OntologyClass:{{item|{{{1|}}}|{{{2|}}}}}|{{item|{{{1|}}}|{{{2|}}}}}]]}}</includeonly><noinclude> | |||
<!-- | <!-- | ||
Explanation of what's going on above: | Explanation of what's going on above: | ||
Line 6: | Line 9: | ||
has a part before the colon ":" (see note 1) | has a part before the colon ":" (see note 1) | ||
and that part is equal to "schema" (see note 2) | and that part is equal to "schema" (see note 2) | ||
then we use the part after the colon and genereate a link to schema.org. | then we use the part after the colon and genereate a link to schema.org or bibo. | ||
Otherwise, we generate an internal link. | Otherwise, we generate an internal link. | ||
Notes: | Notes: | ||
Line 13: | Line 16: | ||
(2) #explode adds a backslash when dealing with colons, | (2) #explode adds a backslash when dealing with colons, | ||
that's why we use the string "schema\", not "schema". | that's why we use the string "schema\", not "schema". | ||
TODO: add more targets besides schema.org | TODO: add more targets besides schema.org and bibo | ||
--> | --> | ||
Generates a link to class from a list. First parameter is the list (comma-separated strings), second parameter is the index (zero-based). | Generates a link to a class from a list. First parameter is the list (comma-separated strings), second parameter is the index (zero-based). | ||
</noinclude> | </noinclude> |
Latest revision as of 10:38, 12 March 2015
Generates a link to a class from a list. First parameter is the list (comma-separated strings), second parameter is the index (zero-based).