01: package de.fzi.sioc.dev;
02:
03: import java.io.File;
04: import java.io.FileWriter;
05: import java.net.URL;
06:
07: import org.ontoware.rdf2go.Reasoning;
08: import org.ontoware.rdf2go.impl.jena24.IOUtils;
09: import org.ontoware.rdfreactor.generator.CodeGenerator;
10:
11: import com.hp.hpl.jena.rdf.model.Model;
12:
13: public class GenerateAPI {
14: public static void main(String[] args) throws Exception {
15:
16: URL url = new URL("http://rdfs.org/sioc/ns");
17: Model model = (Model) IOUtils.read(url)
18: .getUnderlyingModelImplementation();
19:
20: model.write(new FileWriter(new File(
21: "./src/main/resources/sioc.rdfs.xml")));
22: model.write(new FileWriter(new File(
23: "./src/main/resources/sioc.n3")), "N3");
24:
25: CodeGenerator.generate(model, new File("./src/main/java"),
26: "org.rdfs.sioc", Reasoning.rdfs, true, true, "Sioc");
27:
28: }
29: }
|