RDFLib/rdflib — Issue #111: RDFa parser fails on typed literals when xml:lang is specified
Author: gjhiggins
Created: 2012-02-20 08:33:01+00:00
State: closed

vfaronov, 2010-02-09T21:18:39.000Z

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.

Comment 1 by eik...@gmail.com

Comment 2 by vfaronov
The attached patch fixes the issue for me without causing TC #108 to fail.

Comment 3 by eik...@gmail.com
Fixed in r1842. Thank you for reporting the issue and supplying the patch.

Comment 4 by eik...@gmail.com
The next release is going to be the 3.0 release.

Comment 5 by vfaronov
eikeon, this issue has already been fixed in r1845. It just wasn't marked as fixed
for some reason.

Comment 6 by eik...@gmail.com
vfaronov, thank you. Marking as fixed now.