Difference between revisions of "Template:Bugfix SMW hased URI"

From TDWG Terms Wiki
Jump to: navigation, search
m
m (usage not recommended because of not proper resulting RDF)
 
(One intermediate revision 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
  
Line 20: Line 22:
 
| property= || (mandatory) the property to set
 
| 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-->|{{#set: {{{property|}}}={{{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-->|{{#set: {{{property|}}}={{{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:

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