Adeeb That specific error - "Impossibly large object" - means your TDB dataset has been corrupted. This can happen through non-transactional use or by using a TDB dataset from multiple JVMs simultaneously. Corrupted datasets cannot be recovered and have to be rebuilt from scratch from the original source data.
I would strongly recommend that you use add use of transactions to your code as detailed at https://jena.apache.org/documentation/tdb/tdb_transactions.html Rob On 19/06/2014 05:21, "Adeeb Noor" <[email protected]> wrote: >Hi Andy: > >Thanks for the quick replay. > >I meant the stackoverflow answer did not work for me either. > >So, I have my knowledgeable stored in TDB with size of 14GB. Moreover, I >have my owl (schema) where I generate the axioms and want to infer some >results. Then I store the infer result in new TDB. I tested with a small >case where the tdb was 500kb and works just fine, but with my really tdb >14GB, I got this error when I try to add the rdf to owl. > >Note: I am using a super computer for this test case and >apache-jena-2.10.0 > > >ERROR [main] (ObjectFileStorage.java:345) - >ObjectFileStorage.read[nodes.dat](11 >58401652)[filesize=1158402173][file.size()=1158402173]: Impossibly large >object >: 1966046830 bytes > filesize-(loc+SizeOfInt)=517 >Exception in thread "main" com.hp.hpl.jena.tdb.base.file.FileException: >ObjectFi >leStorage.read[nodes.dat](1158401652)[filesize=1158402173][file.size()=115 >840217 >3]: Impossibly large object : 1966046830 bytes > >filesize-(loc+SizeOfInt)=517 > at >com.hp.hpl.jena.tdb.base.objectfile.ObjectFileStorage.read(ObjectFile >Storage.java:346) > >Here is the code: > >public static void storeInfraredModel(Data tdb) { > >OntModel owl, > > Dataset dataset = >TDBFactory.createDataset(/Users/adeebnoor/Desktop/newTDB); > > OntModel inferModel = >ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, >dataset.getNamedModel(this.URL)); > > inferModel.add(owl); // the owl file > >inferModel.add(tdb); // the original tdb > > System.out.println("creting ModelExtractor "); > > ModelExtractor ext = new ModelExtractor(inferModel); > >dataset.replaceNamedModel(this.URL, ext.extractModel()); > >inferModel.close(); // saving infead model > >dataset.close(); > >} > >public static void main(String[] args) { > >System.out.println(" ... Running Pellet Reasoner and Storing results in >new >TDB ..."); > >Dataset tdb = >TDBFactory.createDataset(/Users/adeebnoor/Desktop/orginalTDB); > >storeInfraredModel(tdb); > > tdb.close(); > >} > >Please let me know how I can solve the problem, and also why it works with >small cases and not with big one. The schema is consistent already > > >On Wed, Jun 18, 2014 at 1:46 AM, Andy Seaborne <[email protected]> wrote: > >> On 18/06/14 06:41, Adeeb Noor wrote: >> >>> Hi guys: >>> >>> I am having really a hard time with TDB, I was planning to post >>>everything >>> here but I googled first and found a post on the stachoverflow that has >>> the >>> same issue, but with no answer. >>> >>> http://stackoverflow.com/questions/21115009/how-could- >>> i-store-multiple-ontologies-in-tdb/24277697#24277697 >>> . >>> >> >> It does have answer. >> >> >> >>> Here is my code too: >>> >> >> What is it trying to do? And what happens? >> >> This is unrunnable and unexplained. >> >> A >> >> Complete Minimal Example >> >> please. >> >> Andy >> >> >> >>> System.out.println("creting infeer dataset "); >>> >>> Dataset dataset = TDBFactory.createDataset(data. >>> getInferredResultsPath()); >>> >>> System.out.println("creting OntModel "); >>> >>> OntModel Infmodel = >>> >>> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, >>> >>> dataset.getNamedModel(this.URL)); >>> >>> System.out.println("adding schema (OWL) to OntModel"); >>> >>> Infmodel.add(this.owl); >>> >>> System.out.println("adding data (RDF) to OntModel "); >>> >>> Infmodel.add(data.tdb); >>> >>> System.out.println("creting ModelExtractor "); >>> >>> ModelExtractor ext = new ModelExtractor(Infmodel); >>> >>> System.out.println("replacing OntModel by the Extracted Model"); >>> >>> dataset.replaceNamedModel(this.URL, ext.extractModel()); >>> >>> System.out.println("saving infead model"); >>> >>> Infmodel.close(); >>> >>> System.out.println("closing infeed dataset"); >>> >>> dataset.close(); >>> >>> >>> Please guys let me know what I should do. a couple of thing to say: >>> >>> I am using apache-jena-2.10.0 >>> also, when I run the reasoner on a small tab, it works perfectly. >>> >>> >>> >>> >> > > >-- >Adeeb Noor >Ph.D. Candidate >Dept of Computer Science >University of Colorado at Boulder >Cell: 571-484-3303 >Email: [email protected]
