Hi
we have a query that can be successfully executed through Stardog Studio. But when we try to send the same query text through SnarlTemplate, we get this exception:
com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ClassCastException: class com.complexible.stardog.plan.filter.expr.Variable cannot be cast to class com.complexible.stardog.plan.filter.expr.Constant (com.complexible.stardog.plan.filter.expr.Variable and com.complexible.stardog.plan.filter.expr.Constant are in unnamed module of loader 'app')
java.lang.RuntimeException: com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ClassCastException: class com.complexible.stardog.plan.filter.expr.Variable cannot be cast to class com.complexible.stardog.plan.filter.expr.Constant (com.complexible.stardog.plan.filter.expr.Variable and com.complexible.stardog.plan.filter.expr.Constant are in unnamed module of loader 'app')
...
..
Caused by: com.complexible.stardog.protocols.http.client.BaseHttpClient$HttpClientException: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ClassCastException: class com.complexible.stardog.plan.filter.expr.Variable cannot be cast to class com.complexible.stardog.plan.filter.expr.Constant (com.complexible.stardog.plan.filter.expr.Variable and com.complexible.stardog.plan.filter.expr.Constant are in unnamed module of loader 'app')
at app//com.complexible.stardog.protocols.http.client.BaseHttpClient.errorCodeToException(BaseHttpClient.java:570)
at app//com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:527)
at app//com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:389)
at app//com.complexible.stardog.protocols.http.client.HttpClientImpl.select(HttpClientImpl.java:218)
at app//com.complexible.stardog.protocols.http.client.HttpConnection._select(HttpConnection.java:253)
at app//com.complexible.stardog.api.impl.AbstractConnection.executeSelect(AbstractConnection.java:460)
at app//com.complexible.stardog.api.impl.SelectQueryImpl.execute(SelectQueryImpl.java:38)
at app//com.complexible.stardog.api.impl.SelectQueryImpl.execute(SelectQueryImpl.java:25)
...
..
Caused by: com.complexible.stardog.StardogException: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ClassCastException: class com.complexible.stardog.plan.filter.expr.Variable cannot be cast to class com.complexible.stardog.plan.filter.expr.Constant (com.complexible.stardog.plan.filter.expr.Variable and com.complexible.stardog.plan.filter.expr.Constant are in unnamed module of loader 'app')
at app//com.complexible.stardog.ErrorCodes.parseToThrowable(ErrorCodes.java:59)
at app//com.complexible.stardog.protocols.http.client.BaseHttpClient.errorCodeToException(BaseHttpClient.java:555)
... 102 more
we think the cause of this problem is the property path that is used in one of the triple patterns in the query which is like this
?subject ((rdfs:subClassOf)/(rdfs:subClassOf)?/(rdfs:subClassOf)?)? ?object .
we are not sure how to pass the text of these kinds of triple patterns to the Stardog server.