Abduladem, To optimize performance in TDB, put the most restrictive pattern first. I assume that there are fewer facts about "Jack Daniel" than about "Tennessee". Try the following order:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT (str(?lbl) AS ?relLBL) WHERE { ?entity2 rdfs:label "Jack Daniel"@en . {{ ?entity1 ?rel ?entity2 } UNION { ?entity2 ?rel ?entity1 }} ?rel rdfs:label ?lbl FILTER ( lang(?lbl) = "en" ) ?entity1 rdfs:label "Tennessee"@en . } -- Arthur On Sun, Mar 15, 2015 at 9:30 AM, Abduladem Eljamel <[email protected]> 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 > > > >
