
be.ugent.rml.termgenerator.NamedNodeGenerator Maven / Gradle / Ivy
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