Re: rr:constant with literal or datatype

Tomasz,

> On 7 Nov 2014, at 17:57, tomasz.pluskiewicz@gmail.com wrote:
> 
> Hi
> 
> I haven't found such example and I'm not sure what should happen if the R2RML mapping contained a constant with language tag or datatype. For example
> 
> [ rr:constant "someObject"^^<http://example.org/some#datatype> ]

There’s indeed no test case for this. So you’ll have to check the text of the spec.

> Should the datatype be ignored or used as if it was specified using rr:datatype?

As per R2RML §11.2:

[[
The generated RDF term of a term map for a given logical table row is determined as follows:
• If the term map is a constant-valued term map, then the generated RDF term is the term map's constant value.
]]
http://www.w3.org/TR/r2rml/#generated-rdf-term

And:

[[
The constant value of a constant-valued term map is the RDF term that is the value of its rr:constant property.
]]
http://www.w3.org/TR/r2rml/#dfn-constant-value

So, yes, the value of rr:constant is used exactly as is, including datatype if present.

> And more interestingly what should happen for the mapping below? Answering the first question will suggest the answer.
> 
> [ 
>  rr:constant "someObject"^^<http://example.org/some#datatype> ;
>  rr:datatype <http://example.org/some#datatype> 
> ]

[[
A term map that is not a datatypeable term map MUST NOT have an rr:datatype property.
]]
http://www.w3.org/TR/r2rml/#dfn-specified-datatype

Following the definitions, you will find that constant-valued term maps (those with rr:constant) do not have a term type, and therefore can’t have a term type of rr:Literal, and therefore are not datatypeable.

Best,
Richard



> 
> It looks like such cases aren't included in the test suite [1].
> 
> Kind regards,
> Tom
> 
> [1] http://www.w3.org/2001/sw/rdb2rdf/test-cases
> 

Received on Thursday, 13 November 2014 18:10:24 UTC