- From: Pat Hayes <phayes@ihmc.us>
- Date: Wed, 18 May 2011 14:18:07 -0500
- To: Richard Cyganiak <richard@cyganiak.de>
- Cc: RDF Working Group WG <public-rdf-wg@w3.org>
On May 18, 2011, at 1:22 PM, Richard Cyganiak wrote: > The RDF 1.1 Literal Quiz > ------------------------ > > Let's pretend we live in the future and RDF 1.1 has just been published, including this working group's attempt to clean up string literals. > > Now here's a quiz with some RDF trivia questions. > > What are the answers that you'd like to see? Please keep them short -- along the lines of “Yes”, “No”, “Don't care”, “Don't prefer but ok”, “Oh yes please please please”, “WTF!?!?”, “Formal objection!” > > (I tried to phrase the questions in terms of user-visible behaviour and not spec-internal mechanisms. I hope we can get some non-controversial test cases out of this, and pinpoint where we disagree on desired behaviour. If you provide responses, then feel free to add additional questions.) > > > > Q1. Does this RDF graph (written in Turtle) have one triple? > > <a> <b> 1 . Not legal RDF syntax, so answer is moot. > <a> <b> "1"^^xsd:integer . > > Q2. Does this RDF graph (written in Turtle) have one triple? > > <a> <c> "foo" . > <a> <c> "foo"^^xsd:string . Don't really care. They are equivalent: whether that is recorded as a syntactic identity or a semantic one seems relatively unimportant. Applications can happily substitute one for the other. > > Q3. Is this be a valid Turtle file? > > <a> <b> "foo"^^rdf:PlainLiteral . No. "foo@"^^rdf:PlainLIteral is barely legal but strongly deprecated in favor of the plain literal syntax. > > Q4. Is a parser allowed to unify "foo" and "foo"^^xsd:string into a single form while parsing? Yes, I guess. I am happy for parsers to do anything that is valid. > > Q5. Is this a valid N-Triples file? > > <a> <b> "foo" . Yes > > Q6. Is this a valid N-Triples file? > > <a> <b> "foo"^^rdf:PlainLiteral . No, but "foo@" would make it valid (just, see Q3 above) > > Q7. Is this a valid N-Triples file? > > <a> <b> "foo"@en . Yes > > Q8. Is this a valid N-Triples file? > > <a> <b> "foo"^^xsd:string . Yes > > Q9. Is this true in SPARQL? > > datatype("foo") == xsd:string Yes. But if it is true "in SPARQL" then it should be true everywhere, and therefore true in the normative RDF syntax model, to ensure this. > > Q10. Is this true in SPARQL? > > datatype("foo") == error No > > Q11. Is this true in SPARQL? > > datatype("foo") == rdf:PlainLiteral Either way, but SPARQL has spoken on this, so no. > > Q12. Is this true in SPARQL? > > datatype("foo"@en) == xsd:string NO. Formal objection. It would follow that _:x owl:sameAs "foo"@en . _:x owl:sameAs "foo"@fr . was consistent. > > Q13. Is this true in SPARQL? > > datatype("foo"@en) == error No. > > Q14. Is this true in SPARQL? > > datatype("foo"@en) == rdf:PlainLiteral That would do, though it could be some other datatype, I don't really care as long as there is one. > > Q15. Is this true in SPARQL? > > datatype("foo"@en) == rdflang:en Weak no. I don't want a different datatype for each possible language tag > > Q16. Does the literal in this RDF/XML fragment have a language tag? > > <rdf:Description rdf:about="a" xml:lang="en"> > <rdf:b>foo</rdf:b> > </rdf:Description> No. > > Q17. Does the literal in this RDF/XML fragment have a language tag? > > <rdf:Description rdf:about="a" xml:lang="en"> > <rdf:b rdf:datatype="&xsd;string">foo</rdf:b> > </rdf:Description> No. > > For each of the following pairs of statements, if the statement on the left is true, then is the statement on the right true as well in a system that supports datatype inference (specifically, {xsd:string}-Entailment)? > > Q18. { <a> <b> "foo" . } => { <a> <b> "foo"^^xsd:string . } Yes > > Q19. { <a> <b> "foo"^^xsd:string . } => { <a> <b> "foo" . } Yes > > Q20. { <a> <b> "foo" . } => { <a> <b> "foo"@en . } No > > Q21. { <a> <b> "foo"@en . } => { <a> <b> "foo" . } No > > Q22. { <a> <b> "foo"@en . } => { <a> <b> "foo"@en-GB . } No. (Getting this right is just too complicated. And for some combinations, it is simply false either way round, eg the Chinese notations.) > > Q23. { <a> <b> "foo"@en-GB . } => { <a> <b> "foo"@en . } No. > > Q24. { <a> <b> "foo"@fr . } => { <a> <b> "foo"@en . } NO !! > > > ------------------------------------------------------------ IHMC (850)434 8903 or (650)494 3973 40 South Alcaniz St. (850)202 4416 office Pensacola (850)202 4440 fax FL 32502 (850)291 0667 mobile phayesAT-SIGNihmc.us http://www.ihmc.us/users/phayes
Received on Wednesday, 18 May 2011 19:18:37 UTC