我想在芝麻和eclipes之间建立联系,这是我的代码:
public static void main(String[] args) {
Repository repository = new SailRepository(new MemoryStore());
repository.initialize();
File ff = new File("C:\\Users\\admin\\Desktop\\samia.rdf");
repository.getConnection().add(ff
, RDF.NAMESPACE ,
RDFFormat.forFileName(ff.getName())
);
repository.getConnection().export(new RDFXMLWriter(new FileOutputStream("C:\\Users\\admin\\Desktop\\samia.rdf")));
Repository sesameServer = new HTTPRepository("http://localhost:8080/openrdf-workbench/repositories/Test/summary","Test");
sesameServer.initialize();
Repository dbpedia = new HTTPRepository("http://dbpedia.org/sparql");
dbpedia.initialize();
}
我在.add和.export中有2个错误,错误是:
方法add(Statement,Resource [])在类型中 RepositoryConnection不适用于参数(File, String,RDFFormat)
类型中的方法导出(RDFHandler,Resource []) RepositoryConnection不适用于参数 (RDFXMLWriter)
请帮帮我。谢谢你的帮助