# Auto-generated Mappings

**URL:** <https://community.stardog.com/t/auto-generated-mappings/1480>\
**Category:** Support\
**Created:** [February 13, 2019, 7:40pm UTC](https://community.stardog.com/t/auto-generated-mappings/1480 "2019-02-13T19:40:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)\
**Post date:** [February 13, 2019, 7:40pm UTC](https://community.stardog.com/t/auto-generated-mappings/1480/1 "2019-02-13T19:40:40Z")

</div>

In the docs it states that `If there are no mappings provided to the add commands then the [R2RML direct mapping](http://www.w3.org/TR/rdb-direct-mapping/) is used.`.

However when I try this for a postgres mapping I see the following error:

```
stardog-admin virtual add mygraph.properties
Template must reference one or more variables: nested

```

Any idea what the issue is?

---

<div class="post-metadata">

**Author:** ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)\
**Post date:** [February 14, 2019, 12:12am UTC](https://community.stardog.com/t/auto-generated-mappings/1480/2 "2019-02-14T00:12:07Z")

</div>

Hi Nolan,

I'm partly guessing here but it sounds like the columns in the table are not retrieved properly and as a result the URI template does not refer to any columns. Is "nested" the name of a table in your database? Can you share the database schema with us privately?

Best,

Evren

---

<div class="post-metadata">

**Author:** ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)\
**Post date:** [February 14, 2019, 4:23am UTC](https://community.stardog.com/t/auto-generated-mappings/1480/3 "2019-02-14T04:23:23Z")

</div>

Hey Evren,

I may have it wrong here, but I thought that by excluding the SMS(2) file that the [R2RML Direct Mappings](https://www.w3.org/TR/rdb-direct-mapping/) would be applied to all tables in the database referenced in the `*.properies` file. Is that incorrect?

Also, the database has around 30+ tables and are all named with random UUIDs, so no tables named "nested." I can ping you privately with the an example schema.

Cheers,

Nolan

---

<div class="post-metadata">

**Author:** ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)\
**Post date:** [February 14, 2019, 3:09pm UTC](https://community.stardog.com/t/auto-generated-mappings/1480/4 "2019-02-14T15:09:57Z")

</div>

You are right that direct mappings are applied to all the tables. One of those tables seem to be causing the problem here and I was trying to decipher the error message. If you can share the schema privately we should be able to figure this out and improve the error messages as well.

Best,  
Evren

---

<div class="post-metadata">

**Author:** ![nicholsn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/nicholsn/32/284_2.png) [@nicholsn](https://community.stardog.com/u/nicholsn)\
**Post date:** [February 15, 2019, 10:52pm UTC](https://community.stardog.com/t/auto-generated-mappings/1480/5 "2019-02-15T22:52:56Z")

</div>

Just to close this out, the "nested" error was from an additional type in the postgres schema:

```
create type nested as
  (
  json json,
  extra text
  );

```

Adding `default.mapping.exclude.tables=nested` to my .properties file fixed this.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [March 1, 2019, 10:57pm UTC](https://community.stardog.com/t/auto-generated-mappings/1480/6 "2019-03-01T22:57:23Z")

</div>

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