Pystardog reasoning not working

Hi, I am trying to use SPARQL with pystardog to return data but cannot get reasoning to work.

Using the following code:

#conn_details removed from support post

database = 'sqlBehaviors'

with stardog.Connection(database, **conn_details) as conn:
    query = '''

        select ?test {
            ?test a sql:Behavior . 
        }

            '''
results = conn.select(query, reasoning=True)

for result in results['results']['bindings']:
    print(result)

If run this SPARQL query in Stardog studio or the equivalent of the query in explorer, with reasoning enabled and the correct reasoning schema then I am able to return the expected data.

The reasoning schema is named "sql" and is configured in the database "sql=tag:stardog:designer:sql:model"

I have tried stating the named graphs and stardog:context:all but had no results for the pystardog approach but this returns nothing. I cannot find anything in the documentation that explains why the reasoning doesn't work or how to specify which reasoning schema to use.

I am able to query assertions but not reasoning.

Can someone advise

Hi,

It is not possible to set a reasoning schema for a query with pystardog. This would require passing the parameter schema=sql in the request to the server. This parameter, however, is currently not supported in the pystardog API (see also this GitHub issue). Only the default reasoning schema is supported. As a result, if you set the sql as the default reasoning schema, then your query should work. You can do this in the database property "Schema Graphs" (reasoning.schema.graphs) and add your model to the list. For example, you can set the property to tag:stardog:api:context:schema,tag:stardog:designer:sql:model.

Best regards

Lars