any23-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michele Mostarda <michele.mosta...@gmail.com>
Subject Re: Any23 class constructor
Date Wed, 08 Apr 2015 09:11:03 GMT
Dear Murick,
   in line 4

     final Any23 runner = new Any23(modifiableConf,"rdf-nt");

you're declaring an Any23 instance wich suppors only RDF Ntriples extractor.

You should instead specify the json-ld extractor if you consider to process
JSONLD only or even better activate all extractors simply specifying
nothing like:

     final Any23 runner = new Any23(modifiableConf);

Best
Michele


On 8 April 2015 at 03:55, Murick <murick@gmail.com> wrote:

> Hi Michele,
> Sorry for bothering you with questions, but I am stuck in the
> JSONLD-N-Triples conversion. As you recommended, I changed an input file
> extension to .jsonld. However, the file content doesn’t get converted.
> Here’s the code fragment. Thank you in advance.
>
>
> final ModifiableConfiguration modifiableConf =
> DefaultConfiguration.copy();
>     final ExtractionParameters extractionParameters =
> ExtractionParameters.getDefault();
>     extractionParameters.setFlag("any23.extraction.metadata.timesize",
> false); //REMOVE METADATA EXTRACTION
>     final Any23 runner = new Any23(modifiableConf,"rdf-nt");
>
>
> File myFile = new File(“input/myfile.jsonld”);
> DocumentSource source = new FileDocumentSource(myFile);
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> final TripleHandler writer = new NTriplesWriter(out);
>
> try
> {
> runner.extract(extractionParameters, source, writer);
> }
> finally
> {
> writer.close();
> }
> System.out.println(out.toString("UTF-8"));
>
>
> Best Regards,
> Imran Mammadli
>
>
>
>


-- 
Michele Mostarda
Senior Software Engineer
skype: michele.mostarda
twitter: micmos
mail: me@michelemostarda.com
site: http://michelemostarda.it

Mime
View raw message