Samir, Andy already answered your question. Do you have a CLASSPATH set up that includes all the jars necessary for Jena? You may be using Eclipse, but you still need to set up the jar files to be included with the build. I am guessing you are new to Java and Eclipse?
-----Original Message----- From: Samir Hamitouche [mailto:[email protected]] Sent: Monday, August 12, 2013 10:23 AM To: [email protected] Cc: [email protected] Subject: Reading RDF/XML file with jena beguineer Hello, i write a small java program to read an XML/RDF file in my desktop using the IDE eclipse the jena library this is the program: import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Model; import java.io.PrintWriter; import java.util.Iterator; public class web1 { private String etudNS ="path .. /resDoc.rdf"; /** * @param args */ public static void main(String[] args) { web1 etudRDF = new web1(); } public void load() { Model model = ModelFactory.createDefaultModel(); model.read(etudNS); model.write(System.out); model.write (new PrintWriter(System.out)); } } when i compile i had this: $ javac web1.java web1.java:1: error: package com.hp.hpl.jena.rdf.model does not exist import com.hp.hpl.jena.rdf.model.ModelFactory; ^ web1.java:2: error: package com.hp.hpl.jena.rdf.model does not exist import com.hp.hpl.jena.rdf.model.Model; ^ web1.java:18: error: cannot find symbol Model model = ModelFactory.createDefaultModel(); ^ symbol: class Model location: class web1 web1.java:18: error: cannot find symbol Model model = ModelFactory.createDefaultModel(); ^ symbol: variable ModelFactory location: class web1 4 errors Anyone can help me Thank you Best regards Samir
