fadmaa / grefine-rdf-extension

An extension to Google Refine that enables graphical mapping of Google Refine project data to an RDF skeleton and then exporting it in RDF format
http://refine.deri.ie
Other
94 stars 55 forks source link

Unable to include ":" in a uri #81

Closed htanya closed 10 years ago

htanya commented 10 years ago

I am currently experiencing the issue of not being able to include ":" in a uri when appending in front of the value. It works fine when the cells content is text, but not when I want the cells content to be a uri.

Example: I would like to have source:value, but as long as I use ":", I cannot produce a uri. However, I can produce a uri if I remove ":", ex. sourcevalue or use a different seperator "_", ex. source_value.

How I am selecting my value: "namespace:"+value

fadmaa commented 10 years ago

Currently, you need to enter the full URI you cannot use the shorthand namespace: + value because it is interpreted as relative URI and resolved against the base URI

Adding support for namespaces URI sounds like a good idea for future extension however it is tricky and needs to be implemented with care to avoid accidentally interpreting some value as namespace:+value although it is meant to be resolved against the base URI

micheldumontier commented 10 years ago

We are indeed specifying a full URI of the form - http://bio2rdf.org/cardiotox:

fadmaa commented 10 years ago

then that should work. Can you provide an example of a value and the expression you used? may be also try: 'http://bio2rdf.org/cardiotox:' + value.urlify()

tfmorris commented 10 years ago

Not really relevant to the problem at hand, but does urlify() do something different than the standard escape('url')? If so, what are the differences?

fadmaa commented 10 years ago

urlify does not actually encode values. It makes string more "friendly" as part of URIs by (1) changing to lower case (2) replacing spaces with dashes (-) (3) removing characters that are not digits, letters, dash or underscore

One still needs to use escape if a value needs to be encoded

htanya commented 10 years ago

Thank you for your suggestion, 'http://bio2rdf.org/cardiotox:' + value.urlify(), it works!