[ 
https://issues.apache.org/jira/browse/ANY23-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301874#comment-14301874
 ] 

Souri commented on ANY23-248:
-----------------------------

Actually, if I set a dummy url as uri, then the local run passes and generates 
output. But doing the same thing on hadoop gives me this error :

org.openrdf.rio.UnsupportedRDFormatException: No parser factory available for 
RDF format RDFa (mimeTypes=application/xhtml+xml, application/html, text/html; 
ext=xhtml, html)
        at org.openrdf.rio.Rio.createParser(Rio.java:198)
        at 
org.apache.any23.extractor.rdf.RDFParserFactory.getRDFa11Parser(RDFParserFactory.java:119)
        at 
org.apache.any23.extractor.rdfa.RDFa11Extractor.getParser(RDFa11Extractor.java:50)
        at 
org.apache.any23.extractor.rdf.BaseRDFExtractor.run(BaseRDFExtractor.java:93)
        at 
org.apache.any23.extractor.rdf.BaseRDFExtractor.run(BaseRDFExtractor.java:41)
        at 
org.apache.any23.extractor.SingleDocumentExtraction.runExtractor(SingleDocumentExtraction.java:462)
        at 
org.apache.any23.extractor.SingleDocumentExtraction.run(SingleDocumentExtraction.java:254)
        at org.apache.any23.Any23.extract(Any23.java:298)

Is there a way we can set the MIME type of a document?

> NTriplesWriter on hadoop : issue with MIME type
> -----------------------------------------------
>
>                 Key: ANY23-248
>                 URL: https://issues.apache.org/jira/browse/ANY23-248
>             Project: Apache Any23
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: hadoop,linux
>            Reporter: Souri
>            Priority: Minor
>             Fix For: 1.2
>
>
> I am trying to create n-triples from an html string. I am using the following 
> code to do it:
> StringDocumentSource documentSource = new StringDocumentSource(html, null);
>             ByteArrayOutputStream out = new ByteArrayOutputStream();
>             final NTriplesWriter tripleHandler = new NTriplesWriter(out);
>             Any23 runner = new Any23();
>            
>             runner.extract(documentSource,tripleHandler);
>             tripleHandler.close();
>             String result = out.toString("us-ascii");
>             return result;
> This is giving me the error :
> java.lang.NullPointerException
>       at 
> org.apache.any23.extractor.SingleDocumentExtraction.filterExtractorsByMIMEType(SingleDocumentExtraction.java:421)
>       at 
> org.apache.any23.extractor.SingleDocumentExtraction.run(SingleDocumentExtraction.java:223)
>       at org.apache.any23.Any23.extract(Any23.java:298)
>       at org.apache.any23.Any23.extract(Any23.java:433)
> I am running this in hadoop. When I run locally with a single file it works, 
> but doesn't work when run on hadoop.
> Can someone please tell me how to go about this issue?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to