Stardog API Query remover

Hi all,

the current Remover interface in the Stardog API (6.1.0) remover api offers the possibility to use a query.

More precise:

c.remove().query(constructQuery)

However I'm not able to find this method in the method summary.
Is this querying options still available or should I use one of the other methods?

Thanks for the help

Hi,

This method is not supported in the Remover API. You could, however, use this workaround:

try (Connection c = ConnectionConfiguration.to("...");
             GraphQueryResult g = c.graph("construct {...} where {...}").execute()) {
            c.begin();
            c.remove().graph(g.toGraph());
            c.commit();
        }

It is also possible to use a DELETE query and avoid the extra round-trip between the client and the server:

try (Connection c = ConnectionConfiguration.to("...")) {
   c.update("delete {...} where {...}").execute();
}

Best,
Evren

1 Like

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