Closed hoijui closed 7 months ago
PS: I tried leaving out the addition of the ":" when creating Prefix::new
, but then I get an "invalid prefix" error, right there.
This is embarrassing. It is actually a stupid bug in Sophia, which I have fixed some time ago (553a1fa3) but hadn't yet pushed nor released that fix.
The intended behavior of Prefix::new
is to take the prefix without the trailing colon. The stupid bug is that it rejects valid prefixes, and accepts invalid prefixes. This give you the wrong impression that the colon was required, and produced the buggy result.
I plan to release Sophia 0.7.1 with this bug fix and another few minor improvements, but I don't have much time for that in the next week or two, unfortunately... In the meantime, you can now use the github version. Sorry for the inconvenience.
ahh perfect, that works for me, thanks! :-)
what about the PREFIX format? I imagine that is an other bug (if any at all), right?
It is not a bug. This syntax (PREFIX
instead of @prefix
) has been included in Turtle when it was standardized by W3C in 2014. See https://www.w3.org/TR/turtle/#h_note_1
I favored this syntax to ease the copy-paste to SPARQL queries, but this could be made configurable (by adding a field to TurtleConfig
).
Please also support RDF 1.1 Turtle according to spec: https://www.w3.org/TR/turtle/
Especially also the ability to specify the @base
IRI.
@mbarbieri77 as far as I can tell, @base
is supported...
This bug was fixed a while ago
(related to #17)
I see that there is now code to serialize to turtle, but I get strange results. Taking the sample code provided in the docu - modified to export turtle instead of n-triples, pretty with prefixes - I am expecting this:
(code: https://gist.github.com/hoijui/72aa8e5bf8dd7381425dfb6676e7fe62)
but I get this: (NOTE:
PREFIX
instead of@prefix
, and duplicated:
(this RDF looks quite rusty... ;-) ))