You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by asdas asdasd <an...@yahoo.com> on 2011/03/16 12:58:13 UTC

TDB Reasoning problem for huge amount of Data

I want to make a huge ammount of data in TDB(about 1,000,000 records). I  was 
wondering whether I can make reasoning on that data? Forexample suppose I define 
rule such as "hasRelationWith(A,B) ->  willHeritage(A,B)" also I define some 
individuals like A and B and  properties such as "A hasRelationWith B" now I 
want to SPARQL to infer  willHeritage(A,B). If I want to use JENA and all the 
records in the memory, then reasoning will be awful(because it's a lot of data 
and memory is limited ). I have written this code for reasoning in TDB but it 
doesn't show any  result! So What is the problem?


    Dataset ds = TDBFactory.createDataset(directory) ;
    Model model = ds.getDefaultModel() ;
    Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
    InfModel infmodel = ModelFactory.createInfModel(reasoner, model);
String qs = "PREFIX sn: 
<http://www.semanticweb.org/ontologies/2011/2/ontology1.owl#> SELECT * { sn:A 
sn:willHeritage ?o }";
Query query = QueryFactory.create(qs) ;
    QueryExecution qExec = SparqlDLExecutionFactory.create(query, infmodel) ;
    ResultSet rs = qExec.execSelect();
ResultSetFormatter.out(rs);


      

Re: TDB Reasoning problem for huge amount of Data

Posted by Andy Seaborne <an...@epimorphics.com>.

On 16/03/11 11:58, asdas asdasd wrote:
> I want to make a huge ammount of data in TDB(about 1,000,000 records). I  was
> wondering whether I can make reasoning on that data? Forexample suppose I define
> rule such as "hasRelationWith(A,B) ->   willHeritage(A,B)" also I define some
> individuals like A and B and  properties such as "A hasRelationWith B" now I
> want to SPARQL to infer  willHeritage(A,B). If I want to use JENA and all the
> records in the memory, then reasoning will be awful(because it's a lot of data
> and memory is limited ). I have written this code for reasoning in TDB but it
> doesn't show any  result! So What is the problem?
>
>
>      Dataset ds = TDBFactory.createDataset(directory) ;
>      Model model = ds.getDefaultModel() ;
>      Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
>      InfModel infmodel = ModelFactory.createInfModel(reasoner, model);
> String qs = "PREFIX sn:
> <http://www.semanticweb.org/ontologies/2011/2/ontology1.owl#>  SELECT * { sn:A
> sn:willHeritage ?o }";
> Query query = QueryFactory.create(qs) ;
>      QueryExecution qExec = SparqlDLExecutionFactory.create(query, infmodel) ;
>      ResultSet rs = qExec.execSelect();
> ResultSetFormatter.out(rs);
>

SparqlDLExecutionFactory isn't part of Jena.

Either use QueryExecutionFactory or use Pellet and ask ClarkParsia about 
SparqlDLExecutionFactory.

Ideally, Pellet would register as a query engine provider and then the 
usual search for a query engine factory woudl sort this out for you).

	Andy