Skip to content
Martin Ledvinka edited this page Apr 30, 2026 · 7 revisions

JOPA supports specifying hints for query execution via the Query.setHint method. These hints allow to configure the execution of SPARQL queries. Note that not all query hints are supported by all underlying OntoDrivers. If a hint is not supported by a driver, it is silently ignored by it. If a hint is not recognized at all by JOPA, it is also ignored, but a warning is logged. If an invalid value is provided for a hint, an exception is thrown.

The following table lists the currently supported query hints:

Hint Explanation Documentation Support Version
cz.cvut.kbss.jopa.query.disableInference Allows disabling inference for execution of a query. Note that for typed queries loading entities, this will also apply to the loaded entities. OntoDriver OWLAPI, RDF4J 0.19.0
cz.cvut.kbss.jopa.query.targetOntology Specifies target of query execution. Possible values are CENTRAL and TRANSACTIONAL. CENTRAL means that only committed changes are visible to the query, TRANSACTIONAL will also include changes pending in the current transaction. OnoDriver Jena, OWLAPI 1.0.0
cz.cvut.kbss.jopa.query.enableEntityLoadingOptimizer Enables query result loading optimizer that attempts to fetch entities as part of the query execution rather than loading them separately based on query result (default behavior). Performance All 2.7.1
cz.cvut.kbss.jopa.query.fetchGraph Specifies an entity graph to use to fetch entity attributes. Performance All 2.10.0

See class cz.cvut.kbss.jopa.query.QueryHints for declaration of individual query hints.

Clone this wiki locally