- From: Nathan <nathan@webr3.org>
- Date: Mon, 28 Feb 2011 10:16:40 +0000
- CC: Yves Raimond <Yves.Raimond@bbc.co.uk>, public-rdf-wg@w3.org
ps: good test case Nathan wrote: > Hi Yves, > > Integer in your example, given that the EBNF should match the statement > first thus removing the . > > statement ::= directive '.' | triples '.' | ws+ > > and in this example: > > @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. > @prefix : <http://localhost#>. > > :Person > :age 18.; > rdf:type :Person. > > it'd match decimal > > decimal ::= ('-' | '+')? ( [0-9]+ '.' [0-9]* | '.' ([0-9])+ | ([0-9])+ ) > > afaict, > > cheers nathan > > Yves Raimond wrote: >> Hello! >> >> I just noticed a potentially ambiguous point in the Tutle grammar at [1]. >> >> Considering the following document: >> >> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. >> @prefix : <http://localhost#>. >> >> :Person >> rdf:type :Person; >> :age 18. >> >> seems to be allowed by the grammar (resource resource integer.) But >> there's a potential ambiguity there (is the value of 'age' supposed to >> be parsed as a float or as an integer?) >> >> Some Turtle parsers seems to reject this document (e.g. SWI-Prolog), >> rapper makes a best guess (parsing 18 as an xsd:decimal), but throws a >> syntax error, and the SemWeb.NET library [2] parses it as an >> xsd:integer without any errors or warnings. >> >> Best, >> y >> >> [1] http://www.w3.org/TeamSubmission/turtle/#sec-grammar >> [2] http://www.rdfabout.com/demo/validator/ >> >> >> > > > >
Received on Monday, 28 February 2011 10:17:24 UTC