PyStardog Query Executor

Hi,

I have been trying to use the pystardog module to query the database using the pystardog API like

query_result = conn.select(
query= query,
# offset=100,
limit=1000,
reasoning=True
)

However the functionality of querying the whole database when virtual transparency is on is available on studio with setting "stardog:context:all" while querying .
I want to replicate the same functionality with the pystardog api , but was not able to reproduce the same results.

Can you help me how to approach this to produce similar results?

Hi Dipanjan,

you should be able to set the default graph URI to tag:stardog:api:context:all using the default_graph_uri parameter to get the desired behavior.

query_result = conn.select(
query= query,
limit=1000,
reasoning=True,
default_graph_uri=["tag:stardog:api:context:all"]
)

Make sure to have at least pystardog v 0.17.0 .

Best regards
Lars

2 Likes

Thanks ,

Working perfectly now.