From: Tim P. <ti...@pa...> - 2010-01-20 12:44:10
|
Hi Riccardo, I have done a fresh checkout. I use Maven to build ng4j. Editted pom.xml to use 2.6.0 for jena and jenatest.. then executed: mvn install However the connection to the jena repository timed out. As you probably know there have been some upheavals in the jena ecosystem. I changed the repository location to http://openjena.org/repo/ (not strictly necessary as these are mirrored) This resulted in: INFO] Compilation failure /home/timp/workspace/ng4j/src/de/fuberlin/wiwiss/ng4j/trix/TriXReader.java:[162,35] com.hp.hpl.jena.graph.impl.LiteralLabel is abstract; cannot be instantiated /home/timp/workspace/ng4j/src/de/fuberlin/wiwiss/ng4j/trix/TriXReader.java:[172,35] com.hp.hpl.jena.graph.impl.LiteralLabel is abstract; cannot be instantiated /home/timp/workspace/ng4j/src/de/fuberlin/wiwiss/ng4j/trix/TriXReaderWithExtensions.java:[168,35] com.hp.hpl.jena.graph.impl.LiteralLabel is abstract; cannot be instantiated /home/timp/workspace/ng4j/src/de/fuberlin/wiwiss/ng4j/trix/TriXReaderWithExtensions.java:[178,35] com.hp.hpl.jena.graph.impl.LiteralLabel is abstract; cannot be instantiated which is the same problem as you. I then did mvn -DdownloadJavadocs=true -DdownloadSources=true eclipse:clean eclipse:eclipse which creates a new set of eclipse configuration files. In TriXReader substitute: public void objectPlainLiteral(String value, String lang) { LiteralLabel ll = LiteralLabelFactory.create(value, lang); this.object = Node.createLiteral(ll); addTriple(); } public void objectTypedLiteral(String value, String datatypeURI) { // No idea what that line does, is copy&paste from ModelCom.createTypedLiteral RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(datatypeURI); LiteralLabel ll = LiteralLabelFactory.createLiteralLabel( value, "", dt ); this.object = Node.createLiteral(ll); addTriple(); } In TriXReaderWithExtensions we do the same (cut and paste issues :( ) public void objectPlainLiteral(String value, String lang) { LiteralLabel ll = LiteralLabelFactory.create(value, lang); this.object = Node.createLiteral(ll); addTriple(); } public void objectTypedLiteral(String value, String datatypeURI) { // No idea what that line does, is copy&paste from ModelCom.createTypedLiteral RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(datatypeURI); LiteralLabel ll = LiteralLabelFactory.createLiteralLabel( value, "", dt ); this.object = Node.createLiteral(ll); addTriple(); } This gets us working with Eclipse and Maven. Shall I commit these changes? cheers Tim 2010/1/18 Riccardo Tasso wrote: > Hi Tim, > I've just imported NG4J 0.9.2 sourcecode as an Eclipse project and changed > every library referring to jena 2.6.0 in the corresponding jena 2.6.2. > I have 4 errors (of the same type fortunately). Two of them in the class > de.fuberlin.wiwiss.ng4j.trix.TriXReader (lines 162 and 172) and two in the > class de.fuberlin.wiwiss.ng4j.trix.TriXReaderWithExtensions (lines 168 and > 178). > > The error is in the instructions: > new LiteralLabel(value, lang); > new LiteralLabel(value, null, dt); > and the report is: > "Cannot instantiate the type LiteralLabel" > > Can you help me in solving this issue? > Thank you, > Riccardo > |