Difference between revisions of "Template:Bugfix SMW hased URI"
From TDWG Terms Wiki
m (Andreas Plank moved page Template:Buxfix SMW hased URI to Template:Bugfix SMW hased URI without leaving a redirect: typo in page name) |
m (usage not recommended because of not proper resulting RDF) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude> | + | <noinclude>'''Deprecated. Usage not recommended because it creates but correct property values but not proper RDF values''' |
+ | |||
Problem: Semantic MediaWiki | Problem: Semantic MediaWiki | ||
* stores a hashed URL like <code><nowiki>[[URL::http://www.w3.org/2004/02/skos/core#]]</nowiki></code> | * stores a hashed URL like <code><nowiki>[[URL::http://www.w3.org/2004/02/skos/core#]]</nowiki></code> | ||
* as http://www.w3.org/2004/02/skos/core cutting the “#” off | * as http://www.w3.org/2004/02/skos/core cutting the “#” off | ||
+ | * an URL value like <nowiki>http://www.w3.org/2004/02/skos/core#</nowiki> will not appear in the RDF | ||
− | So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs. In addition | + | So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs in the property but not in the RDF it is unfortunately still <nowiki>http://www.w3.org/2004/02/skos/core#%20</nowiki>. In addition |
* [[:Category:Internal - SMW bugfix URI hashed]] is set | * [[:Category:Internal - SMW bugfix URI hashed]] is set | ||
== Usage == | == Usage == | ||
− | + | <nowiki>{{</nowiki>{{PAGENAME}}|uri=http://www.w3.org/2004/02/skos/core#<nowiki>|property=vann:preferredNamespaceUri}}</nowiki> | |
− | + | ||
+ | |||
+ | == Parameters == | ||
+ | |||
+ | {| class="vertical-align-top" | ||
+ | |- | ||
+ | | 1=<br />uri= || (mandatory) uri value | ||
+ | |- | ||
+ | | property= || (mandatory) the property to set | ||
+ | |} | ||
+ | |||
+ | == Technical Issues == | ||
+ | |||
+ | TODO Warning messages like: | ||
+ | <div style="display:inline-block;background-color:#f6f6f6;padding:2ex;">“URIs of the form http://www.w3.org/2000/01/rdf-schema# are not allowed”</div> | ||
+ | |||
+ | Some URLs are not allowed at all, because they are evaluated and translated some how in SemanticMediaWiki (./includes/export/SMW_Exporter.php) and these are: | ||
+ | * http://www.w3.org/2002/07/owl# (owl::…) | ||
+ | * http://www.w3.org/1999/02/22-rdf-syntax-ns# (rdf::…) | ||
+ | * http://www.w3.org/2000/01/rdf-schema# (rdfs::…) | ||
+ | TODO: | ||
+ | * those properties need eventually a different approach: use a synonym property page with <code><nowiki>[[Imported from::rdf:…]]</nowiki></code> ? | ||
+ | * or empty [[MediaWiki:Smw uri blacklist]] might be a work around | ||
− | |||
− | |||
− | |||
[[Category:Bugfix]] | [[Category:Bugfix]] | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
-->{{#ifexpr: {{#rpos: {{{1|{{{uri|}}}}}}|#}} = ({{#len: {{{1|{{{uri|}}}}}}}} - 1)<!-- | -->{{#ifexpr: {{#rpos: {{{1|{{{uri|}}}}}}|#}} = ({{#len: {{{1|{{{uri|}}}}}}}} - 1)<!-- | ||
− | then-->|{{{1|{{{uri|}}}}}}%20[[Category:Internal - SMW bugfix URI hashed]]<!-- | + | then-->|{{#set: {{{property|}}}={{{1|{{{uri|}}}}}}%20}}<!-- TODO add %20 or not add it to produce proper RDF? -->[[Category:Internal - SMW bugfix URI hashed]]<!-- |
− | else-->|{{{1|{{{uri|}}}}}}<!-- | + | else-->|{{#set: {{{property|}}}={{{1|{{{uri|}}}}}}}}<!-- |
-->}}<!-- end if | -->}}<!-- end if | ||
--></includeonly> | --></includeonly> |
Latest revision as of 23:59, 7 September 2016
Deprecated. Usage not recommended because it creates but correct property values but not proper RDF values
Problem: Semantic MediaWiki
- stores a hashed URL like
[[URL::http://www.w3.org/2004/02/skos/core#]]
- as http://www.w3.org/2004/02/skos/core cutting the “#” off
- an URL value like http://www.w3.org/2004/02/skos/core# will not appear in the RDF
So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs in the property but not in the RDF it is unfortunately still http://www.w3.org/2004/02/skos/core#%20. In addition
Usage
{{Bugfix SMW hased URI|uri=http://www.w3.org/2004/02/skos/core#|property=vann:preferredNamespaceUri}}
Parameters
1= uri= |
(mandatory) uri value |
property= | (mandatory) the property to set |
Technical Issues
TODO Warning messages like:
“URIs of the form http://www.w3.org/2000/01/rdf-schema# are not allowed”
Some URLs are not allowed at all, because they are evaluated and translated some how in SemanticMediaWiki (./includes/export/SMW_Exporter.php) and these are:
- http://www.w3.org/2002/07/owl# (owl::…)
- http://www.w3.org/1999/02/22-rdf-syntax-ns# (rdf::…)
- http://www.w3.org/2000/01/rdf-schema# (rdfs::…)
TODO:
- those properties need eventually a different approach: use a synonym property page with
[[Imported from::rdf:…]]
? - or empty MediaWiki:Smw uri blacklist might be a work around