use of nl.knaw.huygens.timbuctoo.rml.rmldata.builders.MappingDocumentBuilder in project timbuctoo by HuygensING.
the class JenaBasedReader method fromRdf.
public RmlMappingDocument fromRdf(Model data, Function<RdfResource, Optional<DataSource>> dataSourceFactory) {
ResIterator tripleMaps = data.listSubjectsWithProperty(data.createProperty(NS_RR + "subjectMap"));
MappingDocumentBuilder resultBuilder = rmlMappingDocument();
try {
while (tripleMaps.hasNext()) {
Resource resource = tripleMaps.nextResource();
buildTripleMap(JenaResource.fromModel(data, resource), resultBuilder.withTripleMap(resource.getURI()));
}
} finally {
tripleMaps.close();
}
return resultBuilder.build(dataSourceFactory);
}
Aggregations