On 23/12/11 07:01, Ankit Verma wrote:
Hi Andy,
Can u pls help me in creating a new web application from scratch.
Secondly i am trying to import wordnet model but facing some error can u pls see
the below error.
Your error is:
> "java.io.FileNotFoundException: File not found on classpath:
> wordnet_glossary-20010201.rdf"
the code which i am using is
package test;
import java.io.*;
import com.hp.hpl.jena.db.*;
This is deprecated. It has been removed from jena 2.7.0. Use TDB if
you need to use a database at all. SDB is also a possibility.
import com.hp.hpl.jena.rdf.model.*;
readFileIntoModel(WN_GLOSSARY, wordnetModel);
private static void readFileIntoModel(String filename, Model model)
throws FileNotFoundException {
// Use the class loader to find the input file
InputStream in =
ImportWordnet.class.getClassLoader().getResourceAsStream(filename);
if (in == null) {
throw new FileNotFoundException("File not found on classpath: "+
filename);
}
Did you put the file on the classpath? It appears not.
Why not simply read it from the filing system?
FileManager.get().readModel(model, filename) ;
Andy