Package org.aksw.jenax.graphql.sparql
Class GraphQlUtils
java.lang.Object
org.aksw.jenax.graphql.sparql.GraphQlUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic graphql.language.DocumentapplyTransform(graphql.language.Document doc, graphql.language.NodeVisitorStub visitor) static graphql.language.DirectiveexpectAtMostOneDirective(graphql.language.DirectivesContainer<?> container, String name) static graphql.language.ArgumentfindArgument(List<graphql.language.Argument> arguments, String name) static BooleangetArgAsBoolean(graphql.language.Directive directive, String argName) static BooleangetArgAsBoolean(graphql.language.Directive directive, String argName, Map<String, graphql.language.Value<?>> assignments) static LonggetArgAsLong(graphql.language.Field field, String name, Map<String, graphql.language.Value<?>> assignments) static LonggetArgAsLong(List<graphql.language.Argument> arguments, String name, Map<String, graphql.language.Value<?>> assignments) static StringgetArgAsString(graphql.language.Directive directive, String argName) getArgAsStrings(graphql.language.Directive directive, String argName) Expand strings to listsstatic graphql.language.Value<?>getArgumentValue(com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, String argName) static graphql.language.Value<?>getArgumentValue(com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, String argName, Map<String, graphql.language.Value<?>> assignments) static graphql.language.Value<?>getArgValue(graphql.language.Directive directive, String argName) static StringgetArgValueAsString(graphql.language.Directive directive, String argName, Map<String, graphql.language.Value<?>> assignments) static Longstatic Numberstatic Stringstatic graphql.language.Value<?>getValue(graphql.language.Argument arg) static com.google.common.collect.Multimap<String,graphql.language.Value<?>> indexArguments(graphql.language.Field field) static voidindexField(org.aksw.facete.v3.api.TreeDataMap<org.aksw.commons.path.core.Path<String>, graphql.language.Field> tree, org.aksw.commons.path.core.Path<String> path, graphql.language.Field field) static org.aksw.facete.v3.api.TreeDataMap<org.aksw.commons.path.core.Path<String>,graphql.language.Field> indexFields(graphql.language.SelectionSet selectionSet) static voidindexFields(org.aksw.facete.v3.api.TreeDataMap<org.aksw.commons.path.core.Path<String>, graphql.language.Field> tree, org.aksw.commons.path.core.Path<String> path, graphql.language.SelectionSet selection) static com.google.common.collect.Multimap<String,graphql.language.Value<?>> indexValues(graphql.language.ObjectValue field) static booleanisValidCharForFieldName(int ch) FIXME Update to the graphqls pecmapToGraphQl(Map<String, org.apache.jena.graph.Node> assignments) static graphql.language.Value<?>resolveValue(graphql.language.Value<?> value, Map<String, graphql.language.Value<?>> assignments) Resolves variable references once against the given map of assignments.static StringsafeFieldName(String name) Replaces any invalid char with '_' and returns null on empty stringstatic graphql.language.ArrayValuetoArrayValue(List<String> strs) static BooleantoBoolean(graphql.language.Node<?> node) static LongtoLong(graphql.language.Node<?> node) static org.apache.jena.sparql.expr.NodeValuetoNodeValue(graphql.language.Node<?> node) Bridge graphql nodes to jena NodeValues (the latter has a nicer API)static NumbertoNumber(graphql.language.Node<?> node) static graphql.language.ScalarValue<?>toScalarValue(org.apache.jena.sparql.expr.NodeValue nv) static StringtoString(graphql.language.Node<?> node) static Optional<graphql.language.Value<?>>tryGetArgumentValue(com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, String argName) static Optional<graphql.language.Node<?>>tryGetNode(graphql.language.Node<?> node, String... path)
-
Constructor Details
-
GraphQlUtils
public GraphQlUtils()
-
-
Method Details
-
isValidCharForFieldName
public static boolean isValidCharForFieldName(int ch) FIXME Update to the graphqls pec -
safeFieldName
Replaces any invalid char with '_' and returns null on empty string -
tryGetNode
-
getNumber
-
getLong
-
getString
-
toNodeValue
public static org.apache.jena.sparql.expr.NodeValue toNodeValue(graphql.language.Node<?> node) Bridge graphql nodes to jena NodeValues (the latter has a nicer API) -
toScalarValue
public static graphql.language.ScalarValue<?> toScalarValue(org.apache.jena.sparql.expr.NodeValue nv) -
getArgAsBoolean
-
getArgAsString
-
getArgAsStrings
Expand strings to lists -
toString
-
toBoolean
-
toNumber
-
toLong
-
indexArguments
public static com.google.common.collect.Multimap<String,graphql.language.Value<?>> indexArguments(graphql.language.Field field) -
indexValues
public static com.google.common.collect.Multimap<String,graphql.language.Value<?>> indexValues(graphql.language.ObjectValue field) -
getArgumentValue
-
getArgumentValue
-
tryGetArgumentValue
-
getValue
public static graphql.language.Value<?> getValue(graphql.language.Argument arg) -
indexFields
public static org.aksw.facete.v3.api.TreeDataMap<org.aksw.commons.path.core.Path<String>,graphql.language.Field> indexFields(graphql.language.SelectionSet selectionSet) -
indexFields
-
getArgAsLong
-
getArgAsLong
-
findArgument
-
getArgValue
public static graphql.language.Value<?> getArgValue(graphql.language.Directive directive, String argName) -
getArgValueAsString
-
getArgAsBoolean
-
indexField
-
resolveValue
public static graphql.language.Value<?> resolveValue(graphql.language.Value<?> value, Map<String, graphql.language.Value<?>> assignments) Resolves variable references once against the given map of assignments. Null if there is no assignment. -
mapToGraphQl
-
mapToJena
-
applyTransform
public static graphql.language.Document applyTransform(graphql.language.Document doc, graphql.language.NodeVisitorStub visitor) -
expectAtMostOneDirective
public static graphql.language.Directive expectAtMostOneDirective(graphql.language.DirectivesContainer<?> container, String name) -
toArrayValue
-