Uncaught error during query evaluation

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.

Hi, any chance you can share the full stacktrace from stardog.log file located in your STARDOG_HOME directory?

If you can share the full query and a small subset of the data that is sufficient to reproduce -- even better.

Thanks,
Pavel

Thank you for your reply @pavel. Sorry we do not have access to it right now. We'll put the log here once we receive it. In meanwhile, we found some workarounds for it. If we rewrite the triple pattern like this

{
     ?subject rdfs:subClassOf [ rdfs:subClassOf? [ rdfs:subClassOf? ?object ]].
    }
    UNION
    {
     ?subject rdfs:subClassOf? ?object. 
    }

or

{
?subject ((rdfs:subClassOf)/(rdfs:subClassOf)?/(rdfs:subClassOf)?) ?object .
}
 UNION
    {
     ?subject rdfs:subClassOf? ?object. 
    }

or

?subject rdfs:subClassOf?|rdfs:subClassOf/rdfs:subClassOf|rdfs:subClassOf/rdfs:subClassOf/rdfs:subClassOf ?object.

we'll be able to run the query. We guess it's somehow related to the last ? after the last ')'.