# Virtual graphs - error

**URL:** <https://community.stardog.com/t/virtual-graphs-error/1752>\
**Category:** Bug\
**Created:** [June 24, 2019, 3:19pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752 "2019-06-24T15:19:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 24, 2019, 3:19pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/1 "2019-06-24T15:19:44Z")

</div>

Hi, I just recently started with virtual graphs in Stardog. At first, I'm trying out the direct mapping method, before switching to SMS or R2RML, to get an idea of the data in a MySQL DB.

However, when I try the following SPARQL query without LIMIT:

```
SELECT * {
   GRAPH <virtual://beatles> {
      ?s ?p ?o .
   }
} #LIMIT 15

```

I receive an error in Stardog Studio: `QueryEval: Operation not supported`. When I set a LIMIT of 15 it works, but with a LIMIT of 20 or higher it fails again. Similar for CONSTRUCT queries to quickly grasp the virtualized RDF, I get the same error when I don't set any LIMIT (it works though if I set "any" LIMIT, e.g. LIMIT 10000)

Stardog 6.2.2 on Windows 10

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 24, 2019, 5:12pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/2 "2019-06-24T17:12:50Z")

</div>

There should be a more complete error message/trace. Can you check the server log file?

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 25, 2019, 1:13pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/3 "2019-06-25T13:13:31Z")

</div>

Hi Jess! I looked into the stardog.log file (I noticed that nothing is added here from actions done via Stardog Studio. Running with Stardog `--web-console` flag. Not sure if this is intended behaviour).

I found the following for my SELECT query without LIMIT:

```
ERROR 2019-06-25 15:09:06,420 [stardog-user-5] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(235): An unexpected exception was handled by the server
com.stardog.stark.query.QueryExecutionFailure: Operation not supported.
	at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:82) ~[stardog-utils-rdf-6.2.2.jar:?]
	at com.stardog.stark.query.ClosingSpliterator.forEachRemaining(ClosingSpliterator.java:37) ~[stardog-stark-query-api-6.2.2.jar:?]
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[?:1.8.0_121]
	at com.stardog.stark.query.io.QueryResultWriters.write(QueryResultWriters.java:142) ~[stardog-stark-query-io-6.2.2.jar:?]
	at com.stardog.stark.query.io.QueryResultWriters.write(QueryResultWriters.java:127) ~[stardog-stark-query-io-6.2.2.jar:?]
	at com.complexible.stardog.protocols.http.server.ProtocolUtils.writeTupleResponse(ProtocolUtils.java:571) ~[stardog-protocols-http-server-6.2.2.jar:?]
	at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:481) ~[stardog-protocols-http-server-6.2.2.jar:?]
	at com.complexible.stardog.protocols.http.annex.QueryPanelService.executeQuery(QueryPanelService.java:162) ~[stardog-webconsole-annex-6.2.2.jar:?]
	at com.complexible.stardog.protocols.http.annex.QueryPanelService.post(QueryPanelService.java:113) ~[stardog-webconsole-annex-6.2.2.jar:?]
	at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: com.complexible.stardog.plan.eval.operator.OperatorException: Operation not supported.
	at com.complexible.stardog.virtual.VirtualGraphIterator.computeNext(VirtualGraphIterator.java:153) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) ~[guava-26.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) ~[guava-26.0-jre.jar:?]
	at com.complexible.stardog.virtual.StatementToSolutionIterator.hasNext(StatementToSolutionIterator.java:47) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.ServiceOperatorImpl.computeNext(ServiceOperatorImpl.java:89) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.ServiceOperatorImpl.computeNext(ServiceOperatorImpl.java:34) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:82) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:29) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:116) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:39) ~[stardog-6.2.2.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) ~[guava-26.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) ~[guava-26.0-jre.jar:?]
	at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:78) ~[stardog-utils-rdf-6.2.2.jar:?]
	... 14 more
Caused by: com.mysql.cj.jdbc.exceptions.OperationNotSupportedException: Operation not supported.
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:116) ~[mysql-connector-java-8.0.13.jar:8.0.13]
	at com.mysql.cj.jdbc.result.ResultSetImpl.getRow(ResultSetImpl.java:1663) ~[mysql-connector-java-8.0.13.jar:8.0.13]
	at com.complexible.stardog.virtual.vega.mapping.TemplateTermMap$1.createValue(TemplateTermMap.java:231) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.virtual.ValueGenerator$AbstractValueGenerator.generateValue(ValueGenerator.java:100) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.virtual.VirtualGraphStatementIterator.computeValue(VirtualGraphStatementIterator.java:40) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.virtual.VirtualGraphStatementIterator.computeValue(VirtualGraphStatementIterator.java:26) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.virtual.VirtualGraphIterator.computeNext(VirtualGraphIterator.java:142) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) ~[guava-26.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) ~[guava-26.0-jre.jar:?]
	at com.complexible.stardog.virtual.StatementToSolutionIterator.hasNext(StatementToSolutionIterator.java:47) ~[stardog-virtual-core-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.ServiceOperatorImpl.computeNext(ServiceOperatorImpl.java:89) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.ServiceOperatorImpl.computeNext(ServiceOperatorImpl.java:34) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:82) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:29) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:116) ~[stardog-6.2.2.jar:?]
	at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:39) ~[stardog-6.2.2.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) ~[guava-26.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) ~[guava-26.0-jre.jar:?]
	at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:78) ~[stardog-utils-rdf-6.2.2.jar:?]
	... 14 more
```

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 25, 2019, 1:25pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/4 "2019-06-25T13:25:04Z")

