user1620063
user1620063

Reputation: 31

notation 3 URI to RDF/XML

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.

Upvotes: 3

Views: 508

Answers (1)

cygri
cygri

Reputation: 9472

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.

Upvotes: 1

Related Questions