# @comunica/actor-optimize-query-operation-query-source-identify

> A query-source-identify optimize-query-operation actor

Latest version **5.4.0** (published 2026-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @comunica/actor-optimize-query-operation-query-source-identify
pnpm add @comunica/actor-optimize-query-operation-query-source-identify
yarn add @comunica/actor-optimize-query-operation-query-source-identify
bun add @comunica/actor-optimize-query-operation-query-source-identify
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.4.0 |
| Published | 2026-09-14 |
| First published | 2025-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 50.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 591 |
| Maintainers | joachimvh, rubensworks, rubenverborgh, dexagod, jeswr |
| Keywords | comunica, actor, optimize-query-operation, query-source-identify |

## Links

- npm: https://www.npmjs.com/package/@comunica/actor-optimize-query-operation-query-source-identify
- Repository: https://github.com/comunica/comunica
- Homepage: https://comunica.dev/
- Issues: https://github.com/comunica/comunica/issues
- Funding: https://opencollective.com/comunica-association
- npm.io page: https://npm.io/package/@comunica/actor-optimize-query-operation-query-source-identify

## Dependencies (10)

- [lru-cache](https://npm.io/package/lru-cache.md) ^11.2.2
- [@comunica/core](https://npm.io/package/@comunica/core.md) ^5.4.0
- [@comunica/types](https://npm.io/package/@comunica/types.md) ^5.4.0
- [@comunica/utils-algebra](https://npm.io/package/@comunica/utils-algebra.md) ^5.4.0
- [@comunica/context-entries](https://npm.io/package/@comunica/context-entries.md) ^5.4.0
- [@comunica/bus-http-invalidate](https://npm.io/package/@comunica/bus-http-invalidate.md) ^5.4.0
- [@comunica/utils-query-operation](https://npm.io/package/@comunica/utils-query-operation.md) ^5.4.0
- [@comunica/bus-context-preprocess](https://npm.io/package/@comunica/bus-context-preprocess.md) ^5.4.0
- [@comunica/bus-query-source-identify](https://npm.io/package/@comunica/bus-query-source-identify.md) ^5.4.0
- [@comunica/bus-optimize-query-operation](https://npm.io/package/@comunica/bus-optimize-query-operation.md) ^5.4.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 5.4.0 (latest) — 2026-09-14
- 4.4.2-alpha.49.0 (next) — 2025-10-22
- 5.3.0 — 2026-07-10
- 5.2.3 — 2026-05-26
- 5.2.2 — 2026-05-03
- 5.2.0 — 2026-04-14
- 5.1.3 — 2026-01-30
- 5.1.0 — 2026-01-16
- 5.0.3 — 2026-01-12
- 5.0.2 — 2026-01-12
- 5.0.0 — 2026-01-08
- 4.5.0 — 2026-01-08

## README

# Comunica Query Source Identify Optimize Query Operation Actor

[![npm version](https://badge.fury.io/js/%40comunica%2Factor-optimize-query-operation-query-source-identify.svg)](https://www.npmjs.com/package/@comunica/actor-optimize-query-operation-query-source-identify)

An [Optimize Query Operation](https://github.com/comunica/comunica/tree/master/packages/bus-optimize-query-operation) actor
that identifies all query sources in the context using
the [Query Source Identify bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-source-identify).
It will store all query sources in the context using `KeysQueryOperation.querySources`,
and sources corresponding to the SERVICE clauses within the query will be stored
using `KeysQueryOperation.serviceSources`.

Sources of SERVICE clauses are not allowed to be dereferenced from the local file system,
unless the `serviceAllowFileTargets` context entry is enabled.

This actor also contains a cache so that identical sources will be reused across multiple query executions.
This cache can be invalidated via `engine.invalidateHttpCache()`.

This module is part of the [Comunica framework](https://github.com/comunica/comunica),
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).

[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).

## Install

```bash
$ yarn add @comunica/actor-optimize-query-operation-query-source-identify
```

## Configure

After installing, this package can be added to your engine's configuration as follows:
```text
{
  "@context": [
    ...
    "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-optimize-query-operation-query-source-identify/^1.0.0/components/context.jsonld"
  ],
  "actors": [
    ...
    {
      "@id": "urn:comunica:default:optimize-query-operation/actors#query-source-identify",
      "@type": "ActorOptimizeQueryOperationQuerySourceIdentify",
      "mediatorQuerySourceIdentify": { "@id": "urn:comunica:default:query-source-identify/mediators#main" },
      "mediatorContextPreprocess": { "@id": "urn:comunica:default:context-preprocess/mediators#main" }
    }
  ]
}
```

### Context Parameters

* `serviceAllowFileTargets`: Optional flag indicating if SERVICE clauses may target local files, defaults to `false`.
  Enabling this allows queries to read arbitrary local files,
  which should only be done if all queries originate from trusted parties.

### Config Parameters

* `serviceForceSparqlEndpoint`: Optional flag indicating if the SERVICE target should be assumed to be a SPARQL endpoint, defaults to `false`.
* `cacheSize`: The maximum number of entries in the LRU cache, set to 0 to disable, defaults to 100.
* `httpInvalidator`: An optional actor that listens to HTTP invalidation events.
* `mediatorQuerySourceIdentify`: A mediator over the [Query Source Identify bus](https://github.com/comunica/comunica/tree/master/packages/bus-query-source-identify).
* `mediatorContextPreprocess`: A mediator over the [context preprocess bus](https://github.com/comunica/comunica/tree/master/packages/bus-context-preprocess).

---
_Source: https://npm.io/package/@comunica/actor-optimize-query-operation-query-source-identify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
