Try a FILTER clause involving ?g1 and ?g2 .

there is also the unionGraph but it takes everything in all named graphs .

2016-08-22 15:21 GMT+02:00 Chris Jones <[email protected]>:

> Hi All,
>
> Is it possible to run a query against the union of a bunch of named
> graphs, where each named graph is selected by some logic? As an example, I
> have something like this:
>
> select ?attr ?value ?attrName where {
>     graph ?g1 {
>         ?subj ?attr ?value .
>     }
>     graph ?g2 {
>         ?attr rdfs:label ?attrName .
>     }
>     ?g1 xyz:good true .
>     ?g2 xyz:good true .
> }
>
> ...so I'm grabbing data from g1, and metadata from g2. Both g1 and g2 are
> selected using some kind of logic; and they might be the same graph. You
> can imagine a larger query, expressed in this style, could get very
> complex. Is there instead a way to specify a union graph made up of all the
> graphs for which a predicate is true, and then perform a query against that
> union graph?
>
> Chris
>



-- 
Jean-Marc Vanel
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
http://deductions-software.com/
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui

Reply via email to