Dear all,
I'm trying to use the R2RML rr:datatype property in order to explicit specify the type of a literal object (ref. https://www.w3.org/2001/sw/rdb2rdf/r2rml/#typed-literals).
My R2RML configuration in ntriples format is:
| <http://mapping.org/MICROSCOPIA> | <http://www.w3.org/ns/r2rml#logicalTable> | _:genid1 |
| _:genid1 | <http://www.w3.org/ns/r2rml#tableName> | "MICROSCOPIA" |
| <http://mapping.org/MICROSCOPIA> | <http://www.w3.org/ns/r2rml#subjectMap> | _:genid2 |
| _:genid2 | <http://www.w3.org/ns/r2rml#class> | <http://petrobras.com.br/MICROSCOPIA> |
| _:genid2 | <http://www.w3.org/ns/r2rml#template> | <http://petrobras.com.br/MICROSCOPIA/{ANMR_SQ_ANALISE_MICROSCOPIA}_{ID_TIPO_ROCHA}> |
| <http://mapping.org/MICROSCOPIA> | <http://www.w3.org/ns/r2rml#predicateObjectMap> | _:genid3 |
| _:genid3 | <http://www.w3.org/ns/r2rml#predicate> | <http://mapping.org/order> |
| _:genid3 | <http://www.w3.org/ns/r2rml#objectMap> | _:genid4 |
| _:genid4 | <http://www.w3.org/ns/r2rml#termType> | <http://www.w3.org/ns/r2rml#Literal> |
| _:genid4 | <http://www.w3.org/ns/r2rml#datatype> | <http://www.w3.org/2001/XMLSchema#decimal> |
| _:genid4 | <http://www.w3.org/ns/r2rml#constant> | "1" |
Note that in the last three lines I'm setting up the objectMap of the property "<http://mapping.org/order>" to a constant "1" and saying it is a xsd:decimal and a rr:Literal.
After the materialization, when I execute the following query:
SELECT distinct SORDER$RDFVTYP, SORDER$RDFLTYP
FROM TABLE(SEM_MATCH(
'SELECT ?sOrder WHERE { ?s <http://mapping.org/order> ?sOrder } ',
SEM_Models('prolab_mat'),NULL,NULL,NULL));
I get the following result:

If I execute a BIND converting the value explicitly to xsd:decimal, it works:
SELECT distinct SORDER2$RDFVTYP, SORDER2$RDFLTYP
FROM TABLE(SEM_MATCH(
'SELECT ?sOrder WHERE { ?s <http://mapping.org/order> ?sOrder . BIND ( <http://www.w3.org/2001/XMLSchema#decimal>(str(?sOrder)) AS ?sOrder2) } ',
SEM_Models('prolab_mat'),NULL, NULL,NULL));
Result:

I there another way to do the type specification directly through R2RML mapping? I would not like to use the BIND function all the time.
Thanks in advance,
Elisa.