0

I'm trying to map tabular data into RDF using RML mapping.

I've figured out how to define and use prefixes for rr:constant definitions as indicated with the <<--- arrows in the code below. I've also figured out how to map column values using rr:template, as indicated with the <<<<<< arrow in the same code.

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
[...]
:map_001 rr:predicateObjectMap [
             rr:predicate rdf:type; # <<---
             rr:objectMap [
                 rr:constant ex:MyClass; # <<---
                 rr:termType rr:IRI 
                 ]
             ];
         rr:predicateObjectMap [
             rr:predicate ex:myPredicate; # <<---
             rr:objectMap [
                 rr:template "http://example.org/{some_column}" # <<<<<<
                 ]
             ].

My question is: is it possible to somehow use prefixes in rr:template definitions, in order to not have to explicitly write the complete base URI? For example, I'd like to do something like what is shown below, although this clearly doesn't work:

:map_001 rr:predicateObjectMap [
             rr:predicate ex:myPredicate;
             rr:objectMap [
                 rr:template ex:"{some_column}" # <<--- DOESN'T WORK!
                 ]
             ].

Is there any syntax for this, or is it simply not possible?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
gaspanic
  • 249
  • 1
  • 12
  • 1
    that is unfortunately not possible, according to the R2RML specs: https://www.w3.org/TR/r2rml/#from-template - at least not via `rr:template` - not sure if there some other workaround, but I couldn't find anything in the specs. – UninformedUser Jun 29 '22 at 05:47
  • Ok thanks. Feel free to add this as an answer instead of a comment, and if noone else comes up with a solution I'll accept it. – gaspanic Jun 29 '22 at 12:27

0 Answers0