# Pystardog named graph select returns no results

**URL:** <https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303>\
**Category:** Support\
**Created:** [March 17, 2025, 10:21pm UTC](https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303 "2025-03-17T22:21:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrrhyne](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jrrhyne](https://community.stardog.com/u/jrrhyne)\
**Post date:** [March 17, 2025, 10:21pm UTC](https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303/1 "2025-03-17T22:21:03Z")

</div>

Simple query returns no results. Pystardog version is 0.17.0.  
Example from Python debugger:  
ress = self.\_conn.select(q, bindings=b, default\_graph\_uri=[g])

!p ress  
{'head': {'vars': ['ont\_NG\_iri']}, 'results': {'bindings': }}

!p q  
'SELECT ?ont\_NG\_iri WHERE {?iri [https://thematix.com/tools/BACM\_3/ontology](https://thematix.com/tools/BACM_3/ontology) ?ont\_NG\_iri }'

!p b  
{'iri': '[https://www.omg.org/spec/BACM/](https://www.omg.org/spec/BACM/)'}

!p g  
'[https://thematix.com/tools/BACM\_3/ontologies](https://thematix.com/tools/BACM_3/ontologies)'

The database has two triples in the named graph [https://thematix.com/tools/BACM\_3/ontologies](https://thematix.com/tools/BACM_3/ontologies) that I can retrieve in Studio.

 ![Capture](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/4/4d46426e52a7f11016305958b856f266c31f3d33.jpeg)

I have tried a number of variations of this query in Pystardog, including using the FROM and FROM NAMED clauses and replacing the bound variable with its bound value. All return no results.

Is there a way to see what the query plan is when using Pystardog?

Strangely, if I run the query in Studio using the FROM clause and replacing the bound variable, I get no results. It appears that Studio ignores the FROM and FROM NAMED clauses when the default unnamed graph is selected.

---

<div class="post-metadata">

**Author:** ![jrrhyne](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jrrhyne](https://community.stardog.com/u/jrrhyne)\
**Post date:** [March 19, 2025, 2:59pm UTC](https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303/2 "2025-03-19T14:59:07Z")

</div>

This issue is resolved.  
If triples are inserted into a named graph and the insert graph uri parameter is a an IRI string enclosed in \<\>, the entire string including the \<\> becomes the name of the graph. A select query using a graph name without the \<\> will return no values.  
Studio appears to know about this and will strip \<\> from graph names, making it impossible to create a select query that will access the graph whose name includes the \<\>.  
The Pystardog documentation for 0.17.0 does not mention the need to strip the \<\> from URIs used as graph names. I found another post that happened to mention this, but did not realize that this requirement was unchecked either in the Python code that runs in the client or at the http server that receives the request.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [October 28, 2025, 8:40pm UTC](https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303/3 "2025-10-28T20:40:38Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [July 1, 2026, 2:18am UTC](https://community.stardog.com/t/pystardog-named-graph-select-returns-no-results/5303/4 "2026-07-01T02:18:18Z")

</div>


