public static java.net.URI getNamedGraph(Object theObj) {
if (!hasNamedGraphSpecified(theObj)) {
return null;
}
NamedGraph aAnnotation = theObj.getClass().getAnnotation(NamedGraph.class);
if (aAnnotation.type() == NamedGraph.NamedGraphType.Instance) {
SupportsRdfId aId = asSupportsRdfId(theObj);
try {
return asURI(aId);
}
catch (URISyntaxException e) {
LOGGER.warn("There was an error trying to get the instance-level named graph URI from an object. Its key is not a URI.", e);
return null;
}
}
else {
return URI.create(aAnnotation.value());
}
}