We are using the RDF views (of RDBMS data) in Virtuoso, and it's working really 
well for us. However, we have a problem with the URIs generated by Virtuoso.

The root cause of the problem is that the primary keys in the original 
databases contain non-ASCII characters. This is not good, but it's the way it 
is, and we can't change it.



We want to use these primary keys in the resulting RDF, which means we do 
something like this:

create iri class prd:product_iri "http://example.org/product/%s";
    (in product_id varchar not null) .

Unfortunately, this causes the resulting URI to look like this in SPARQL query 
results:

  http://example.org/product/Ø123

That is, the "Ø" character is represented directly. This is, as far as I can 
tell, not legal in RDF, and it causes a number of problems for us with other 
components in our system.
  http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-Graph-URIref


One alternative is to use %U instead of %s, but that gives this result:
  http://example.org/product/Ã~123

That is, inside the SPARQL XML returned by Virtuoso the Ø character is 
UTF-8-encoded. So, if the XML is in UTF-8, the Ø character is double-encoded in 
UTF-8. There's no way we can use that.


What we really want, and as far as we can tell, the only thing that would be 
legal, is this:
  http://example.org/product/%C3%98123

I've looked at the documentation, but I can't seem to find any %X combination 
that produces the correct results in this case. Is there any? If not, could you 
add one?

We've created a workaround for now by using SQL functions in the view 
definitions, but unfortunately that makes the RDF views dramatically slower.

--Lars M.
http://www.garshol.priv.no/tmphoto/
http://www.garshol.priv.no/blog/


Reply via email to