Named graph filter

Do I need a specific setting in the database properties to be able to filter graphs?

this works:

select distinct *
where { 
    GRAPH ?g {
        ?s ?p ?o
        
    }
} 

and returns named graphs

<urn:graph:foaf>
<urn:graph:skos>

but when I ask for a filter for a graph on the list, it just returns nothing:

select distinct ?g
where { 
    GRAPH ?g {
        ?s ?p ?o
        
    }
    FILTER (?g=<urn:graph:foaf>)
} 

Any clues why? I tried the stardog studio online and it works there, but doesn't on my local version.

No, you shouldn't need anything. What's your Stardog version? Also please post the query plan.

Thanks,
Pavel

Server version 7.4.0

From local
Distinct [#1]
`─ Projection(?g) [#1]
   `─ Bind(<urn:graph:foaf> AS ?g) [#1]
      `─ Scan[SPOC](?s, ?p, ?o){<urn:graph:foaf>} [#1]

Thanks. We are so far unable to reproduce on a toy data with either 7.4.0 or 7.4.1 candidate. Are you able to share your dataset?

Cheers,
Pavel

I basically only have a few ontologies loaded. I loaded foaf and skos ontologies into their own named graphs, no data yet. Regardless of how I set up my database, I seem not to be able to get named graphs out. That is why I was wondering if there was some setting that was conflicting with getting named graphs out.

Got it, I was using pystardog to load the database and I was using <urn:graph:skos> to load the data. There <> was causing the trouble. Removed those and it worked.

Ah, glad you figured it out!

Best,
Pavel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.