Class SPARQL2GraphQLHelper
java.lang.Object
se.liu.ida.hefquin.engine.wrappers.graphql.utils.SPARQL2GraphQLHelper
Provides helper functions for creating the necessary data in a GraphQL query.
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GraphQL2RDFConfigurationprotected final Map<TriplePattern, StarPattern> protected final Map<org.apache.jena.graph.Node, StarPattern> protected final GraphQLSchema - 
Constructor Summary
ConstructorsConstructorDescriptionSPARQL2GraphQLHelper(GraphQL2RDFConfiguration config, GraphQLSchema schema, Map<org.apache.jena.graph.Node, StarPattern> indexedStarPatterns, Map<TriplePattern, StarPattern> connectors)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddEmptyObjectField(String currentPath, String sgpType, String predicateURI) Helper function to add a field to the query that represents a nested object that only needs an id field (no more recursive calls)addObjectField(StarPattern sp, String currentPath, String sgpType, String predicateURI) Helper function to add a field to the query that represents a nested object.protected StringaddScalarField(String currentPath, String predicateURI) Helper function to add a field to the query that represents a scalar valueaddSgp(StarPattern sp, String currentPath, String sgpType) Recursive function used to add fields from the triple patterns in a given star patternstatic booleanhasAllNecessaryArguments(Set<String> sgpArgumentNames, Set<String> entrypointArgumentNames) Check if @param sgpArgumentNames contains all argument name from @param entrypointArgumentNames.static booleanhasNecessaryArguments(Set<String> sgpArgumentNames, Set<String> entrypointArgumentNames) Check if @param sgpArgumentNames have atleast one match with @param entrypointArgumentNamesprotected static booleanHelper function which checks if any triple pattern predicate in @param sp is a variable or blank node, returns true if sostatic org.apache.jena.atlas.json.JsonValueliteralToJsonValue(org.apache.jena.graph.impl.LiteralLabel literal) Helper function used to convert a LiteralLabel value to a valid jsonvalueGenerates a GraphQL query that fetches everything from the GraphQL endpoint. 
- 
Field Details
- 
config
 - 
schema
 - 
indexedStarPatterns
 - 
connectors
 
 - 
 - 
Constructor Details
- 
SPARQL2GraphQLHelper
public SPARQL2GraphQLHelper(GraphQL2RDFConfiguration config, GraphQLSchema schema, Map<org.apache.jena.graph.Node, StarPattern> indexedStarPatterns, Map<TriplePattern, StarPattern> connectors)  
 - 
 - 
Method Details
- 
materializeAll
Generates a GraphQL query that fetches everything from the GraphQL endpoint. - 
addSgp
Recursive function used to add fields from the triple patterns in a given star pattern - 
addObjectField
 - 
addEmptyObjectField
 - 
addScalarField
 - 
hasVariablePredicate
Helper function which checks if any triple pattern predicate in @param sp is a variable or blank node, returns true if so - 
hasNecessaryArguments
 - 
hasAllNecessaryArguments
 - 
literalToJsonValue
public static org.apache.jena.atlas.json.JsonValue literalToJsonValue(org.apache.jena.graph.impl.LiteralLabel literal) Helper function used to convert a LiteralLabel value to a valid jsonvalue 
 -