Skip to content

Literal.datatype doesn't get initialized for Turtle string #670

@nabito

Description

@nabito

Say we've this RDF statement in Turtle:

ex:obs3 ex:hasStatus "online" .

At rdflib 4.2.1 rdflib.term.Literal does not init 'datatype' attr for string type if not explicitly written as "value"^^xsd:string. As per W3C specification of Turtle, writing just "value" implicitly means it's xsd:string.

This assignment is needed for the program logic to be consistent when expecting to check for literal type using such attribute.

The attribute get updated for other types like decimal, integer without explicitly written in Turtle.

Metadata

Metadata

Assignees

Labels

breaking changeThis involves or proposes breaking RDFLib's public API.bugSomething isn't workingconcept: RDF Literalconcept: datatypeRelates to the RDF literal datatype concept.coreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`duplicateThis issue or pull request already existsenhancementNew feature or requestparsingRelated to a parsing.serializationRelated to serialization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions