be.ugent.rml.termgenerator.NamedNodeGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rmlmapper Show documentation
Show all versions of rmlmapper Show documentation
The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources.
package be.ugent.rml.termgenerator;
import be.ugent.rml.functions.FunctionUtils;
import be.ugent.rml.functions.SingleRecordFunctionExecutor;
import be.ugent.rml.records.Record;
import be.ugent.rml.term.NamedNode;
import be.ugent.rml.term.Term;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class NamedNodeGenerator extends TermGenerator {
public NamedNodeGenerator(SingleRecordFunctionExecutor functionExecutor) {
super(functionExecutor);
}
@Override
public List generate(Record record) throws Exception {
List objectStrings = new ArrayList<>();
FunctionUtils.functionObjectToList(functionExecutor.execute(record), objectStrings);
ArrayList objects = new ArrayList<>();
if (objectStrings.size() > 0) {
for (String object : objectStrings) {
//todo check valid IRI
objects.add(new NamedNode(object));
}
}
return objects;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy