On Fri, Sep 6, 2013 at 12:17 PM, Tom Emerson <[email protected]> wrote: > The output is very similar: you can see the output of vocab2jena here: > https://gist.github.com/TreeRex/6464149 > > The main difference is that I use use the ResourceFactory methods instead of > creating the static Model. And I don't use the * wildcard on the imports. > > So... I guess it would have behoved me to look at schemagen before I spent a > couple of hours writing my utility: it would have saved me the bother. I saw > the name in the docs and didn't connect it to what I needed. I should have > figured you guys would have done this already. :-/
Not "you guys", but "those guys"; I'm not a Jena developer. I've used a lot of schemagen with Jena though, and I'm always genuinely interested in code generation based on ontologies, so I was serious when I asked how the two compared. In my opinion, it's good that you used ResourceFactory, though. There's a StackOverflow question [1] about why some of the vocabulary classes use a model and some use a ResourceFactory. Ian Dickinson answered: "That both styles are used is just historical accident. I think these days, I'd probably suggest using theResourceFactory approach, simply because it avoids the (small) overhead of allocating a model, and the model gives you no real advantages. At some point, we'll probably go back and do some refactoring to just use a single approach in the Jena codebase." In the future, Jena's schemagen might produce results more like what your code produces. [1] http://stackoverflow.com/q/17701316/1281433 -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
