Correct SMS2 syntax for URI from database?

Given a database table like

id   name     uri
1    bob      http://myontology/job/baker
2    steve    http://myontology/job/pilot
3    bill     http://myontology/job/cab_driver

where the uri indicates the class of individual,what is the correct SMS2 syntax to assert that individual is of class uri?
Using the value directly

TO {
?subject rdfs:label ?name
?subject a ?uri

wraps the uri in quotes (string literal?) producing

http://myontology/person/person1 a "http://myontology/job/baker"

Adding a template

TO {
?subject rdfs:label ?name
?subject a ?cls
BIND(template("{uri}") AS ?cls)

concatenates the default prefix to the uri:

http://myontology/person/person1 a :http://myontology/job/baker

Any ideas?

I just found a report of similar issue using CSV and the original SMS:

Hi Dave,

There's currently no way to do this in SMS2. The example ( in the comment on the post you linked to has an example of how to do this R2RML using rr:termType rr:IRI. I'll add your feedback to our internal issue tracking this enhancement.

Simon (Stardog PM)

Thanks. Is the current restriction, that to form a IRI, the template must start with "http://" e.g.


or is some other restriction?

We have some freedom over the database design, for instance would

template("{prefix}:{body}) or

work? Any other database and template pattern which can be used to form a fully scope IRI?


Yes, there's no reason why template("http://{?iri_body}") shouldn't work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.