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?
thanks

EDIT:
I just found a report of similar issue using CSV and the original SMS:
https://community.stardog.com/t/creating-virtual-graph-when-csv-contains-legitimate-uris/1599/10

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)

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

template("http://example.org{whatever}")

or is some other restriction?

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

template("{prefix}:{body}) or
template("http://{iri_body})

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

thanks

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.