gjhiggins/rdflib — Issue #116: RDFa parser fails on typed literals when xml:lang is specified
Author: gjhiggins
Created: 2011-10-19 01:25:38+00:00
State: open

Originally filed by vfaronov on 2010-02-09T21:18:39

What steps will reproduce the problem?
1. Prepare an XHTML+RDFa document in which there are both an element
producing a typed literal, and an xml:lang specification (e.g. on the root
html element). An example document is attached.
2. Feed this file to the RDFLib parser.

What is the expected output? What do you see instead?
The expected output is one triple in which the object is a typed literal,
as per "RDFa in XHTML: Syntax and Processing" section 6.3.1.2. Instead,
RDFLib reports "TypeError: A Literal can only have one of lang or datatype,
per http://www.w3.org/TR/rdf-concepts/#section-Graph-Literal"

What version of the product are you using? On what operating system?
I am using RDFLib trunk (r1843) on Debian GNU/Linux 5.0.

Please provide any additional information below.
The issue exists because the parser passes the current lang value to the
Literal() constructor even though the datatype is specified. The
constructor then complains.