Yes, and for yet another piece in the puzzle, keep in mind that the query below 
behaves slightly differently than the one that Bob had sent. Below assumes that 
the result of the SELECT is simply the union or the sum of all individual 
queries on each sub-graph. Bob's query does a single query over the union 
graph, and this can do merges across multiple graphs at once and will therefore 
potentially return different results. As long as you only have a single graph 
pattern as below this doesn't matter, but if you have two or more clauses then 
it may matter. If you need this, then I believe creating a master graph that 
imports all others is the only solution that comes to my mind.

Holger


On Aug 19, 2011, at 8:55 AM, Scott Henninger wrote:

> You can use tops:files and GRAPH to do this.  The following will find
> all class definitions for them ontologoes in the examples directory:
> 
>  SELECT *
>  WHERE {
>     ?path tops:files ("/TopBraid/Examples" true)
>     BIND (smf:baseURI(?path) AS ?baseURI)
>     FILTER (bound(?baseURI))
>     GRAPH ?baseURI
>     {  ?s a ?class .
>     }
>  }
> 
> For all projects in TopBraid, use "TopBraid".
> 
> -- Scott
> 
> On Aug 18, 5:40 pm, "Bob Ducharme" <[email protected]> wrote:
>> There are two ways to query multiple RDF files at once: first, as you
>> describe, import them into a single graph and query that. Another way would
>> be specify the base URI of each graph in a FROM clause, like this:
>> 
>>   SELECT DISTINCT ?class
>>   FROM <http://topbraid.org/examples/kennedys>
>>   FROM <http://topbraid.org/countries>
>>   FROM <http://www.w3.org/TR/2003/PR-owl-guide-20031209/food>
>>   WHERE {
>>     ?s a ?class .
>>   }
>> 
>> There is no simple way, though, to query all the RDF files that happen to be
>> in the same project.
>> 
>> Bob
>> 
>> -----Original Message-----
>> From: [email protected]
>> 
>> [mailto:[email protected]] On Behalf Of brucewhealton
>> Sent: Thursday, August 18, 2011 5:46 PM
>> To: TopBraid Suite Users
>> Subject: [topbraid-users] SPARQL Queries across different files in a
>> project?
>> 
>> Hello,
>>           I was wondering if TBC supported making queries across
>> different RDF files that are in the same project?  Or does one have to
>> import all the files into one ontology, one file?
>> Thanks,
>> Bruce
>> 
>> --
>> You received this message because you are subscribed to the Google
>> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
>> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
>> To post to this group, send email to
>> [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group 
>> athttp://groups.google.com/group/topbraid-users?hl=en
> 
> -- 
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to