Where do I put the db name when using SMS2 to define a SQL mapping file.
I have:
PREFIX rdf: <..>
PREFIX xsd: <...>
PREFIX myprefix: <...>
MAPPING
FROM SQL
{ select id, description from tableName where id >= 1757910 and id <= 1757920 }
TO
{ ?resId a myprefix:Resource ; myprefix:description ?description . }
WHERE
{ BIND (template("urn:Resource-{id}") AS ?resId) }
As my mapping file.
When I add this via Stardog Studio, I get the error 'Object 'tableName' not found (Internal Server Error)'
The db name is specified in the JDBC URL in the properties. If the table is in a different schema, you can include it in the sql.schemas or sql.default.schema property.
Is your SMS2 file using a .ttl suffix? We auto detect the format in Studio/Java/CLI but not yet in the Python client library so it must be specified manually.
It's documented in the list of virtual graph properties. If the table is not in the default schema (usually the username), you would need to set this property to add to the schema search path.
Removing a reference to the table you want to query is not the right solution here. You need to figure out why the table is not being found. That's why I pointed to the properties which allow configuring the schema search path.
The hierarchy of containment in a database is the database/catalog at the top level which contains a set of schemas. Each schema contains a set of tables. There is a default schema, sometimes called public or the name of the user, eg dbo. If the table you are trying to query is not in the default schema, you will need to add the name of the schema containing it to the schema search path using the sql.schemas virtual graph option.