zazuko/xrm

Combining template with language-tag or datatype

Opened this issue · 0 comments

Current version (1.5.0) does not support combining template with language-tag or datatype.

Sample for using template __ with __ as Literal with language-tag __ ;

// foo = hallo, bar = welt
template "{0} {1}!" with foo bar as Literal with language-tag de ;  // => "hallo welt!"@de

(r2ml)=>
rr:predicateObjectMap [
  rr:predicate schema:givenName;
  rr:objectMap [
    rr:template "{foo} {bar}!";
    rr:termType rr:Literal;
    rr:language "de"
  ]
].

Sample for using template __ with __ as Literal with datatype __ ;

// foo = Q1424987
template "https://www.wikidata.org/wiki/{0}" with foo as Literal with datatype xsd.anyURI ;  // => "https://www.wikidata.org/wiki/Q1424987"^^xsd:anyURI

(r2ml)=>
rr:predicateObjectMap [
  rr:predicate schema:givenName;
  rr:objectMap [
    rr:template "https://www.wikidata.org/wiki/{foo}";
    rr:termType rr:Literal;
    rr:datatype xsd:anyURI
  ]
].