My issue is that I have to meet a deadline on Monday and other things are 
higher priority till then.
For now, I can live with naming the data sets in FROM, but I would like to get 
this resolved next week.
I have MANY triples in both models.
Query and configuration is easy to give you, getting a useful small set of data 
will take a little more time.

-----Original Message-----
From: Andy Seaborne [mailto:[email protected]] On Behalf Of Andy 
Seaborne
Sent: Friday, September 23, 2011 9:49 AM
To: [email protected]
Subject: Re: query on several models in TDB

On 23/09/11 13:57, David Jordan wrote:
>
> I took my working query which used FROM, removed the two FROMs, then tried 
> both of these variations.
> Neither one produced any results.
> I don't really have a way of putting together a small example without a lot 
> of work.

Is that because if you have one triple in each dataset it works?

What is needed is data + query + configuration details.

It is the details that matter which is why I hoped to recreate a setup that was 
sufficiently like you installation and exhibited the problems.

> Are you sure it needs to be --set tdb:unionDefaultGraph=true, versus 
> simply --set tdb:unionDefaultGraph

TDB.getContext().set(TDB.symUnionDefaultGraph, true) ;

is the same as command line:

--set tdb:unionDefaultGraph=true

or

--set=tdb:unionDefaultGraph=true

> The documentation was not clear about this.
>
>       <target name="tdb.query">
>               <java classname="tdb.tdbquery" fork="true">
>                       <classpath refid="tdb.classpath" />
>                       <arg value="--tdb=${assembler.file}" />

Could you share the assembler file?

Which version of TDB are you using?

        Andy

>                       <arg value="--set=tdb:unionDefaultGraph=true" />
>                       <arg value="--query=${query}" />
>               </java>
>       </target>
>       
>       <target name="tdb.query">
>               <java classname="tdb.tdbquery" fork="true">
>                       <classpath refid="tdb.classpath" />
>                       <arg value="--tdb=${assembler.file}" />
>                       <arg value="--set" />
>                       <arg value="tdb:unionDefaultGraph=true" />
>                       <arg value="--query=${query}" />
>               </java>
>       </target>
>
> -----Original Message-----
> From: Andy Seaborne [mailto:[email protected]] On Behalf 
> Of Andy Seaborne
> Sent: Friday, September 23, 2011 5:50 AM
> To: [email protected]
> Subject: Re: query on several models in TDB
>
> On 22/09/11 14:56, David Jordan wrote:
>> I have my data in more than one model in TDB and I am trying to write a 
>> query that spans across them.
>>
>> I did try using the following FROM clause.
>> FROM<urn:x-arq:UnionGraph>
>> This worked, but there was a long delay in producing results (as compared to 
>> running against one named graph).
>> So I am guessing that what took so long was that a union was literally being 
>> created before the query was executed.
>> My hope was that this would just do the query across all the graphs in the 
>> database.
>>
>> Something else I am trying to get working is using the following in my Ant 
>> script that runs tdbquery.
>>           <target name="tdb.query">
>>                   <java classname="tdb.tdbquery" fork="true">
>>                           <classpath refid="tdb.classpath" />
>>                           <arg value="--tdb=${assembler.file}" />
>>                           <arg value="--set tdb:unionDefaultGraph=true" />
>>                           <arg value="--query=${query}" />
>>                   </java>
>>           </target>
>>
>> Executing 'C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe' with 
>> arguments:
>> '-classpath'
>> 'C:\Documents and Settings\davjor\My 
>> Documents\Jena\TDB-0.8.11-SNAPSHOT\lib\arq-
>> Documents\Jena\TDB-0.8.11-SNAPSHOT\lib\jena-2.6.4.jar;C:\Documents and 
>> Settings\                     I cut this off, too long.
>> b\tdb-0.8.11-SNAPSHOT.jar;C:\Documents and Settings\davjor\My 
>> Documents\Jena\TDB 'tdb.tdbquery'
>> '--tdb=db.ttl'
>> '--set tdb:unionDefaultGraph=true'
>> '--query=query/haslungcancer.rq'
>>
>> The ' characters around the executable and arguments are not part of the 
>> command.
>> Unknown argument: set tdb
>
> This matters.  It says the union flag is not getting set.
> You don't need "FROM<urn:x-arq:UnionGraph>"
>
> Because you have
>
> '--set tdb:unionDefaultGraph=true'
>
> it's all one string to the exec system call, starting with "--"
>
> Both ":" and "=" are name/value split markers.
>
> So the argument is called
>
> "set tdb"
>
> not "set"
>
>
> Try:
>
> '--set=tdb:unionDefaultGraph=true'
>
> or (I think)
>
> <arg value="--set" />
> <arg value="tdb:unionDefaultGraph=true" />
>
> i.e. two separate arguments to java execution.
>
> TDB uses the usual command like style of
>
> --flag value
>
> as two arguments to the exec system call
>
> --flag=value
>
> as one argument to exec.
>
>       Andy
>
>>
>> The documentation was not clear at all whether there was a particular value 
>> to set unionDefaultGraph to. Is this correct?
>> Also, any ideas why tdbquery is having a problem with the : ?
>>
>> I really want to avoid having a union computed up front of the graphs that I 
>> need.
>> When I directly use named graphs in the query, things don’t work right when 
>> I use a variable spanning across multiple graphs.
>>
>> David Jordan
>> Software Developer
>> SAS Institute Inc.
>> Health&   Life Sciences, Research&   Development Bldg R ▪ Office 4467
>> 600 Research Drive ▪ Cary, NC 27513
>> Tel: 919 531 1233 ▪ [email protected]<mailto:[email protected]>
>> www.sas.com<http://www.sas.com>
>> SAS® … THE POWER TO KNOW®
>>
>>
>>
>
>


Reply via email to