Results 1 to 2 of 2
- 03-25-2012, 02:47 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 3
- Rep Power
- 0
reading & parsing problem with rdf file which is approximately 1GB
Hello I am in trouble when I try to read geowordnet.rdf file with java when I use
InputStream in = FileManager.get().open(inputFileName);
but I can read it when I use following codes ;
f = new File ("geowordnetX.rdf");
long length = f.length();
long readedBytes = 0;
System.out.println(length);
try {
BufferedReader fr = new BufferedReader(new FileReader(f));
line = "";
while((fr.readLine().toString()) != null){
readedBytes += line.getBytes().length;
if(readedBytes > length){
break;
}else{
line += fr.readLine().toString() ;
System.out.println(line);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
But the problem is I can easily able to parse the rdf when file when I use first way Inputstream, Of course
I dont use whole file, instead I copy some info of rdf to another file and I can read it. Inputstream does not read
geowordnet because file size 700 Mb.
I can read whole file with second buffered way but this time it gives error when I try to parse it. The error is like that ;
Content is not allowed in prolog.
Exception in thread "main" com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHand ler.fatalError(RDFDefaultErrorHandler.java:45)
at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fa talError(ARPSaxErrorHandler.java:35)
at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XM LHandler.java:225)
I do not know how to solve ? do you have any idea please ?
thanks
- 03-27-2012, 02:21 AM #2
Re: reading & parsing problem with rdf file which is approximately 1GB
Don't double post. The other thread you started in Advanced Java with the identical same question has been removed.
Also, look around the FAQs section of this site and discover how to use code tags to preserve the formatting of your code.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
reading a file problem
By aianta in forum New To JavaReplies: 3Last Post: 08-03-2011, 07:22 PM -
Reading from file problem
By BillyB in forum New To JavaReplies: 10Last Post: 03-18-2011, 04:09 AM -
problem reading file
By jmoutia in forum New To JavaReplies: 0Last Post: 10-31-2010, 03:19 AM -
Problem reading from a file
By sarapeace in forum New To JavaReplies: 13Last Post: 10-03-2010, 02:08 PM -
Reg: File Reading Problem
By balaji csc in forum New To JavaReplies: 0Last Post: 11-06-2009, 04:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks