3

I'm trying to convert an n3 file to rdf/xml through rdf:about converter. Unfortunately some URIs have special characters like: . -> gene:01.01.01 % -> gene:fog2/zfpm2 | -> gene:17867|203045

and the convertor note this examples as a notation 3 grammar error. I searched everywhere for escaping characters which would help me make the convention but with no success. Does anyone know how i could represent these special characters in the URIs? is there any other convertor that would allow me proceed this convention?

if i remove these URIs, my file is converted normally. thanks in advance.

1 Answers1

1

The most reliable thing will be to write out the URIs in full. So if you have:

@prefix gene: <http://example.com/>

gene:fog2/zfpm rdfs:label "something".

rewrite this instead to:

@prefix gene: <http://example.com/>

<http://example.com/fog2/zfpm> rdfs:label "something".

Note, some characters are not even allowed in this notation (for example, spaces). In that case, they need to be handled with percent encoding:

<http://example.com/fog2/zfpm%20xyz> rdfs:label "something".

Here the space has been percent-encoded as %20.

The latest Turtle spec (Turtle is W3C's standardized version of the non-standard N3) also allows escaping of some of these special characters as backslashes:

gene:fog2\/zfpm rdfs:label "something".

But this isn't widely implemented yet, and older tools/services won't support it. The rdfabout.com converter certainly won't support it.

triplr.org is better than rdfabout.com, by the way.

cygri
  • 9,412
  • 1
  • 25
  • 47
  • Thanks cygri for your reply. So if I get it right, the only way to get through this is to use the full URI instead of the sorter ones. – user1620063 Aug 24 '12 at 13:25
  • I found this latest turtle spec but i didn't find any converter that can accept such a syntax. – user1620063 Aug 24 '12 at 13:28
  • The latest Apache Jena probably handles the newest Turtle correctly, if you use the RIOT parsers. If you're looking for a simple online converter, you're probably out of luck. The backslash escaping was added very recently. – cygri Aug 24 '12 at 19:17