Column 'LOCATIONNAME not found in any table

I am trying to use virtual add from Oracle without success. Here is my R2ML definition

    loc:{"locationname"} a loc:CompanyBuilding ;
        loc:name "{\"locationname\"}";
        loc:alias "{\"alias1\"}";
        sm:map [
           sm:query """
            SELECT locationname, alias1
            FROM LOCATION
            """ ;
        ] .

When I try to load the data, I get the following error

    $ stardog-admin virtual add db.properties location.ttl  --verbose
    Unable to parse R2RML view query [[
            SELECT locationname, alias1
            FROM LOCATION
            ]]: From line 2, column 16 to line 2, column 27: Column 'LOCATIONNAME' not found in any table
The detailed stack trace for the error is:
    com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: Unable to parse R2RML view query [[
            SELECT locationname, alias1
            FROM LOCATION
            ]]: From line 2, column 16 to line 2, column 27: Column 'LOCATIONNAME' not found in any table
    	at com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:538)
    	at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:364)
    	at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:664)
    	at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:648)
    	at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminConnectionImpl.addOrUpdate(HttpVirtualGraphAdminConnectionImpl.java:182)
    	at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminConnectionImpl.addGraph(HttpVirtualGraphAdminConnectionImpl.java:155)
    	at com.complexible.stardog.virtual.cli.VirtualGraphAdd.performSecure(VirtualGraphAdd.java:109)
    	at com.complexible.stardog.cli.admin.SecureStardogAdminCommand.call(SecureStardogAdminCommand.java:61)
    	at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:55)
    	at com.complexible.stardog.cli.admin.CLI.main(CLI.java:187)

The first thing that I found strange was ***"not found in any table"***, however I tried putting a table that does not exists, and it did fail with an appropriate message, which seem to indicate that it was able to find the correct table.

I validated that my SQL query is correct as running the query 'SELECT locationname, alias1 FROM LOCATION' in DBVisualizer did return the data.

Any assistance will be appreciated as I am working on a POC to display the advantage of Stardog.

Hi Serge,

Perhaps the column was created in Oracle with quotes, in which case you would need them here as well:

sm:map [
       sm:query """
        SELECT "locationname", "alias1"
        FROM LOCATION
        """ ;
    ] .

Hi Stephen

I had already tried with quotes and it did not resolve anything. In fact, if I run it in DBVisualizer with quotes, I get the following error message

[Code: 904, SQL State: 42000] ORA-00904: "alias1": invalid identifier

Does the following query return any results in DbVisualizer?

select LOCATIONNAME from LOCATION

Oracle handles unquoted identifiers (table, column names) by transforming them to uppercase. If the identifier is lowercase, it needs to be quoted.

Actually, I tried to creating the same table on another DB and I was able to get it work. Something weird is happening on the initial DB I was using. The first hint was that TABLE did not show up under TABLE in DBVIsualizer but rather VIEW.

Thanks for you help, and I apologize for opening a support ticket that clearly was not with Stardog.

No problem. Glad you figured it out. Let us know if you have any other questions.

Jess

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