Closed jonnyschaefer closed 1 day ago
That's a very good idea! I am going to implement it so that two optional tags label
and datatype
in the struct are filled. Other libraries probably implement it by filling another field in their own struct representing either a triple or an literal. Indeed, there can be only either label or data type specified for the literal at a time:
If there is no language tag, there may be a datatype IRI, preceeded by '^^' (U+005E U+005E).
While looking at the example from #18 I was wondering on how to differentiate all those lables. Thus it might be a good idea to support the language tags of literals sometime in the future.
Example from https://www.w3.org/TR/turtle/#turtle-literals
Maybe it makes sense to introduce an optional tag for a field of the triple struct, which then is filled with the language tag? Maybe capture the datatype aswell?
If I understand https://www.w3.org/TR/turtle/#grammar-production-RDFLiteral correctly, datatype and language tag can not exist simultaneously.
I have not checked how other libraries handle this.