Package org.aksw.jenax.graphql.sparql
Class GraphQlToSparqlConverter
java.lang.Object
org.aksw.jenax.graphql.sparql.GraphQlToSparqlConverter
Compiles a graphql query to a
GraphQlToSparqlMapping instance. All
fields can be qualified with IRIs of properties and classes. Names of
unqualified fields are passed to a GraphQlResolver for resolution to
IRIs. All resolver methods are allowed to throw
UnsupportedOperationException to indicate absence of resolution
support.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanfalse -> rdf mode, true -> json modeprotected GraphQlResolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertDocument(graphql.language.Document document, Map<String, graphql.language.Value<?>> assignments) static StringderiveFieldIri(Context context, String fieldName) static ScopedCardinalitygetCardinality(graphql.language.Directive d) Return a cardinality object if the directive is @one or @many - null if neither.static ScopedCardinalitygetCardinality(graphql.language.DirectivesContainer<?> container) Returns the last @one or @many directive - null if there is none.static voidprocessSparqlDirectives(Context cxt, GraphQlResolver resolver) static org.apache.jena.graph.NoderesolveClass(GraphQlResolver resolver, Context cxt, String fieldName) resolveKeyToClasses(NodeQuery nq, org.apache.jena.graph.Node cls) org.aksw.jenax.path.core.FacetPathresolveProperty(Context cxt, String fieldName) This method uses the context to resolve a field name to a relative facet pathstatic ContextsetupContext(Context cxt) Parses a GraphQL node's rdf annotations.static voidtryApplySlice(NodeQuery nodeQuery, com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, Map<String, graphql.language.Value<?>> assignments) static org.apache.jena.riot.system.PrefixMaptryGetPrefixMap(graphql.language.Value<?> value) static com.google.common.collect.Range<Long>tryParseSlice(com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, Map<String, graphql.language.Value<?>> assignments) Returns null if neither offset nor limit is foundstatic org.aksw.jenax.sparql.fragment.api.FragmenttryParseSparqlQuery(Context cxt, graphql.language.Directive dir, String argName)
-
Field Details
-
resolver
-
jsonMode
protected boolean jsonModefalse -> rdf mode, true -> json mode
-
-
Constructor Details
-
GraphQlToSparqlConverter
-
-
Method Details
-
convertDocument
public GraphQlToSparqlMapping convertDocument(graphql.language.Document document, Map<String, graphql.language.Value<?>> assignments) -
setupContext
Parses a GraphQL node's rdf annotations. -
deriveFieldIri
-
processSparqlDirectives
-
tryParseSparqlQuery
-
tryParseSlice
public static com.google.common.collect.Range<Long> tryParseSlice(com.google.common.collect.Multimap<String, graphql.language.Value<?>> args, Map<String, graphql.language.Value<?>> assignments) Returns null if neither offset nor limit is found -
resolveProperty
This method uses the context to resolve a field name to a relative facet path -
resolveClass
public static org.apache.jena.graph.Node resolveClass(GraphQlResolver resolver, Context cxt, String fieldName) -
resolveKeyToClasses
-
tryApplySlice
-
tryGetPrefixMap
public static org.apache.jena.riot.system.PrefixMap tryGetPrefixMap(graphql.language.Value<?> value) -
getCardinality
Returns the last @one or @many directive - null if there is none. -
getCardinality
Return a cardinality object if the directive is @one or @many - null if neither.
-