
be.ugent.rml.records.JSONRecord Maven / Gradle / Ivy
package be.ugent.rml.records;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.JsonPathException;
import net.minidev.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
/**
* This class is a specific implementation of a record for JSON.
* Every record corresponds with a JSON object in a data source.
*/
public class JSONRecord extends Record {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
private final String path;
private final Object document;
public JSONRecord(Object document, String path) {
this.path = path;
this.document = document;
}
/**
* This method returns the objects for a reference (JSONPath) in the record.
* @param value the reference for which objects need to be returned.
* @return a list of objects for the reference.
*/
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy