[
https://issues.apache.org/jira/browse/ANY23-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14103729#comment-14103729
]
Guangyuan Piao commented on ANY23-234:
--------------------------------------
--------------NQuadsWriter.java------------------
package org.apache.any23.writer;
import java.io.OutputStream;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.Rio;
/**
* Implementation of an <i>NQuads</i> writer.
*
* @author Michele Mostarda ([email protected])
*/
public class NQuadsWriter extends RDFWriterTripleHandler implements
FormatWriter {
public NQuadsWriter(OutputStream os) {
super( Rio.createWriter(RDFFormat.NQUADS, os) );
}
}
----------------Exception-----------------
Exception in thread "main" org.openrdf.rio.UnsupportedRDFormatException: No
writer factory available for RDF format N-Quads (mimeTypes=text/x-nquads;
ext=nq)
at org.openrdf.rio.Rio.createWriter(Rio.java:236)
at org.apache.any23.writer.NQuadsWriter.<init>(NQuadsWriter.java:33)
at mytest.main(mytest.java:45)
I thinks "Rio.createWriter(RDFFormat.NQUADS, os)" might be the problem..
> No writer factory available for RDF format N-Quads (mimeTypes=text/x-nquads;
> ext=nq)
> ------------------------------------------------------------------------------------
>
> Key: ANY23-234
> URL: https://issues.apache.org/jira/browse/ANY23-234
> Project: Apache Any23
> Issue Type: Bug
> Components: nquads
> Environment: Windows 8
> Reporter: Guangyuan Piao
> Labels: any23, nquads, writer
> Fix For: 1.1
>
>
> Exception in thread "main" org.openrdf.rio.UnsupportedRDFormatException: No
> writer factory available for RDF format N-Quads (mimeTypes=text/x-nquads;
> ext=nq)
> I got the exception with using nquads writer, is it possible to know why the
> exception happens or how to use nquads writer???
> HTTPClient httpClient = runner.getHTTPClient();
> DocumentSource source = new
> HTTPDocumentSource(httpClient,"http://guangyuan.dothome.co.kr");
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> // TripleHandler handler = new NTriplesWriter(out);
> TripleHandler handler = new NQuadsWriter(out);
> runner.extract(source, handler);
> handler.close();
> String n3 = out.toString("UTF-8");
> System.out.println(n3);
--
This message was sent by Atlassian JIRA
(v6.2#6252)