You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by David Jordan <Da...@sas.com> on 2011/09/21 17:16:35 UTC

TDB querying

I am trying to use tdb.tdbquery for the first time (but I am running it via an Ant script).
I have loaded data into TDB.
I have a few queries that had been working with SDB, but every query I run returns no results.
I thought maybe the graphs I was referring to in the query were wrong or needed to be different, I tried several variations, including urn:x-arq:UnionGraph.
I am using an assembler file, which has the models and associated graph names declared, but they don’t work.
Still no results. Then I tried the following query I found in the Learning SPARQL book

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

I thought this would tell me the right graph names to use. But this came back with no results either.
Any ideas?

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 ▪ david.jordan@sas.com<ma...@sas.com>
www.sas.com<http://www.sas.com>
SAS® … THE POWER TO KNOW®




RE: TDB querying

Posted by David Jordan <Da...@sas.com>.
Your last guess was the right one. My ant script was running the JVM in a query subdirectory, so it created a new empty DB subdirectory underneath that.
My Ant script mistake.
Thanks.

-----Original Message-----
From: Andy Seaborne [mailto:andy.seaborne.apache@gmail.com] On Behalf Of Andy Seaborne
Sent: Wednesday, September 21, 2011 11:28 AM
To: jena-users@incubator.apache.org
Subject: Re: TDB querying

On 21/09/11 16:16, David Jordan wrote:
>
> I am trying to use tdb.tdbquery for the first time (but I am running it via an Ant script).
> I have loaded data into TDB.

Details?
Did the data go into the default graph?

> I have a few queries that had been working with SDB, but every query I run returns no results.
> I thought maybe the graphs I was referring to in the query were wrong or needed to be different, I tried several variations, including urn:x-arq:UnionGraph.
> I am using an assembler file, which has the models and associated graph names declared, but they don’t work.
> Still no results. Then I tried the following query I found in the 
> Learning SPARQL book
>
> select distinct ?g
> where
> {
>          GRAPH ?g {?s ?p ?o}
> }

Try:

SELECT (Count(*) AS ?c) {
    { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o} } }

>
> I thought this would tell me the right graph names to use. But this came back with no results either.
> Any ideas?

Check the location name.  TDB autocreates databases so if you spell them wrong, you end up loading one and querying another.

	Andy


Re: TDB querying

Posted by Andy Seaborne <an...@apache.org>.
On 21/09/11 16:16, David Jordan wrote:
>
> I am trying to use tdb.tdbquery for the first time (but I am running it via an Ant script).
> I have loaded data into TDB.

Details?
Did the data go into the default graph?

> I have a few queries that had been working with SDB, but every query I run returns no results.
> I thought maybe the graphs I was referring to in the query were wrong or needed to be different, I tried several variations, including urn:x-arq:UnionGraph.
> I am using an assembler file, which has the models and associated graph names declared, but they don’t work.
> Still no results. Then I tried the following query I found in the Learning SPARQL book
>
> select distinct ?g
> where
> {
>          GRAPH ?g {?s ?p ?o}
> }

Try:

SELECT (Count(*) AS ?c) {
    { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o} }
}

>
> I thought this would tell me the right graph names to use. But this came back with no results either.
> Any ideas?

Check the location name.  TDB autocreates databases so if you spell them 
wrong, you end up loading one and querying another.

	Andy