Re: The RDF 1.1 Literal Quiz

Here, I answer the quiz using the *current* specification (RDF 2004 and 
SPARQL 2008), just to make it clear what modifications are suggested by 
other people's answers. I assume that <a>, <b>, <c> are placeholders for 
valid URIs.


Le 18/05/2011 20:22, Richard Cyganiak a écrit :
> 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 .
>   <a>  <b>  "1"^^xsd:integer .

one triple.

> Q2. Does this RDF graph (written in Turtle) have one triple?
>
>   <a>  <c>  "foo" .
>   <a>  <c>  "foo"^^xsd:string .

two triples.

> Q3. Is this be a valid Turtle file?
>
>   <a>  <b>  "foo"^^rdf:PlainLiteral .

yes.

> Q4. Is a parser allowed to unify "foo" and "foo"^^xsd:string into a single form while parsing?

no.

> 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, N-Triples does not allow short prefix in URIs.

> 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 .

No, prefix not allowed.

> Q9. Is this true in SPARQL?
>
>   datatype("foo") == xsd:string

yes.

> Q10. Is this true in SPARQL?
>
>   datatype("foo") == error

no.

> Q11. Is this true in SPARQL?
>
>   datatype("foo") == rdf:PlainLiteral

no.

> Q12. Is this true in SPARQL?
>
>   datatype("foo"@en) == xsd:string

no.

> Q13. Is this true in SPARQL?
>
>   datatype("foo"@en) == error

I am not sure for this one?

> Q14. Is this true in SPARQL?
>
>   datatype("foo"@en) == rdf:PlainLiteral

no.

> Q15. Is this true in SPARQL?
>
>   datatype("foo"@en) == rdflang:en

no.

> 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>

yes.

> 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. (I'm not sure this is allowed in RDF/XML)

> 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 . }

no by default but yes under XSD-entailment.

> Q19. {<a>  <b>  "foo"^^xsd:string . } =>  {<a>  <b>  "foo" . }

no by default but yes under XSD-entailment.

> 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.

> Q23. {<a>  <b>  "foo"@en-GB . } =>  {<a>  <b>  "foo"@en . }

no.

> Q24. {<a>  <b>  "foo"@fr . } =>  {<a>  <b>  "foo"@en . }

no.


Bonus questions:

 > Q25. Is this a single triple?
 >
 >    <joe> <nbChildren> "2"^^xs:decimal .
 >    <joe> <nbChildren> "+2.000"^^xs:decimal .

no.

 > Q26. Is this a single triple?
 >
 >    <joe> <nbChildren> "2"^^xs:byte .
 >    <joe> <nbChildren> "2"^^xs:positiveInteger .

no.

 > Q27. Does the following query give <joe> as an answer, when asked
 > against the previous graphs?
 >
 >    SELECT ?person WHERE { ?person <nbChildren> 2 }

no.

-- 
Antoine Zimmermann
Researcher at:
Laboratoire d'InfoRmatique en Image et Systèmes d'information
Database Group
7 Avenue Jean Capelle
69621 Villeurbanne Cedex
France
Tel: +33(0)4 72 43 61 74 - Fax: +33(0)4 72 43 87 13
Lecturer at:
Institut National des Sciences Appliquées de Lyon
20 Avenue Albert Einstein
69621 Villeurbanne Cedex
France
antoine.zimmermann@insa-lyon.fr
http://zimmer.aprilfoolsreview.com/

Received on Friday, 20 May 2011 10:50:06 UTC