Closed m1ci closed 7 years ago
@m1ci on quick guess on top of my head, there should be a chance that you set the namespace on the repository level, i.e. something like repository.setNamespace("ex", "http://example.org/");
should work (but did not test).
Would you like to try and let me know?!
but it might not allow you, then doing the same around https://github.com/RMLio/RML-Processor/blob/master/src/main/java/be/ugent/mmlab/rml/dataset/StdRMLDataset.java#L42
and recompile might do the trick. Let me know if you try it.
@andimou thanks, we fixed it. Here is the code we use:
//Retrieve the Mapping Document
RMLDocRetrieval mapDocRetrieval = new RMLDocRetrieval();
Repository repository = mapDocRetrieval.getMappingDoc(mappingFile, RDFFormat.TURTLE);
//Extracting the RML Mapping Definitions
RMLEngine engine = new StdRMLEngine();
StdRMLMappingFactory mappingFactory = new StdRMLMappingFactory();
RMLMapping mapping = mappingFactory.extractRMLMapping(repository);
//Applying the RML Mapping
RMLDataset output = engine.chooseSesameDataSet("dataset", null, null);
output = engine.runRMLMapping(output, mapping, null, null, null);
try
{
output.getRepository().getConnection().setNamespace("dcterms", "http://purl.org/dc/terms/");
output.getRepository().getConnection().setNamespace("foaf", "http://xmlns.com/foaf/0.1/");
}
catch (RepositoryException ex) {
Logger.getLogger(TriplesEngine.class.getName()).log(Level.SEVERE, null, ex);
}
@andimou thanks, for the quick reply and the tips!
@AkbarKazimov I don't think that this is related to this issue. Could you create a new one for this?
@AkbarKazimov I don't think that this is related to this issue. Could you create a new one for this?
I found what I was looking for. thanks
Hi, how prefixes are handled in RML? We use RML in Java and in the output we dont get any prefix. Here is the code that we use:
can we somehow specify prefixes for the output? Thanks!