-
Notifications
You must be signed in to change notification settings - Fork 577
Open
Labels
accepting PRPRs for this issue will be considered.PRs for this issue will be considered.breaking changeThis involves or proposes breaking RDFLib's public API.This involves or proposes breaking RDFLib's public API.bugSomething isn't workingSomething isn't workingconcept: RDF Literalconcept: datatypeRelates to the RDF literal datatype concept.Relates to the RDF literal datatype concept.coreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`feedback wantedFeedback from RDFLib users and contributors is wanted.Feedback from RDFLib users and contributors is wanted.needs discussionThis issue needs further discussion to find an optimal way to resolve it.This issue needs further discussion to find an optimal way to resolve it.parsingRelated to a parsing.Related to a parsing.
Description
Example:
>>> from rdflib import Literal
>>> from rdflib.namespace import XSD
>>> Literal('foo') == Literal('foo', datatype=XSD.string)
False
According to https://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal, every literal has a datatype (and a simple literal without a datatype should be considered syntactic sugar for literals of datatype http://www.w3.org/2001/XMLSchema#string
).
The implementation in rdflib seems to follow the original RDF (not RDF 1.1), which allowed missing datatypes.
Related issues:
- Literal should always have a datatype #1326 proposes to always set a datatype (which would work, but might break things).
PS:
A similar problem would presumably occur with RDF.langString
, except that setting both lang
and datatype
results in an error (which might also be an issue).
Metadata
Metadata
Assignees
Labels
accepting PRPRs for this issue will be considered.PRs for this issue will be considered.breaking changeThis involves or proposes breaking RDFLib's public API.This involves or proposes breaking RDFLib's public API.bugSomething isn't workingSomething isn't workingconcept: RDF Literalconcept: datatypeRelates to the RDF literal datatype concept.Relates to the RDF literal datatype concept.coreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`feedback wantedFeedback from RDFLib users and contributors is wanted.Feedback from RDFLib users and contributors is wanted.needs discussionThis issue needs further discussion to find an optimal way to resolve it.This issue needs further discussion to find an optimal way to resolve it.parsingRelated to a parsing.Related to a parsing.