jopa icon indicating copy to clipboard operation
jopa copied to clipboard

Allow static declaration of entity/attribute context via an annotation

Open ledsoft opened this issue 3 years ago • 0 comments

As a developer, I often store entities of a certain type in the same repository context (RDF named graph). However, currently, this has to be configured at runtime using descriptors. It would be nice to be able to define the context statically via an annotation and let JOPA take care of building the appropriate descriptor at runtime.

Example usage:

@OWLClass(iri = "ex:change-record")
@Context("ex:change-tracking")
public class ChangeRecord {
    @Id
    private URI uri;

    @Context("ex:users")
    @OWLObjectProperty(iri = "dc:creator")
    private User author;

    // Other attributes, getters, setters
}

The above example would store all ChangeRecord data in the ex:change-tracking context and would connect each record to a user stored in the ex:users context.

ledsoft avatar Feb 14 '22 15:02 ledsoft