Package org.apache.jena.query
Class ARQ
- java.lang.Object
-
- org.apache.jena.query.ARQ
-
public class ARQ extends java.lang.ObjectARQ - miscellaneous settings
-
-
Field Summary
Fields Modifier and Type Field Description static booleanallowDuplicateSelectColumnsIndicate whether duplicate select and groupby variables are allowed.static java.lang.StringarqIRIIRI for ARQstatic java.lang.StringarqParamNSRoot of ARQ-defined parameter namesstatic java.lang.StringarqSymbolPrefixPrefix for ARQ-defined parameter namesstatic java.lang.StringBUILD_DATEThe date and time at which this release was builtstatic SymbolconstantBNodeLabelsControls bNode labels as <_:...> or not - that is a pseudo URIs.static SymbolenableExecutionTimeLoggingEnable logging of execution timing.static SymbolenablePropertyFunctionsEnable built-in property functions - also called "magic properties".static SymbolextensionValueTypesExpression evaluation without extension types (e.g.static SymbolfixupUndefinedPrefixesIf set to true, the parsers will convert undefined prefixes to a URI according to the fixup functionRiotLib.fixupPrefixes.static SymbolgenerateToListGenerate the ToList operation in the algebra (as ARQ is stream based, ToList is a non-op).static SymbolhideNonDistiguishedVariablesContext key to control hiding non-distinuished variablesstatic SymbolinputGraphBNodeLabelsIf true, XML result sets will use the bNode label in the result set itself.static SymboljavaRegexSymbol to name java.util.regex regular expression enginestatic java.lang.StringlogExecNameName of the execution loggerstatic java.lang.StringlogHttpRequestNameName of the logger for remote HTTP requestsstatic java.lang.StringlogInfoNameName of the information loggerstatic java.lang.StringNAMEThe product namestatic SymboloptDistinctToReducedContext key controlling whether a DISTINCT-ORDER BY query is done by replacing the distinct with a reduced.static SymboloptExprConstantFoldingContext key controlling whether the standard optimizer applies constant folding to expressionsstatic SymboloptFilterConjunctionContext key controlling whether the standard optimizer applies optimizations to conjunctions (&&) in filters.static SymboloptFilterDisjunctionContext key controlling whether the standard optimizer applies optimizations to disjunctions (||) in filters.static SymboloptFilterEqualityContext key controlling whether the standard optimizer applies optimizations to equalities in FILTERs.static SymboloptFilterExpandOneOfContext key controlling whether the standard optimizer applies optimizations to IN and NOT IN.static SymboloptFilterImplicitJoinContext key controlling whether the standard optimizer applies optimizations to implicit joins in FILTERs.static SymboloptFilterInequalityContext key controlling whether the standard optimizer applies optimizations to inequalities in FILTERs This optimization is conservative - it does not take place if there is a potential risk of changing query semanticsstatic SymboloptFilterPlacementContext key controlling whether the main query engine moves filters to the "best" place.static SymboloptFilterPlacementBGPContext key controlling whether to do filter placement within BGP and quad blocks.static SymboloptFilterPlacementConservativeContext key controlling whether the main query engine moves filters to the "best" place using the more limited and conservative strategy which does not place as many filters Must be explicitly set "true" to operate.static SymboloptimizationContext key controlling whether the main query engine applies the default optimization transformations.static SymboloptImplicitLeftJoinContext key controlling whether the standard optimizer applies optimizations to implicit left joins.static SymboloptIndexJoinStrategyContext key controlling whether the standard optimizer applies optimizations to the evaluation of joins to favour index joins wherever possiblestatic SymboloptInlineAssignmentsContext key controlling whether the standard optimizer applies optimizations where by some assignments may be eliminated/inlined into the operators where their values are used only oncestatic SymboloptInlineAssignmentsAggressiveContext key controlling whether the standard optimizer aggressively inlines assignments whose values are used only once into operators where those expressions may be evaluated multiple times e.g.static SymboloptMergeBGPsContext key controlling whether the standard optimizater applies optimizations to joined BGPs to merge them into single BGPs.static SymboloptMergeExtendsContext key controlling whether the standard optimizer applies the optimization to combine stacks of (extend) into one compound operation.static SymboloptOrderByDistinctApplicationContext key controlling whether a DISTINCT-ORDER BY query is done by applying the ORDER BY after the DISTINCT when default SPARQL semantics usually mean ORDER BY applies before DISTINCT.static SymboloptPathFlattenContext key controlling whether the main query engine flattens simple paths (e.g.static SymboloptPromoteTableEmptyContext key controlling whether the standard optimizer applies table empty promotionstatic SymboloptReorderBGPContext key controlling whether the standard optimizer applies the optimization to reorder basic graph patterns.static SymboloptTopNSortingContext key controlling whether an ORDER BY-LIMIT query is done avoiding total sort using an heap.static SymboloutputGraphBNodeLabelsIf true, XML result sets written will contain the graph bNode label See also inputGraphBNodeLabelsstatic java.lang.StringPATHThe root package name for ARQstatic SymbolpropertyFunctionsContext key controlling whether the main query engine processes property functions.static SymbolqueryTimeoutSet timeout.static SymbolregexImplDetermine which regular expression system to use.static SymbolserviceAllowedControl whether SERVICE processing is allowed.static SymbolserviceParamsUse this Symbol to allow passing additional query parameters to a SERVICE <IRI> call.static SymbolspillToDiskThresholdA Long value that specifies the number of bindings (or triples for CONSTRUCT queries) to be stored in memory by sort operations or hash tables before switching to temporary disk files.static SymbolstageGeneratorContext key for StageBuilder used in BGP compilationstatic SymbolstrictSPARQLStick exactly to the spec.static SymbolsymJavaScriptFunctionsContext symbol for JavaScript functions as a string value which is evaluated.static SymbolsymJavaScriptLibFileContext symbol for JavaScript library of functions defined in a file.static SymbolsymLogExecSymbol to enable logging of execution.static SymboltopNSortingThresholdThreshold for doing a top N sort for ORDER-LIMIT.static SymboluseSAXUse the SAX parser for XML result sets.static java.lang.StringVERSIONThe full name of the current ARQ versionstatic SymbolxercesRegexSymbol to name the Xerces-J regular expression engine
-
Constructor Summary
Constructors Constructor Description ARQ()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidenableBlankNodeResultLabels()Turn on processing of blank node labels in queriesstatic voidenableBlankNodeResultLabels(boolean val)Turn on/off processing of blank node labels in queriesstatic voidenableOptimizer(boolean state)Globally switch the default optimizer on and off : Note that storage subsystems may also be applying separately controlled optimizations.static voidenableOptimizer(Context context, boolean state)Switch the default optimizer on and off for a specific Context.static ContextgetContext()static org.slf4j.LoggergetExecLogger()The execution loggerstatic Explain.InfoLevelgetExecutionLogging()Get the currently global execution logging settingstatic org.slf4j.LoggergetHttpRequestLogger()The HTTP Request loggerstatic org.slf4j.LoggergetInfoLogger()The information loggerstatic voidinit()static booleanisFalse(Symbol symbol)static booleanisFalseOrUndef(Symbol symbol)static booleanisStrictMode()static booleanisTrue(Symbol symbol)static booleanisTrueOrUndef(Symbol symbol)static voidset(Symbol symbol, boolean value)static voidsetExecutionLogging(Explain.InfoLevel infoLevel)Set execution logging - logging is to logger "org.apache.jena.arq.exec" at level INFO.static voidsetFalse(Symbol symbol)static voidsetNormalMode()Set normal mode, including expression evaluationstatic voidsetNormalMode(Context context)Explicitly set the values for normal operation.static voidsetStrictMode()Set strict mode, including expression evaluationstatic voidsetStrictMode(Context context)Set strict mode for a given Context.static voidsetTrue(Symbol symbol)static voidunset(Symbol symbol)
-
-
-
Field Detail
-
logExecName
public static final java.lang.String logExecName
Name of the execution logger- See Also:
- Constant Field Values
-
logInfoName
public static final java.lang.String logInfoName
Name of the information logger- See Also:
- Constant Field Values
-
logHttpRequestName
public static final java.lang.String logHttpRequestName
Name of the logger for remote HTTP requests- See Also:
- Constant Field Values
-
symLogExec
public static final Symbol symLogExec
Symbol to enable logging of execution. Must also set log4j, or other logging system, for logger "org.apache.jena.jena.sparql.exec" e.g. log4j.properties -- log4j.logger.org.apache.jena.sparql.exec=INFO See the ARQ Logging Documentation.
-
arqIRI
public static final java.lang.String arqIRI
IRI for ARQ- See Also:
- Constant Field Values
-
arqParamNS
public static final java.lang.String arqParamNS
Root of ARQ-defined parameter names- See Also:
- Constant Field Values
-
arqSymbolPrefix
public static final java.lang.String arqSymbolPrefix
Prefix for ARQ-defined parameter names- See Also:
- Constant Field Values
-
strictSPARQL
public static final Symbol strictSPARQL
Stick exactly to the spec.
-
constantBNodeLabels
public static final Symbol constantBNodeLabels
Controls bNode labels as <_:...> or not - that is a pseudo URIs. This does not affect [] or _:a bNodes as variables in queries.
-
enablePropertyFunctions
public static final Symbol enablePropertyFunctions
Enable built-in property functions - also called "magic properties". These are properties in triple patterns that need calculation, not matching. See ARQ documentation for more details. rdfs:member and http://jena.apache.org/ARQ/list#member are provided.
-
enableExecutionTimeLogging
public static final Symbol enableExecutionTimeLogging
Enable logging of execution timing.
-
outputGraphBNodeLabels
public static final Symbol outputGraphBNodeLabels
If true, XML result sets written will contain the graph bNode label See also inputGraphBNodeLabels
-
inputGraphBNodeLabels
public static final Symbol inputGraphBNodeLabels
If true, XML result sets will use the bNode label in the result set itself. See also outputGraphBNodeLabels
-
queryTimeout
public static final Symbol queryTimeout
Set timeout. The value of this symbol gives thevalue of the timeout in milliseconds- A Number; the long value is used
- A string, e.g. "1000", parsed as a number
- A string, as two numbers separated by a comma, e.g. "500,10000" parsed as two numbers
-
stageGenerator
public static final Symbol stageGenerator
Context key for StageBuilder used in BGP compilation
-
hideNonDistiguishedVariables
public static final Symbol hideNonDistiguishedVariables
Context key to control hiding non-distinuished variables
-
useSAX
public static final Symbol useSAX
Use the SAX parser for XML result sets. The default is to use StAX for full streaming of XML results. The SAX parser takes a copy of the result set before giving the ResultSet to the calling application.
-
allowDuplicateSelectColumns
public static final boolean allowDuplicateSelectColumns
Indicate whether duplicate select and groupby variables are allowed. If false, duplicates are silently suppressed; it's not an error.- See Also:
- Constant Field Values
-
regexImpl
public static final Symbol regexImpl
Determine which regular expression system to use. The value of this context entry should be a string or symbol of one of the following: javaRegex : use java.util.regex (support features outside the strict SPARQL regex language) xercesRegex : use the internal XPath regex engine (more compliant)
-
javaRegex
public static final Symbol javaRegex
Symbol to name java.util.regex regular expression engine
-
xercesRegex
public static final Symbol xercesRegex
Symbol to name the Xerces-J regular expression engine
-
serviceParams
public static final Symbol serviceParams
Use this Symbol to allow passing additional query parameters to a SERVICE <IRI> call. Parameters need to be grouped by SERVICE <IRI>, a Map<String, Map<String,List<String>>> is assumed. The key of the first map is the SERVICE IRI, the value is a Map which maps the name of a query string parameters to its values.- See Also:
Service
-
serviceAllowed
public static final Symbol serviceAllowed
Control whether SERVICE processing is allowed. If the context of the query execution contains this, and it's set to "false", then SERVICE is not allowed.
-
fixupUndefinedPrefixes
public static final Symbol fixupUndefinedPrefixes
If set to true, the parsers will convert undefined prefixes to a URI according to the fixup functionRiotLib.fixupPrefixes. Normally, unset (which equates to false).- See Also:
RiotLib.isPrefixIRI(java.lang.String)
-
spillToDiskThreshold
public static final Symbol spillToDiskThreshold
A Long value that specifies the number of bindings (or triples for CONSTRUCT queries) to be stored in memory by sort operations or hash tables before switching to temporary disk files. The value defaults to -1, which will always keep the bindings in memory and never write to temporary files. The amount of memory used will vary based on the size of the bindings. If you are retrieving large literal strings, then you may need to lower the value. Note that for a complex query, several sort or hash operations might be running in parallel; each one will be allowed to retain as many bindings in memory as this value specifies before it starts putting data in temporary files. Also, several running sessions could be doing such operations concurrently. Therefore, the total number of bindings held in memory could be many times this value; it is necessary to keep this fact in mind when choosing the value. Operations currently affected by this symbol:
ORDER BY, SPARQL Update, CONSTRUCT (optionally) TODO: Give a reasonable suggested value here. 10,000?- See Also:
- JENA-119
-
optimization
public static final Symbol optimization
Context key controlling whether the main query engine applies the default optimization transformations.
-
optPathFlatten
public static final Symbol optPathFlatten
Context key controlling whether the main query engine flattens simple paths (e.g. ?x :p/:q ?z => ?x :p ?.0 . ?.0 ?q ?z)Default is "true"
-
optFilterPlacement
public static final Symbol optFilterPlacement
Context key controlling whether the main query engine moves filters to the "best" place. Default is "true" - filter placement is done.
-
optFilterPlacementBGP
public static final Symbol optFilterPlacementBGP
Context key controlling whether to do filter placement within BGP and quad blocks. Modies the effect of optFilterPlacement. Default is "true" - filter placement is pushed into BGPs.
-
optFilterPlacementConservative
public static final Symbol optFilterPlacementConservative
Context key controlling whether the main query engine moves filters to the "best" place using the more limited and conservative strategy which does not place as many filters Must be explicitly set "true" to operate. Filter placement, viaoptFilterPlacementmust also be active (which it is by default).- See Also:
optFilterPlacement
-
optTopNSorting
public static final Symbol optTopNSorting
Context key controlling whether an ORDER BY-LIMIT query is done avoiding total sort using an heap. Default is "true" - total sort if avoided by default when ORDER BY is used with LIMIT.
-
topNSortingThreshold
public static final Symbol topNSortingThreshold
Threshold for doing a top N sort for ORDER-LIMIT. The default is a limit of 1000. The context value should be aNumber.
-
optDistinctToReduced
public static final Symbol optDistinctToReduced
Context key controlling whether a DISTINCT-ORDER BY query is done by replacing the distinct with a reduced. Default is "true" - the reduced operator does not need to keep a data structure with all previously seen bindings.
-
optOrderByDistinctApplication
public static final Symbol optOrderByDistinctApplication
Context key controlling whether a DISTINCT-ORDER BY query is done by applying the ORDER BY after the DISTINCT when default SPARQL semantics usually mean ORDER BY applies before DISTINCT. This optimization applies only in a subset of cases unlike the more generaloptDistinctToReducedoptimization.See
TransformOrderByDistinctApplicationfor more discussion on exactly when this may apply
-
optFilterEquality
public static final Symbol optFilterEquality
Context key controlling whether the standard optimizer applies optimizations to equalities in FILTERs. This optimization is conservative - it does not take place if there is a potential risk of changing query semantics.
-
optFilterInequality
public static final Symbol optFilterInequality
Context key controlling whether the standard optimizer applies optimizations to inequalities in FILTERs This optimization is conservative - it does not take place if there is a potential risk of changing query semantics
-
optFilterImplicitJoin
public static final Symbol optFilterImplicitJoin
Context key controlling whether the standard optimizer applies optimizations to implicit joins in FILTERs. This optimization is conservative - it does not take place if there is a potential risk of changing query semantics.
-
optImplicitLeftJoin
public static final Symbol optImplicitLeftJoin
Context key controlling whether the standard optimizer applies optimizations to implicit left joins. This optimization is conservative - it does not take place if there is a potential risk of changing query semantics.
-
optExprConstantFolding
public static final Symbol optExprConstantFolding
Context key controlling whether the standard optimizer applies constant folding to expressionsBy default, this transformation is applied.
-
optFilterConjunction
public static final Symbol optFilterConjunction
Context key controlling whether the standard optimizer applies optimizations to conjunctions (&&) in filters.By default, this transformation is applied.
-
optFilterExpandOneOf
public static final Symbol optFilterExpandOneOf
Context key controlling whether the standard optimizer applies optimizations to IN and NOT IN.By default, this transformation is applied.
-
optFilterDisjunction
public static final Symbol optFilterDisjunction
Context key controlling whether the standard optimizer applies optimizations to disjunctions (||) in filters.By default, this transformation is applied.
-
optPromoteTableEmpty
public static final Symbol optPromoteTableEmpty
Context key controlling whether the standard optimizer applies table empty promotion
-
optIndexJoinStrategy
public static final Symbol optIndexJoinStrategy
Context key controlling whether the standard optimizer applies optimizations to the evaluation of joins to favour index joins wherever possible
-
optInlineAssignments
public static final Symbol optInlineAssignments
Context key controlling whether the standard optimizer applies optimizations where by some assignments may be eliminated/inlined into the operators where their values are used only onceBy default, this transformation is not applied.
-
optInlineAssignmentsAggressive
public static final Symbol optInlineAssignmentsAggressive
Context key controlling whether the standard optimizer aggressively inlines assignments whose values are used only once into operators where those expressions may be evaluated multiple times e.g. orderThis is modifier to
optInlineAssignments.
-
optMergeBGPs
public static final Symbol optMergeBGPs
Context key controlling whether the standard optimizater applies optimizations to joined BGPs to merge them into single BGPs.By default, this transformation is applied.
-
optMergeExtends
public static final Symbol optMergeExtends
Context key controlling whether the standard optimizer applies the optimization to combine stacks of (extend) into one compound operation. Ditto (assign).By default, this transformation is applied.
-
optReorderBGP
public static final Symbol optReorderBGP
Context key controlling whether the standard optimizer applies the optimization to reorder basic graph patterns.By default, this transformation is NOT applied. It is left to the specific engines to decide.
-
propertyFunctions
public static final Symbol propertyFunctions
Context key controlling whether the main query engine processes property functions.By default, this is applied.
-
extensionValueTypes
public static final Symbol extensionValueTypes
Expression evaluation without extension types (e.g. xsd:date, language tags)
-
symJavaScriptFunctions
public static Symbol symJavaScriptFunctions
Context symbol for JavaScript functions as a string value which is evaluated.
-
symJavaScriptLibFile
public static Symbol symJavaScriptLibFile
Context symbol for JavaScript library of functions defined in a file.
-
generateToList
public static final Symbol generateToList
Generate the ToList operation in the algebra (as ARQ is stream based, ToList is a non-op). Default is not to do so. Strict mode will also enable this.
-
PATH
public static final java.lang.String PATH
The root package name for ARQ- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
The product name- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
The full name of the current ARQ version
-
BUILD_DATE
public static final java.lang.String BUILD_DATE
The date and time at which this release was built
-
-
Method Detail
-
getExecLogger
public static org.slf4j.Logger getExecLogger()
The execution logger
-
getInfoLogger
public static org.slf4j.Logger getInfoLogger()
The information logger
-
getHttpRequestLogger
public static org.slf4j.Logger getHttpRequestLogger()
The HTTP Request logger
-
getExecutionLogging
public static Explain.InfoLevel getExecutionLogging()
Get the currently global execution logging setting
-
setExecutionLogging
public static void setExecutionLogging(Explain.InfoLevel infoLevel)
Set execution logging - logging is to logger "org.apache.jena.arq.exec" at level INFO. An appropriate logging configuration is also required.
-
enableBlankNodeResultLabels
public static void enableBlankNodeResultLabels()
Turn on processing of blank node labels in queries
-
enableBlankNodeResultLabels
public static void enableBlankNodeResultLabels(boolean val)
Turn on/off processing of blank node labels in queries
-
enableOptimizer
public static void enableOptimizer(boolean state)
Globally switch the default optimizer on and off : Note that storage subsystems may also be applying separately controlled optimizations.
-
enableOptimizer
public static void enableOptimizer(Context context, boolean state)
Switch the default optimizer on and off for a specific Context. Note that storage subsystems may also be applying separately controlled optimizations.
-
setStrictMode
public static void setStrictMode()
Set strict mode, including expression evaluation
-
setStrictMode
public static void setStrictMode(Context context)
Set strict mode for a given Context. Does not influence expression evaluation because NodeValues are controlled globally, not per context.
-
isStrictMode
public static boolean isStrictMode()
-
setNormalMode
public static void setNormalMode()
Set normal mode, including expression evaluation
-
setNormalMode
public static void setNormalMode(Context context)
Explicitly set the values for normal operation. Does not influence expression evaluation.
-
init
public static void init()
-
getContext
public static Context getContext()
-
set
public static void set(Symbol symbol, boolean value)
-
setTrue
public static void setTrue(Symbol symbol)
-
setFalse
public static void setFalse(Symbol symbol)
-
unset
public static void unset(Symbol symbol)
-
isTrue
public static boolean isTrue(Symbol symbol)
-
isFalse
public static boolean isFalse(Symbol symbol)
-
isTrueOrUndef
public static boolean isTrueOrUndef(Symbol symbol)
-
isFalseOrUndef
public static boolean isFalseOrUndef(Symbol symbol)
-
-