Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

R2RML Typed Literals (rr:datatype)

3274437Jul 12 2016 — edited Jul 14 2016

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:

Capturar.PNG

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:

Capturar2.PNG

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.

This post has been answered by Sdas-Oracle on Jul 12 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2016
Added on Jul 12 2016
6 comments
1,677 views