Personality and related types are described briefly here: https://jena.apache.org/documentation/notes/jena-internals.html#enhanced-nodes
I know little about them, but to my understanding, that is not a well-developed part of Jena and the technical ideas there are not under active development. You are noticing that when you find the constructor odd and hard to fill; that's in part because it mixes Jena's API (Resource, Statement, Model, etc.) with its SPI (Node, Triple, Graph, etc.). Could you tell us a little more about what you are doing? Why do you want to extend Resource? ajs6f > On Apr 2, 2019, at 3:48 PM, Thomas Francart <[email protected]> wrote: > > Hello > > I would like to declare data structure with an Interface that extends Jena > Resource and its implementation that extends Jena ResourceImpl in the same > way as > https://github.com/TopQuadrant/shacl/blob/a3f54abeffc691ff0b15bee7f049741eb6e00878/src/main/java/org/topbraid/shacl/model/SHShape.java > (interface) and > https://github.com/TopQuadrant/shacl/blob/a3f54abeffc691ff0b15bee7f049741eb6e00878/src/main/java/org/topbraid/shacl/model/impl/SHShapeImpl.java > (implementation, which indirectly extends ResourceImpl). > Is it a common and good practice ? > > The constructor of the implementation takes as an input (Node node, > EnhGraph graph). > I don't know how to obtain or build these Node and EnhGraph from plain > Resource / Model I am used to. I will be working with memory or TDB-backed > Models, if that matters. How can I obtain or build these so that I can call > the constructor of my data structure extending ResourceImpl, with a Node > and EnhGraph instance ? > > I feel this could be related to "Personality<RDFNode>", as can be seen at > https://github.com/TopQuadrant/shacl/blob/76257beb501381542361b52363329999363753ff/src/main/java/org/topbraid/shacl/model/SHFactory.java, > where RDF classes URI are associated to the corresponding Java classes. > > I am lost here, could someone shed some light on this design pattern ? > > Thanks > Thomas > > -- > > *Thomas Francart* -* SPARNA* > Web de *données* | Architecture de l'*information* | Accès aux > *connaissances* > blog : blog.sparna.fr, site : sparna.fr, linkedin : > fr.linkedin.com/in/thomasfrancart > tel : +33 (0)6.71.11.25.97, skype : francartthomas
