コード例 #1
0
  /**
   * Generate ski ontology
   *
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {

    JastorContext ctx = new JastorContext();
    ctx.addOntologyToGenerate(
        ReadWriteUtils.createSmartFileReader("src/test/resources/ski.owl"),
        "http://org.openanzo.rdf.jastor/testonts/Ski",
        "org.openanzo.rdf.jastor.test.ski");
    ctx.setUseStrictTypeChecking(true);
    JastorGenerator gen = new JastorGenerator(new File("src/test/java").getCanonicalFile(), ctx);
    gen.run();
  }
コード例 #2
0
ファイル: CommentTest.java プロジェクト: divDiff/Breakbulk
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   ctx = new JastorContext();
   ctx.addOntologyToGenerate(
       ReadWriteUtils.createSmartFileReader("src/test/resources/ski.owl"),
       "http://jastor.openanzo.org/testonts/Ski",
       "org.openanzo.rdf.jastor.test.ski");
   INamedGraph gm = ctx.getOntGraph();
   Class twintip = OWL11Factory.getClass("http://jastor.openanzo.org/testonts/classes#Ski", gm);
   classComment = OntologyComment.getOntologyComment(gm, twintip.resource());
   _Property manufacturer =
       OWL11Factory.getDatatypeProperty(
           "http://jastor.openanzo.org/testonts/predicates#manufacturer", gm);
   propComment = OntologyComment.getOntologyComment(gm, manufacturer.resource());
   Ontology pkg = ctx.listOntologiesToGenerate().get(0);
   pkgComment = pkg.getComment();
 }