Hello
I'm trying to connect the jena serializers to a service that delivers
curie-prefix suggestions for uri-prefixes.
My fisrt attempt doesn't seem to work:
Model model = ModelFactory.createModelForGraph(graph);
model.setNsPrefixes(new PrefixMappingImpl() {
@Override
protected String get(String prefix) {
System.out.println("getting "+prefix);
return super.get(prefix);
}
@Override
public String getNsURIPrefix(String uri) {
System.out.println("getting prefix for "+uri);
if ("http://example.org/".equals(uri)) {
return "ex";
}
return null;
}
});
RDFWriter writer = model.getWriter(jenaFormat);
writer.write(model, serializedGraph, "");
the overwritten methods seem not be called. The examples I found all deal
with registering individual prefix-mappings, in my case I want to access a
service that suggests a prefix.
Cheers,
Reto