java.lang.OutOfMemoryError: Java heap space

This means the query execution time exceeded the default timeout value and the server killed it.

This might indicate either a hard query (given the amount of data) or a sub-optimal query plan. If you send us the output of the query explain command for that query, we might be able to tell. If it’s sensitive, feel free to send privately.

You may also disable the timeout (or set it to a higher value) using the query.timeout property in stardog.properties. query.timeout=0m will disable it.

Cheers,
Pavel