import org.apache.any23.Any23;
import org.apache.any23.source.ByteArrayDocumentSource;
import org.apache.any23.source.DocumentSource;
import org.apache.any23.writer.TripleHandler;
import org.apache.any23.writer.TripleHandlerException;
import org.apache.any23.writer.TurtleWriter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class CSVUtilsExample {
public static void main(String[] args) throws IOException, TripleHandlerException {
String csvData = "name,age
John,25
Amy,30
";
Any23 any23 = new Any23();
ByteArrayOutputStream out = new ByteArrayOutputStream();
TripleHandler handler = new TurtleWriter(out);
DocumentSource source = new ByteArrayDocumentSource(csvData.getBytes(),"http://example.com/csv", "text/csv");
any23.extract(source, handler);
System.out.println(out.toString());
}
}