R2rml help needed


I’m trying to see how the R2RM support works. I have created a very simple mappings (map.ttl) as follows:

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix ex: <http://example.com/ns#>.

    rr:logicalTable [ rr:tableName "prod.pm_offering" ];
    rr:subjectMap [
        rr:template "http://borna.example.com/offering/{offering_id}";
        rr:class ex:Offering;

I run this command:
stardog-admin virtual add jdbc.properties map.ttl

I always get the following error: “The mapping collection is empty”. It only complains about malformed ttl mapping files. It never checks my jdbc connection.

Any help is appreciated,



Hi Borna,

The virtual add command expects mappings in Stardog Mapping Syntax (SMS) by default. Quoting the documentation:

The add command by default assumes the mappings are using the Stardog Mapping Syntax. Mappings in standard R2RML syntax can be used by adding the --format r2rml option in the above command

Hope this helps.

Thanks for the quick response. Now that I add "–format r2rml " to the end of the command, I get “Not Found!”. Any help with that?


Look at this example from the man page:

Register a new virtual graph with the mappings written in standard R2RML Turtle syntax
$ stardog-admin virtual add --format r2rml myGraph.properties myGraph.ttl

Thanks. Here is the verbose version of the error. I have disabled security. Do you think it has something to do with that? If not, is there a way to know which resource does not exist?

com.complexible.stardog.security.ResourceNotFoundException: Not Found!
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:488)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:324)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:662)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:637)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addOrUpdate(HttpVirtualGraphAdminClientImpl.java:233)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addGraph(HttpVirtualGraphAdminClientImpl.java:202)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addGraph(HttpVirtualGraphAdminClientImpl.java:51)
        at com.complexible.stardog.protocols.http.client.AbstractVirtualGraphAdminConnection.addGraph(AbstractVirtualGraphAdminConnection.java:86)
        at com.complexible.stardog.virtual.cli.VirtualGraphAdd.performSecure(VirtualGraphAdd.java:107)
        at com.complexible.stardog.cli.admin.SecureStardogAdminCommand.call(SecureStardogAdminCommand.java:60)
        at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:55)
        at com.complexible.stardog.cli.admin.CLI.main(CLI.java:182)

The inability to create a new virtual graph when security is disabled is a known issue. It will be fixed in a future version of Stardog. In the meantime, I would recommend enabling security at least in order to create the virtual graph.


Thanks. Still the same issue after activating security. I wonder what resource is not found. Cheers.

Which version of Stardog are you using?

I am using 5.0-RC1 version

How did you enable security?

i don’t use “–disable-security” :slight_smile: Now I think that is incorrect :slight_smile:

Did you restart the Stardog server? What do you see if you run:

stardog-admin server status | grep Security

Security Disabled: false

Ok. Let me check further and I will get back to you.

Can you share the last error shown in stardog.log?

This is what I get by “tail stardog.log”. The error at the bottom is relevant to an incorrect CLI query (I think):

INFO  2017-06-12 14:39:58,442 [main] com.complexible.stardog.cli.impl.ServerStart:call(228): Memory options
INFO  2017-06-12 14:39:58,444 [main] com.complexible.stardog.cli.impl.ServerStart:call(229): Min Heap Size: 2.0G
INFO  2017-06-12 14:39:58,444 [main] com.complexible.stardog.cli.impl.ServerStart:call(230): Max Heap Size: 27G
INFO  2017-06-12 14:39:58,444 [main] com.complexible.stardog.cli.impl.ServerStart:call(231): Max Direct Mem: 27G
INFO  2017-06-12 14:39:58,445 [main] com.complexible.stardog.cli.impl.ServerStart:call(232): Max Mapped Mem: 3.6G
INFO  2017-06-12 14:39:58,445 [main] com.complexible.stardog.cli.impl.ServerStart:call(233): System Memory: 252G
ERROR 2017-06-12 14:44:38,005 [XNIO-1 task-27] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(225): An exception was handled by the server: Lexical error at line 1, column 28.  Encountered: <EOF> after : "p}"

What is the exact command you are sending when you receive the verbose text of the error?

stardog-admin virtual add --format r2rml jdbc.properties map.tll -v

What type of license are you using?

I am using the Community license