@Namespaces ignored when class in dependency
kpentchev opened this issue · 2 comments
I have defined several Entities and annotated these with @namespaces in a project:
@Entity
@Configurable
@Namespaces({"metadata","http://mydomain.com/resource/metadata","myd","http://mydomain.com/resource/"})
@RdfsClass("metadata:persisted_dataset")
public class PersistedDataset extends AbstractEntity
However, if I include these classes as a dependency to another project, the predefined namespaces are not recognized:
Caused by: org.openrdf.query.parser.sparql.ast.VisitorException: QName 'metadata:persisted_dataset' uses an undefined prefix
I use maven with the aspectj-maven-plugin to build the projects. I see some warning during startup, but I don't know how relevant these are, as empire obviously attempts to load the List of entities:
[INFO] --- aspectj-maven-plugin:1.0:compile (default) @ ROOT ---
[WARNING] this affected type is not exposed to the weaver: com.mydomain.persistence.PersistedDataset [Xlint
:typeNotExposedToWeaver]
These classes are fully functional when not used as a dependency.
Sounds like you are not initializing Empire properly. @namespaces annotations are read when Empire starts up, using the list of classes annotated w/ @RdfsClass as specified by the AnnotationProvider as the first place to look. It is probably the case that you're not correctly initializing the AnnotationProvider or are providing it w/ class names Empire cannot find.
Thank you for the quick response, it helped me find my error.