On 25/06/14 10:58, Ewa Szwed wrote:
Hi, I have another question.
During my process the tdbupdate for inserts (INSERT DATA) complains about
the following triple:
<http://rdf.freebase.com/ns/m.01065_86> <
http://rdf.freebase.com/ns/common.topic.topic_equivalent_webpage> <
http://www.espa
%F1aescultura.es/es/obras_de_excelencia/museo_sorolla/la_hora_del_bano_valencia.html>
.
com.hp.hpl.jena.query.QueryParseException: Line 48497, column 113:
org.apache.jena.iri.impl.IRIImplException:
<http://www.espa%F1aescultura.es/es/obras_de_excelencia/museo_sorolla/la_hora_del_bano_valencia.html>
Code: 28/NOT_DNS_NAME in HOST: The host component did not
meet the restrictions on DNS names.
It could be made a warning in SPARQL as well but ideally, a legal URi
would be better. %-encoding does not apply in host names; there is a
different encoding scheme called "punycode" that then matches the DNS
rules for DNS hostnames. The whole IRI is made messy by all the
different variations for the variable parts.
For this case the validator (riot) issues just warning and tdbloaded
inserted this triples without a problem.
Is this possible to have this triple added using tdbupdate using some
switches?
One radical solution is to use ñ not %F1 (i.e. decode) because it is
legal in IRIs.
There is a high-risk way -
com.hp.hpl.jena.n3.IRIResolver.suppressExceptions();
but it stops all reporting.
Other workarounds are messy - what you need to do is change the resolver
in the update request:
com.hp.hpl.jena.n3.IRIResolver resolverSilencer = new IRIResolver2() ;
UpdateRequest up = UpdateFactory.create() ;
up.setResolver(resolverSilencer) ;
UpdateFactory.parse(up, ....) ;
public static class IRIResolver2
extends com.hp.hpl.jena.n3.IRIResolver {
@Override
public String resolve(String relURI) {
if ( relURI.startsWith("http://") )
return relURI ;
return super.resolve(relURI) ;
}
}
I have at least added
com.hp.hpl.jena.n3.IRIResolver.setShowExceptions(boolean) ;
so it can be both unset and reset.
I would like to progress with this triple as well with tdbupdate to have
consistent behaviour.
agreed - JENA-730 records the issue.
Ewa