Class GraphQlToSparqlConverterBase<K>
java.lang.Object
graphql.language.NodeVisitorStub
org.aksw.jenax.graphql.sparql.v2.rewrite.GraphQlToSparqlConverterBase<K>
- All Implemented Interfaces:
graphql.language.NodeVisitor
- Direct Known Subclasses:
GraphQlToSparqlConverterJson,GraphQlToSparqlConverterRon
public abstract class GraphQlToSparqlConverterBase<K>
extends graphql.language.NodeVisitorStub
Checks for @pattern directives.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CardinalityDirectiveprotected RewriteResult<K>protected SchemaNavigator -
Constructor Summary
ConstructorsConstructorDescriptionGraphQlToSparqlConverterBase(Map<String, graphql.language.FragmentDefinition> nameToFragment, SchemaNavigator schemaNavigator) -
Method Summary
Modifier and TypeMethodDescriptionstatic ElementTransformconvert(GraphDirective graph) Create an ElementTransform according to the specification of a GraphDirective instance.graphql.util.TraversalControlenterField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) graphql.util.TraversalControlenterQuery(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) protected AggStateBuilder<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> getAggResult(graphql.util.TraverserContext<graphql.language.Node> context) protected AggStateBuilderTransitionBase<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> getAggTransition(graphql.util.TraverserContext<graphql.language.Node> context) protected org.apache.jena.graph.NodeglobalIdToSparql(String globalId) graphql.util.TraversalControlleaveField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) graphql.util.TraversalControlleaveQuery(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) static CardinalityDirectiveprocessCardinality(graphql.language.DirectivesContainer<?> directives, graphql.util.TraverserContext<graphql.language.Node> context) Get the effective cardinality; publish cascading cardinalities to the context.voidprocessFieldOnEnter(graphql.language.Node<?> node, String nodeName, List<graphql.language.Argument> arguments, graphql.language.DirectivesContainer<?> directives, graphql.language.SelectionSet selectionSet, graphql.util.TraverserContext<graphql.language.Node> context) static GraphDirectiveprocessGraph(graphql.language.DirectivesContainer<?> field, graphql.util.TraverserContext<graphql.language.Node> context) Returns a graph directive present on the current field.readStateId(graphql.language.DirectivesContainer<?> directives) protected voidsetAggResult(graphql.util.TraverserContext<graphql.language.Node> context, AggStateBuilder<org.apache.jena.sparql.engine.binding.Binding, org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> aggStateBuilder) protected voidsetAggTransition(graphql.util.TraverserContext<graphql.language.Node> context, AggStateBuilderTransitionBase<org.apache.jena.sparql.engine.binding.Binding, org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> aggStateBuilder) protected abstract KtoKey(graphql.language.Field field) protected abstract KtoKey(org.apache.jena.graph.Node node) graphql.util.TraversalControlvisitDocument(graphql.language.Document node, graphql.util.TraverserContext<graphql.language.Node> context) graphql.util.TraversalControlvisitField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) graphql.util.TraversalControlvisitFragmentSpread(graphql.language.FragmentSpread node, graphql.util.TraverserContext<graphql.language.Node> context) graphql.util.TraversalControlvisitInlineFragment(graphql.language.InlineFragment node, graphql.util.TraverserContext<graphql.language.Node> context) The main conceptual difference between conventional fields and inline fragments is in the latter case the inline fragment overrides the join for the children.graphql.util.TraversalControlvisitOperationDefinition(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) Methods inherited from class graphql.language.NodeVisitorStub
visitArgument, visitArrayValue, visitBooleanValue, visitDefinition, visitDirective, visitDirectiveDefinition, visitDirectiveLocation, visitEnumTypeDefinition, visitEnumValue, visitEnumValueDefinition, visitFieldDefinition, visitFloatValue, visitFragmentDefinition, visitInputObjectTypeDefinition, visitInputValueDefinition, visitInterfaceTypeDefinition, visitIntValue, visitListType, visitNode, visitNonNullType, visitNullValue, visitObjectField, visitObjectTypeDefinition, visitObjectValue, visitOperationTypeDefinition, visitScalarTypeDefinition, visitSchemaDefinition, visitSelection, visitSelectionSet, visitStringValue, visitType, visitTypeDefinition, visitTypeName, visitUnionTypeDefinition, visitValue, visitVariableDefinition, visitVariableReference
-
Field Details
-
DFT_CARDINALITY
-
nameToFragment
-
rewriteResult
-
-
Constructor Details
-
Method Details
-
getRewriteResult
-
toKey
-
toKey
-
globalIdToSparql
-
visitField
public graphql.util.TraversalControl visitField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) - Specified by:
visitFieldin interfacegraphql.language.NodeVisitor- Overrides:
visitFieldin classgraphql.language.NodeVisitorStub
-
readStateId
-
enterQuery
public graphql.util.TraversalControl enterQuery(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) -
leaveQuery
public graphql.util.TraversalControl leaveQuery(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) -
visitOperationDefinition
public graphql.util.TraversalControl visitOperationDefinition(graphql.language.OperationDefinition node, graphql.util.TraverserContext<graphql.language.Node> context) - Specified by:
visitOperationDefinitionin interfacegraphql.language.NodeVisitor- Overrides:
visitOperationDefinitionin classgraphql.language.NodeVisitorStub
-
visitDocument
public graphql.util.TraversalControl visitDocument(graphql.language.Document node, graphql.util.TraverserContext<graphql.language.Node> context) - Specified by:
visitDocumentin interfacegraphql.language.NodeVisitor- Overrides:
visitDocumentin classgraphql.language.NodeVisitorStub
-
enterField
public graphql.util.TraversalControl enterField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) -
processFieldOnEnter
-
leaveField
public graphql.util.TraversalControl leaveField(graphql.language.Field field, graphql.util.TraverserContext<graphql.language.Node> context) -
visitInlineFragment
public graphql.util.TraversalControl visitInlineFragment(graphql.language.InlineFragment node, graphql.util.TraverserContext<graphql.language.Node> context) The main conceptual difference between conventional fields and inline fragments is in the latter case the inline fragment overrides the join for the children. The condition can access all variables declared in the parent.- Creates a separate ElementNode with the condition.
- Inherits all variables of the parent
- Specified by:
visitInlineFragmentin interfacegraphql.language.NodeVisitor- Overrides:
visitInlineFragmentin classgraphql.language.NodeVisitorStub
-
setAggTransition
protected void setAggTransition(graphql.util.TraverserContext<graphql.language.Node> context, AggStateBuilderTransitionBase<org.apache.jena.sparql.engine.binding.Binding, org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> aggStateBuilder) -
getAggTransition
protected AggStateBuilderTransitionBase<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv, getAggTransitionK, org.apache.jena.graph.Node> (graphql.util.TraverserContext<graphql.language.Node> context) -
setAggResult
protected void setAggResult(graphql.util.TraverserContext<graphql.language.Node> context, AggStateBuilder<org.apache.jena.sparql.engine.binding.Binding, org.apache.jena.sparql.function.FunctionEnv, K, org.apache.jena.graph.Node> aggStateBuilder) -
getAggResult
protected AggStateBuilder<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv, getAggResultK, org.apache.jena.graph.Node> (graphql.util.TraverserContext<graphql.language.Node> context) -
visitFragmentSpread
public graphql.util.TraversalControl visitFragmentSpread(graphql.language.FragmentSpread node, graphql.util.TraverserContext<graphql.language.Node> context) - Specified by:
visitFragmentSpreadin interfacegraphql.language.NodeVisitor- Overrides:
visitFragmentSpreadin classgraphql.language.NodeVisitorStub
-
processCardinality
public static CardinalityDirective processCardinality(graphql.language.DirectivesContainer<?> directives, graphql.util.TraverserContext<graphql.language.Node> context) Get the effective cardinality; publish cascading cardinalities to the context. -
processGraph
public static GraphDirective processGraph(graphql.language.DirectivesContainer<?> field, graphql.util.TraverserContext<graphql.language.Node> context) Returns a graph directive present on the current field. Also registers such present directive at the context for reference. Note: Only directives present on the current field are relevant for processing because only from those are ElementTransforms created. -
convert
Create an ElementTransform according to the specification of a GraphDirective instance.
-