</div>

It looks like there has been a change in behavior with the newer MySQL JDBC driver. One possible workaround is to use the [MySQL Connector/J version 5.1](https://dev.mysql.com/downloads/connector/j/5.1.html). I have created a new ticket and we will get this fixed shortly.

Jess

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 25, 2019, 1:28pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/5 "2019-06-25T13:28:22Z")

</div>

OK! I'm indeed using the newer MySQL Connector/J version 8.0 🙂

In the meantime, I also noticed that during startup of Stardog, I see the following line:

`Loading class 'com.mysql.jdbc.Driver'. This is deprecated. The new driver class is 'com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.`

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 25, 2019, 1:38pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/6 "2019-06-25T13:38:49Z")

</div>

The newer driver class is indeed `com.mysql.cj.jdbc.Driver`. Did you copy the older one from the tutorial?

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 25, 2019, 2:01pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/7 "2019-06-25T14:01:54Z")

</div>

I copied the `mysql-connector-java-8.0.13.jar` from MySQL installation folder into `stardog-6.2.2\server\dbms`. I assume this is the newest Connector/J (v8). So, to proceed, I either:

- change the named of the driver class in the virtual graph configuration, to use the newest JDBC connector for MySQL
- load the jar of the older Connector/J (v5.1) and keep the name of the driver class  
?

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 25, 2019, 3:39pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/8 "2019-06-25T15:39:12Z")

</div>

It is not necessary to change the name of the driver in the configuration file. The warning is harmless. Switching to the 5.1 series driver however, will workaround the error that you are seeing. The other option is to ensure that your tables have primary keys.

Jess

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 25, 2019, 7:34pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/9 "2019-06-25T19:34:35Z")

</div>

Okay, I'm making slow progress, but getting there. I now have the 5.1 driver and I have no more issues on the sample beatles dataset and the default sakila dataset from MySQL. However, when I test it on a real world dataset (which misses foreign keys), I get the following error in:

```
Exception in thread "stardog-user-3" java.nio.BufferOverflowException
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:363)
        at java.nio.ByteBuffer.put(ByteBuffer.java:859)
        at io.undertow.conduits.ChunkedStreamSinkConduit.createLastChunk(ChunkedStreamSinkConduit.java:339)
        at io.undertow.conduits.ChunkedStreamSinkConduit.terminateWrites(ChunkedStreamSinkConduit.java:315)
        at io.undertow.conduits.DeflatingStreamSinkConduit.flush(DeflatingStreamSinkConduit.java:352)
        at org.xnio.conduits.ConduitStreamSinkChannel.flush(ConduitStreamSinkChannel.java:162)
        at io.undertow.channels.DetachableStreamSinkChannel.flush(DetachableStreamSinkChannel.java:119)
        at org.xnio.channels.Channels.flushBlocking(Channels.java:63)
        at io.undertow.io.UndertowOutputStream.close(UndertowOutputStream.java:344)
        at io.undertow.io.BlockingSenderImpl.close(BlockingSenderImpl.java:170)
        at io.undertow.io.DefaultIoCallback.onComplete(DefaultIoCallback.java:54)
        at io.undertow.io.BlockingSenderImpl.invokeOnComplete(BlockingSenderImpl.java:227)
        at io.undertow.io.BlockingSenderImpl.send(BlockingSenderImpl.java:60)
        at io.undertow.io.BlockingSenderImpl.send(BlockingSenderImpl.java:79)
        at com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader$S4ErrorHandler.accept(StardogHttpServiceLoader.java:281)
        at com.stardog.http.server.undertow.ErrorHandling.sendErrorResponse(ErrorHandling.java:70)
        at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:195)
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

```

Any ideas what's going on?

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [June 25, 2019, 8:13pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/10 "2019-06-25T20:13:51Z")

</div>

When I try to materialize the virtual triples via the console, I get a `class java.lang.NullPointerException`. The stardog.log does not contain any more details for the above exception or the BufferOverflowException...

I can see that the direct mappings resulted in some seemingly valid mappings being generated (checked in Stardog Studio).

In my dataset, I notice there are some columns from different tables having the same name (these would ideally be foreign keys, but currently they are absent). In my case, I try to make sense of an existing and rather complex SQL database (missing foreign keys) using graphs and direct mapping, before optimizing the virtual graph with more adapted mappings with some selected ontologies. If you have any recommendations for a workflow, I would be glad to hear them 🙂

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [June 26, 2019, 3:36pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/11 "2019-06-26T15:36:56Z")

</div>

Let me check into the buffer overflow exception. Does it happen every time you execute the query?

Regarding the NullPointerException, are you able to export and share the mappings? The `virtual mappings` command can be used for this, or saving them from Stardog Studio.

---

<div class="post-metadata">

**Author:** ![mathib](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/mathib/32/345_2.png) [@mathib](https://community.stardog.com/u/mathib)\
**Post date:** [July 9, 2019, 9:54am UTC](https://community.stardog.com/t/virtual-graphs-error/1752/12 "2019-07-09T09:54:23Z")

</div>

Hi Jess, It seems to happen everytime with this particular database. I also tried both drivers. Can I share the mappings privatly via mail?

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [July 11, 2019, 12:39pm UTC](https://community.stardog.com/t/virtual-graphs-error/1752/13 "2019-07-11T12:39:04Z")

</div>

Please send to `jess@stardog.com`. Thanks.
