001package org.w3.ldp.testsuite.util;
002
003import java.io.FileInputStream;
004import java.io.FileNotFoundException;
005import java.io.FileOutputStream;
006
007import com.hp.hpl.jena.rdf.model.Model;
008import com.hp.hpl.jena.rdf.model.ModelFactory;
009
010public class Convert {
011        public static void main(String[] args) {
012                String fileName = args[0];
013
014                Model in = ModelFactory.createDefaultModel();
015                try {
016                        in.read(new FileInputStream(fileName), null, "TURTLE");
017                        fileName = fileName.substring(0, fileName.length()-3)+"jsonld";
018                        System.out.println("Writing to file: "+fileName);
019                        in.write(new FileOutputStream(fileName), "JSON-LD");
020                } catch (FileNotFoundException e) {
021                        e.printStackTrace();
022                }
023        }
024}