it.unibz.inf.ontop.rdf4j.predefined.parsing.impl.ParsedPredefinedQueryConfigEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontop-rdf4j Show documentation
Show all versions of ontop-rdf4j Show documentation
This is the rdf4j API implementation based on Ontop
The newest version!
package it.unibz.inf.ontop.rdf4j.predefined.parsing.impl;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import it.unibz.inf.ontop.model.vocabulary.XSD;
import it.unibz.inf.ontop.rdf4j.predefined.parsing.PredefinedQueryConfigEntry;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.Query;
import java.util.Map;
import java.util.Optional;
import static it.unibz.inf.ontop.rdf4j.predefined.parsing.PredefinedQueryConfigEntry.QueryParameterCategory.IRI;
import static it.unibz.inf.ontop.rdf4j.predefined.parsing.PredefinedQueryConfigEntry.QueryParameterCategory.TYPED_LITERAL;
/**
* TODO: enforce required (shall we use @JsonCreator?)
*/
public class ParsedPredefinedQueryConfigEntry implements PredefinedQueryConfigEntry {
@JsonProperty(value = "queryType", required = true)
private String queryTypeString;
// LAZY
private Query.QueryType queryType;
@JsonProperty(value = "name", required = false)
private String name;
@JsonProperty(value = "description", required = false)
private String description;
@JsonProperty(value = "frame", required = false)
private Map frame;
@JsonProperty(value = "parameters", required = true)
private Map parameters;
// LAZY
private ImmutableMap typedParameters;
@JsonProperty(value = "return404IfEmpty", required = false)
private Boolean return404IfEmpty;
@JsonProperty(value = "resultStreaming", required = false)
private Boolean resultStreaming;
@Override
public Query.QueryType getQueryType() {
if (queryType == null)
queryType = Query.QueryType.valueOf(queryTypeString.toUpperCase());
return queryType;
}
@Override
public Optional getName() {
return Optional.ofNullable(name);
}
@Override
public Optional getDescription() {
return Optional.ofNullable(description);
}
@Override
public Optional
© 2015 - 2024 Weber Informatics LLC | Privacy Policy