strixonomy_core/limits.rs
1//! Resource limits for indexing and querying (DoS hardening).
2
3/// Maximum size of a single ontology file read from disk or held in an LSP open buffer.
4pub const MAX_FILE_BYTES: u64 = 50 * 1024 * 1024;
5
6/// Maximum open LSP document buffers tracked per workspace.
7pub const MAX_OPEN_DOCUMENTS: usize = 256;
8
9/// Maximum ontology files scanned per workspace.
10pub const MAX_SCAN_FILES: usize = 10_000;
11
12/// Maximum filesystem entries visited during a workspace scan (including non-ontology files).
13pub const MAX_SCAN_WALK_ENTRIES: usize = 500_000;
14
15/// Maximum RDF quads parsed from one file.
16pub const MAX_TRIPLES_PER_FILE: usize = 5_000_000;
17
18/// Maximum RDF quads loaded into the catalog store for a workspace.
19pub const MAX_TOTAL_TRIPLES: usize = 20_000_000;
20
21/// Maximum extracted entities per workspace build.
22pub const MAX_ENTITIES: usize = 1_000_000;
23
24/// Maximum SQL or SPARQL query string length.
25pub const MAX_QUERY_BYTES: usize = 1_048_576;
26
27/// Maximum rows returned from a SQL virtual-table query.
28pub const MAX_SQL_RESULT_ROWS: usize = 100_000;
29
30/// Maximum rows returned from a SPARQL query.
31pub const MAX_SPARQL_RESULT_ROWS: usize = 100_000;
32
33/// Maximum nodes in a graph export payload.
34pub const MAX_GRAPH_NODES: usize = 2_000;
35
36/// Maximum edges in a graph export payload.
37pub const MAX_GRAPH_EDGES: usize = 5_000;