All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.ugent.rml.termgenerator.NamedNodeGenerator Maven / Gradle / Ivy

Go to download

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources.

There is a newer version: 7.2.0
Show newest version
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