It would probably make more sense for me to go and tweak schemagen and submit a patch than to continue with vocab2jena, which I wrote really for the one purpose of generating the SKOS definitions and is undoubtedly useless for anything else. But... the code is there for people to look at. :-)
As far as the code generation goes, as simple as simple can be. Thanks for the feedback Joshua, I appreciate it. -tree On Fri, Sep 6, 2013 at 12:39 PM, Joshua TAYLOR <joshuaaa...@gmail.com>wrote: > On Fri, Sep 6, 2013 at 12:17 PM, Tom Emerson <tremer...@gmail.com> 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/ > -- Tom Emerson tremer...@gmail.com http://www.dreamersrealm.net/tree