> 2.11.0

Probably a good idea to upgrade to 2.13.0. The on-disk data does not have to be reloaded.

PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT  (str(?lbl) AS ?relLBL)
WHERE
  {   { ?entity1 ?rel ?entity2 }
    UNION
      { ?entity2 ?rel ?entity1 }
    ?entity1 rdfs:label "Tennessee"@en .
    ?entity2 rdfs:label "Jack Daniel"@en .
    ?rel rdfs:label ?lbl
    FILTER ( lang(?lbl) = "en" )
  }

This is a very different query to last time which had

  ?entity1 rdf:type dbpo:Person
  ?entity2 rdf:type dbpo:Place

This new query is best done something like:

SELECT DISTINCT  (str(?lbl) AS ?relLBL)
WHERE
  {
    ?entity2 rdfs:label "Jack Daniel"@en .
    ?entity1 rdfs:label "Tennessee"@en .
      { ?entity1 ?rel ?entity2 }
    UNION
      { ?entity2 ?rel ?entity1 }
    ?rel rdfs:label ?lbl
    FILTER ( lang(?lbl) = "en" )
  }

and remove the DISTINCT while developing as repeats help you know if the query is doing what you expect.

| relLBL |
| birth place |
| PLACE OF BIRTH |
| death place |

Is that a column, headed "relLBL" and three rows?

Start simple:

SELECT { ?entity2 rdfs:label "Jack Daniel"@en . }
how many?

SELECT { ?entity1 rdfs:label "Tennessee"@en . }
how many?

Then multiply together to get the number of things that the UNION will try.

Because Freebase endpoint does not support SPARQL query language, I
have thought that loading its RDF dump file to TDB store and using
SPARQL language to extract relations between entities is a solution to
my reserach. DBPedia contains triples less than half Trillion and makes
TDB very slow so what is about 2.6 Trillion triples in Freebase, could
TDB handle it?

Freebase claims to be 1.9 billion, not a 2.6 trillion, which is 1000x larger.

TDB will only acceptable if your queries are very specific ("look up a key,get a few values" will you get anything like tolerable response. If you do pattern-searching, then TDB at billions isn't going to work.

This second query is rather more specific (I'd guess not many "Jack Daniel"@en -- but many rdf:type dbpo:Person or rdf:type dbpo:Place).

        Andy

On 15/03/15 13:30, Abduladem Eljamel wrote:
Hi Andy,,
Thank you for answering my email.
The Jena version is (2.11.0) included TDB version (1.0.0).
I am using the last DBPedia dump file of size around (64GB).
I used “TDBloader2” to load this dump file to TDB store.
It loaded (410345971 triples) to TDB store.
The total size of TDB files is around (60GB).

I tried all queries you offered, but there is no effect, very long time or no 
end running. I tried them by using both,  local Fuseki  server and Jena API in 
Java application. However, when I tried the same queries by using DBpedia 
online endpoints, it took seconds (including the query I wrote).

I am using DBPedia to find what kind of relations between two entities in 
online news text (ex. Person, Organisation and Location).
This is an example of query that I am using in my application by using DBPedia online endpoint that 
works fine and very fast. It extracts the relations in a dataset between "Tennessee" 
location and "Jack Daniel" person.
*******************************************************************************
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT  (str(?lbl) AS ?relLBL)
WHERE
   {   { ?entity1 ?rel ?entity2 }
     UNION
       { ?entity2 ?rel ?entity1 }
     ?entity1 rdfs:label "Tennessee"@en .
     ?entity2 rdfs:label "Jack Daniel"@en .
     ?rel rdfs:label ?lbl
     FILTER ( lang(?lbl) = "en" )
   }
the answer of this query by using DBPedia online endpoint is:
| relLBL |
| birth place |
| PLACE OF BIRTH |
| death place |

****************************************************************************************

I am a PhD student and my reserach is in a critical point because I am tending 
to use a bigger dataset, Freebase dataset, to extract relations.  Because 
Freebase endpoint does not support SPARQL query language, I have thought that 
loading its RDF dump file to TDB store and using SPARQL language to extract 
relations between entities is a solution to my reserach. DBPedia contains 
triples less than half Trillion and makes TDB very slow so what is about 2.6 
Trillion triples in Freebase, could TDB handle it?
I read many papers which compare between RDF stores in terms of BigData era. I 
found that Jena TDB is good enough for my data besides that I have a 
satisfactory Jena background.

How to make Jena TDB fast enough to extract relation from Freebase?
I am sorry for this long email, but as I said above, my research is in critical 
point and I need every little help.Thanks in advance.Abdul


       From: Andy Seaborne <[email protected]>
  To: [email protected]
  Sent: Saturday, 14 March 2015, 19:09
  Subject: Re: TDB Optimization

One other point:

TDB query execution does not, currently, use multiple threads for a
single query.  In Fuseki, where multiple overlapping requests matter,
the cores allow the server to execute requests in true concurrency.



     Andy






Reply via email to