Fix ChunkBrowserQA: use regulation_id from Qdrant payload instead of regulation_code
The Qdrant collections use regulation_id (e.g. eu_2016_679) as the filter key, not regulation_code (e.g. GDPR). Updated rag-constants.ts with correct qdrant_id mappings from actual Qdrant data, fixed API to filter on regulation_id, and updated ChunkBrowserQA to pass qdrant_id values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,22 +84,37 @@ export function ChunkBrowserQA({ apiProxy }: ChunkBrowserQAProps) {
|
|||||||
|
|
||||||
// Load regulation counts for current collection
|
// Load regulation counts for current collection
|
||||||
const loadRegulationCounts = useCallback(async (col: string) => {
|
const loadRegulationCounts = useCallback(async (col: string) => {
|
||||||
const codes = Object.entries(REGULATIONS_IN_RAG)
|
const entries = Object.entries(REGULATIONS_IN_RAG)
|
||||||
.filter(([, info]) => info.collection === col)
|
.filter(([, info]) => info.collection === col && info.qdrant_id)
|
||||||
.map(([code]) => code)
|
if (entries.length === 0) return
|
||||||
if (codes.length === 0) return
|
|
||||||
|
// Build qdrant_id -> our_code mapping
|
||||||
|
const qdrantIdToCode: Record<string, string[]> = {}
|
||||||
|
for (const [code, info] of entries) {
|
||||||
|
if (!qdrantIdToCode[info.qdrant_id]) qdrantIdToCode[info.qdrant_id] = []
|
||||||
|
qdrantIdToCode[info.qdrant_id].push(code)
|
||||||
|
}
|
||||||
|
const uniqueQdrantIds = Object.keys(qdrantIdToCode)
|
||||||
|
|
||||||
setCountsLoading(true)
|
setCountsLoading(true)
|
||||||
try {
|
try {
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
action: 'regulation-counts-batch',
|
action: 'regulation-counts-batch',
|
||||||
collection: col,
|
collection: col,
|
||||||
codes: codes.join(','),
|
qdrant_ids: uniqueQdrantIds.join(','),
|
||||||
})
|
})
|
||||||
const res = await fetch(`${apiProxy}?${params}`)
|
const res = await fetch(`${apiProxy}?${params}`)
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
setRegulationCounts(prev => ({ ...prev, ...data.counts }))
|
// Map qdrant_id counts back to our codes
|
||||||
|
const mapped: Record<string, number> = {}
|
||||||
|
for (const [qid, count] of Object.entries(data.counts as Record<string, number>)) {
|
||||||
|
const codes = qdrantIdToCode[qid] || []
|
||||||
|
for (const code of codes) {
|
||||||
|
mapped[code] = count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setRegulationCounts(prev => ({ ...prev, ...mapped }))
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to load regulation counts:', error)
|
console.error('Failed to load regulation counts:', error)
|
||||||
@@ -111,7 +126,7 @@ export function ChunkBrowserQA({ apiProxy }: ChunkBrowserQAProps) {
|
|||||||
// Load all chunks for a regulation (paginated scroll)
|
// Load all chunks for a regulation (paginated scroll)
|
||||||
const loadDocumentChunks = useCallback(async (regulationCode: string) => {
|
const loadDocumentChunks = useCallback(async (regulationCode: string) => {
|
||||||
const ragInfo = REGULATIONS_IN_RAG[regulationCode]
|
const ragInfo = REGULATIONS_IN_RAG[regulationCode]
|
||||||
if (!ragInfo) return
|
if (!ragInfo || !ragInfo.qdrant_id) return
|
||||||
|
|
||||||
setDocLoading(true)
|
setDocLoading(true)
|
||||||
setDocChunks([])
|
setDocChunks([])
|
||||||
@@ -129,8 +144,8 @@ export function ChunkBrowserQA({ apiProxy }: ChunkBrowserQAProps) {
|
|||||||
action: 'scroll',
|
action: 'scroll',
|
||||||
collection: ragInfo.collection,
|
collection: ragInfo.collection,
|
||||||
limit: '100',
|
limit: '100',
|
||||||
filter_key: 'regulation_code',
|
filter_key: 'regulation_id',
|
||||||
filter_value: regulationCode,
|
filter_value: ragInfo.qdrant_id,
|
||||||
})
|
})
|
||||||
if (offset) params.append('offset', offset)
|
if (offset) params.append('offset', offset)
|
||||||
|
|
||||||
|
|||||||
@@ -1,110 +1,126 @@
|
|||||||
/**
|
/**
|
||||||
* Shared RAG constants used by both page.tsx and ChunkBrowserQA.
|
* Shared RAG constants used by both page.tsx and ChunkBrowserQA.
|
||||||
* REGULATIONS_IN_RAG maps regulation codes to their Qdrant collection and chunk count.
|
* REGULATIONS_IN_RAG maps regulation codes to their Qdrant collection, chunk count, and qdrant_id.
|
||||||
|
* The qdrant_id is the actual `regulation_id` value stored in Qdrant payloads.
|
||||||
* REGULATION_INFO provides minimal metadata (code, name, type) for all regulations.
|
* REGULATION_INFO provides minimal metadata (code, name, type) for all regulations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const REGULATIONS_IN_RAG: Record<string, { collection: string; chunks: number }> = {
|
export interface RagRegulationEntry {
|
||||||
// EU Verordnungen/Richtlinien (bp_compliance_ce)
|
collection: string
|
||||||
GDPR: { collection: 'bp_compliance_ce', chunks: 1842 },
|
chunks: number
|
||||||
EPRIVACY: { collection: 'bp_compliance_ce', chunks: 156 },
|
qdrant_id: string // The actual regulation_id value in Qdrant payload
|
||||||
SCC: { collection: 'bp_compliance_ce', chunks: 89 },
|
}
|
||||||
SCC_FULL_TEXT: { collection: 'bp_compliance_ce', chunks: 154 },
|
|
||||||
AIACT: { collection: 'bp_compliance_ce', chunks: 1245 },
|
export const REGULATIONS_IN_RAG: Record<string, RagRegulationEntry> = {
|
||||||
CRA: { collection: 'bp_compliance_ce', chunks: 687 },
|
// === EU Verordnungen/Richtlinien (bp_compliance_ce) ===
|
||||||
NIS2: { collection: 'bp_compliance_ce', chunks: 534 },
|
GDPR: { collection: 'bp_compliance_ce', chunks: 423, qdrant_id: 'eu_2016_679' },
|
||||||
DGA: { collection: 'bp_compliance_ce', chunks: 312 },
|
EPRIVACY: { collection: 'bp_compliance_ce', chunks: 134, qdrant_id: 'eu_2002_58' },
|
||||||
DSA: { collection: 'bp_compliance_ce', chunks: 978 },
|
SCC: { collection: 'bp_compliance_ce', chunks: 330, qdrant_id: 'eu_2021_914' },
|
||||||
PLD: { collection: 'bp_compliance_ce', chunks: 124 },
|
SCC_FULL_TEXT: { collection: 'bp_compliance_ce', chunks: 330, qdrant_id: 'eu_2021_914' },
|
||||||
E_COMMERCE_RL: { collection: 'bp_compliance_ce', chunks: 198 },
|
AIACT: { collection: 'bp_compliance_ce', chunks: 726, qdrant_id: 'eu_2024_1689' },
|
||||||
VERBRAUCHERRECHTE_RL: { collection: 'bp_compliance_ce', chunks: 245 },
|
CRA: { collection: 'bp_compliance_ce', chunks: 429, qdrant_id: 'eu_2024_2847' },
|
||||||
DIGITALE_INHALTE_RL: { collection: 'bp_compliance_ce', chunks: 187 },
|
NIS2: { collection: 'bp_compliance_ce', chunks: 342, qdrant_id: 'eu_2022_2555' },
|
||||||
DMA: { collection: 'bp_compliance_ce', chunks: 590 },
|
DGA: { collection: 'bp_compliance_ce', chunks: 508, qdrant_id: 'eu_2022_868' },
|
||||||
DPF: { collection: 'bp_compliance_ce', chunks: 1232 },
|
DSA: { collection: 'bp_compliance_ce', chunks: 1106, qdrant_id: 'eu_2022_2065' },
|
||||||
EUCSA: { collection: 'bp_compliance_ce', chunks: 558 },
|
PLD: { collection: 'bp_compliance_ce', chunks: 44, qdrant_id: 'eu_1985_374' },
|
||||||
DATAACT: { collection: 'bp_compliance_ce', chunks: 809 },
|
E_COMMERCE_RL: { collection: 'bp_compliance_ce', chunks: 197, qdrant_id: 'eu_2000_31' },
|
||||||
DORA: { collection: 'bp_compliance_ce', chunks: 823 },
|
VERBRAUCHERRECHTE_RL: { collection: 'bp_compliance_ce', chunks: 266, qdrant_id: 'eu_2011_83' },
|
||||||
PSD2: { collection: 'bp_compliance_ce', chunks: 796 },
|
DIGITALE_INHALTE_RL: { collection: 'bp_compliance_ce', chunks: 321, qdrant_id: 'eu_2019_770' },
|
||||||
AMLR: { collection: 'bp_compliance_ce', chunks: 1182 },
|
DMA: { collection: 'bp_compliance_ce', chunks: 701, qdrant_id: 'eu_2022_1925' },
|
||||||
MiCA: { collection: 'bp_compliance_ce', chunks: 1640 },
|
DPF: { collection: 'bp_compliance_ce', chunks: 2464, qdrant_id: 'dpf' },
|
||||||
EHDS: { collection: 'bp_compliance_ce', chunks: 1212 },
|
EUCSA: { collection: 'bp_compliance_ce', chunks: 558, qdrant_id: 'eucsa' },
|
||||||
EAA: { collection: 'bp_compliance_ce', chunks: 433 },
|
DATAACT: { collection: 'bp_compliance_ce', chunks: 809, qdrant_id: 'dataact' },
|
||||||
DSM: { collection: 'bp_compliance_ce', chunks: 416 },
|
DORA: { collection: 'bp_compliance_ce', chunks: 823, qdrant_id: 'dora' },
|
||||||
GPSR: { collection: 'bp_compliance_ce', chunks: 509 },
|
PSD2: { collection: 'bp_compliance_ce', chunks: 796, qdrant_id: 'psd2' },
|
||||||
MACHINERY_REG: { collection: 'bp_compliance_ce', chunks: 0 },
|
AMLR: { collection: 'bp_compliance_ce', chunks: 1182, qdrant_id: 'amlr' },
|
||||||
BLUE_GUIDE: { collection: 'bp_compliance_ce', chunks: 0 },
|
MiCA: { collection: 'bp_compliance_ce', chunks: 1640, qdrant_id: 'mica' },
|
||||||
EU_IFRS_DE: { collection: 'bp_compliance_ce', chunks: 0 },
|
EHDS: { collection: 'bp_compliance_ce', chunks: 1212, qdrant_id: 'ehds' },
|
||||||
EU_IFRS_EN: { collection: 'bp_compliance_ce', chunks: 0 },
|
EAA: { collection: 'bp_compliance_ce', chunks: 433, qdrant_id: 'eaa' },
|
||||||
// DE Gesetze (bp_compliance_gesetze)
|
DSM: { collection: 'bp_compliance_ce', chunks: 416, qdrant_id: 'dsm' },
|
||||||
TDDDG: { collection: 'bp_compliance_gesetze', chunks: 215 },
|
GPSR: { collection: 'bp_compliance_ce', chunks: 509, qdrant_id: 'gpsr' },
|
||||||
BDSG_FULL: { collection: 'bp_compliance_gesetze', chunks: 487 },
|
MACHINERY_REG: { collection: 'bp_compliance_ce', chunks: 1271, qdrant_id: 'eu_2023_1230' },
|
||||||
DE_DDG: { collection: 'bp_compliance_gesetze', chunks: 198 },
|
BLUE_GUIDE: { collection: 'bp_compliance_ce', chunks: 2271, qdrant_id: 'eu_blue_guide_2022' },
|
||||||
DE_BGB_AGB: { collection: 'bp_compliance_gesetze', chunks: 4250 },
|
EU_IFRS_DE: { collection: 'bp_compliance_ce', chunks: 34388, qdrant_id: 'eu_2023_1803' },
|
||||||
DE_EGBGB: { collection: 'bp_compliance_gesetze', chunks: 312 },
|
EU_IFRS_EN: { collection: 'bp_compliance_ce', chunks: 34388, qdrant_id: 'eu_2023_1803' },
|
||||||
DE_HGB_RET: { collection: 'bp_compliance_gesetze', chunks: 6840 },
|
// International standards in bp_compliance_ce
|
||||||
DE_AO_RET: { collection: 'bp_compliance_gesetze', chunks: 5620 },
|
NIST_SSDF: { collection: 'bp_compliance_ce', chunks: 111, qdrant_id: 'nist_sp_800_218' },
|
||||||
DE_UWG: { collection: 'bp_compliance_gesetze', chunks: 1 },
|
NIST_CSF_2: { collection: 'bp_compliance_ce', chunks: 67, qdrant_id: 'nist_csf_2_0' },
|
||||||
DE_TKG: { collection: 'bp_compliance_gesetze', chunks: 1631 },
|
OECD_AI_PRINCIPLES: { collection: 'bp_compliance_ce', chunks: 34, qdrant_id: 'oecd_ai_principles' },
|
||||||
DE_PANGV: { collection: 'bp_compliance_gesetze', chunks: 1 },
|
ENISA_SECURE_BY_DESIGN: { collection: 'bp_compliance_ce', chunks: 97, qdrant_id: 'cisa_secure_by_design' },
|
||||||
DE_DLINFOV: { collection: 'bp_compliance_gesetze', chunks: 21 },
|
ENISA_SUPPLY_CHAIN: { collection: 'bp_compliance_ce', chunks: 110, qdrant_id: 'enisa_supply_chain_good_practices' },
|
||||||
DE_BETRVG: { collection: 'bp_compliance_gesetze', chunks: 498 },
|
ENISA_THREAT_LANDSCAPE: { collection: 'bp_compliance_ce', chunks: 118, qdrant_id: 'enisa_threat_landscape_supply_chain' },
|
||||||
DE_GESCHGEHG: { collection: 'bp_compliance_gesetze', chunks: 63 },
|
ENISA_ICS_SCADA: { collection: 'bp_compliance_ce', chunks: 195, qdrant_id: 'enisa_ics_scada_dependencies' },
|
||||||
DE_BSIG: { collection: 'bp_compliance_gesetze', chunks: 1 },
|
ENISA_CYBERSECURITY_2024: { collection: 'bp_compliance_ce', chunks: 22, qdrant_id: 'enisa_cybersecurity_state_2024' },
|
||||||
DE_USTG_RET: { collection: 'bp_compliance_gesetze', chunks: 1071 },
|
|
||||||
// BSI Standards (bp_compliance_gesetze)
|
// === DE Gesetze (bp_compliance_gesetze) ===
|
||||||
'BSI-TR-03161-1': { collection: 'bp_compliance_gesetze', chunks: 425 },
|
TDDDG: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'tdddg_25' },
|
||||||
'BSI-TR-03161-2': { collection: 'bp_compliance_gesetze', chunks: 380 },
|
TMG_KOMPLETT: { collection: 'bp_compliance_gesetze', chunks: 108, qdrant_id: 'tmg_komplett' },
|
||||||
'BSI-TR-03161-3': { collection: 'bp_compliance_gesetze', chunks: 345 },
|
BDSG_FULL: { collection: 'bp_compliance_gesetze', chunks: 1056, qdrant_id: 'bdsg_2018_komplett' },
|
||||||
// AT Gesetze (bp_compliance_gesetze)
|
DE_DDG: { collection: 'bp_compliance_gesetze', chunks: 40, qdrant_id: 'ddg_5' },
|
||||||
AT_DSG: { collection: 'bp_compliance_gesetze', chunks: 287 },
|
DE_BGB_AGB: { collection: 'bp_compliance_gesetze', chunks: 4024, qdrant_id: 'bgb_komplett' },
|
||||||
AT_DSG_FULL: { collection: 'bp_compliance_gesetze', chunks: 6 },
|
DE_EGBGB: { collection: 'bp_compliance_gesetze', chunks: 36, qdrant_id: 'egbgb_widerruf' },
|
||||||
AT_ECG: { collection: 'bp_compliance_gesetze', chunks: 120 },
|
DE_HGB_RET: { collection: 'bp_compliance_gesetze', chunks: 11363, qdrant_id: 'hgb_komplett' },
|
||||||
AT_TKG: { collection: 'bp_compliance_gesetze', chunks: 2174 },
|
DE_AO_RET: { collection: 'bp_compliance_gesetze', chunks: 9669, qdrant_id: 'ao_komplett' },
|
||||||
AT_KSCHG: { collection: 'bp_compliance_gesetze', chunks: 402 },
|
DE_TKG: { collection: 'bp_compliance_gesetze', chunks: 1631, qdrant_id: 'de_tkg' },
|
||||||
AT_FAGG: { collection: 'bp_compliance_gesetze', chunks: 2 },
|
DE_DLINFOV: { collection: 'bp_compliance_gesetze', chunks: 21, qdrant_id: 'de_dlinfov' },
|
||||||
AT_UGB_RET: { collection: 'bp_compliance_gesetze', chunks: 2828 },
|
DE_BETRVG: { collection: 'bp_compliance_gesetze', chunks: 498, qdrant_id: 'de_betrvg' },
|
||||||
AT_BAO_RET: { collection: 'bp_compliance_gesetze', chunks: 2246 },
|
DE_GESCHGEHG: { collection: 'bp_compliance_gesetze', chunks: 63, qdrant_id: 'de_geschgehg' },
|
||||||
AT_MEDIENG: { collection: 'bp_compliance_gesetze', chunks: 571 },
|
DE_USTG_RET: { collection: 'bp_compliance_gesetze', chunks: 1071, qdrant_id: 'de_ustg_ret' },
|
||||||
AT_ABGB_AGB: { collection: 'bp_compliance_gesetze', chunks: 2521 },
|
DE_URHG: { collection: 'bp_compliance_gesetze', chunks: 626, qdrant_id: 'urhg_komplett' },
|
||||||
AT_UWG: { collection: 'bp_compliance_gesetze', chunks: 403 },
|
|
||||||
// CH Gesetze (bp_compliance_gesetze)
|
// === BSI Standards (bp_compliance_gesetze) ===
|
||||||
CH_DSG: { collection: 'bp_compliance_gesetze', chunks: 156 },
|
'BSI-TR-03161-1': { collection: 'bp_compliance_gesetze', chunks: 138, qdrant_id: 'bsi_tr_03161_1' },
|
||||||
CH_DSV: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
'BSI-TR-03161-2': { collection: 'bp_compliance_gesetze', chunks: 124, qdrant_id: 'bsi_tr_03161_2' },
|
||||||
CH_OR_AGB: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
'BSI-TR-03161-3': { collection: 'bp_compliance_gesetze', chunks: 121, qdrant_id: 'bsi_tr_03161_3' },
|
||||||
CH_UWG: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
|
||||||
CH_FMG: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
// === AT Gesetze (bp_compliance_gesetze) ===
|
||||||
CH_GEBUV: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
AT_DSG: { collection: 'bp_compliance_gesetze', chunks: 805, qdrant_id: 'at_dsg' },
|
||||||
CH_ZERTES: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
AT_DSG_FULL: { collection: 'bp_compliance_gesetze', chunks: 6, qdrant_id: 'at_dsg_full' },
|
||||||
CH_ZGB_PERS: { collection: 'bp_compliance_gesetze', chunks: 5 },
|
AT_ECG: { collection: 'bp_compliance_gesetze', chunks: 120, qdrant_id: 'at_ecg' },
|
||||||
// LI
|
AT_TKG: { collection: 'bp_compliance_gesetze', chunks: 4348, qdrant_id: 'at_tkg' },
|
||||||
LI_DSG: { collection: 'bp_compliance_gesetze', chunks: 2 },
|
AT_KSCHG: { collection: 'bp_compliance_gesetze', chunks: 402, qdrant_id: 'at_kschg' },
|
||||||
// Nationale DSG (andere EU)
|
AT_FAGG: { collection: 'bp_compliance_gesetze', chunks: 2, qdrant_id: 'at_fagg' },
|
||||||
ES_LOPDGDD: { collection: 'bp_compliance_gesetze', chunks: 1245 },
|
AT_UGB_RET: { collection: 'bp_compliance_gesetze', chunks: 2828, qdrant_id: 'at_ugb_ret' },
|
||||||
IT_CODICE_PRIVACY: { collection: 'bp_compliance_gesetze', chunks: 198 },
|
AT_BAO_RET: { collection: 'bp_compliance_gesetze', chunks: 2246, qdrant_id: 'at_bao_ret' },
|
||||||
NL_UAVG: { collection: 'bp_compliance_gesetze', chunks: 1320 },
|
AT_MEDIENG: { collection: 'bp_compliance_gesetze', chunks: 571, qdrant_id: 'at_medieng' },
|
||||||
FR_CNIL_GUIDE: { collection: 'bp_compliance_gesetze', chunks: 1450 },
|
AT_ABGB_AGB: { collection: 'bp_compliance_gesetze', chunks: 2521, qdrant_id: 'at_abgb_agb' },
|
||||||
IE_DPA_2018: { collection: 'bp_compliance_gesetze', chunks: 534 },
|
AT_UWG: { collection: 'bp_compliance_gesetze', chunks: 403, qdrant_id: 'at_uwg' },
|
||||||
UK_DPA_2018: { collection: 'bp_compliance_gesetze', chunks: 1680 },
|
|
||||||
UK_GDPR: { collection: 'bp_compliance_gesetze', chunks: 890 },
|
// === CH Gesetze (bp_compliance_gesetze) ===
|
||||||
NO_PERSONOPPLYSNINGSLOVEN: { collection: 'bp_compliance_gesetze', chunks: 245 },
|
CH_DSG: { collection: 'bp_compliance_gesetze', chunks: 180, qdrant_id: 'ch_revdsg' },
|
||||||
SE_DATASKYDDSLAG: { collection: 'bp_compliance_gesetze', chunks: 167 },
|
CH_DSV: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'ch_dsv' },
|
||||||
PL_UODO: { collection: 'bp_compliance_gesetze', chunks: 198 },
|
CH_OR_AGB: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'ch_or_agb' },
|
||||||
CZ_ZOU: { collection: 'bp_compliance_gesetze', chunks: 1120 },
|
CH_GEBUV: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'ch_gebuv' },
|
||||||
HU_INFOTV: { collection: 'bp_compliance_gesetze', chunks: 1345 },
|
CH_ZERTES: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'ch_zertes' },
|
||||||
BE_DPA_LAW: { collection: 'bp_compliance_gesetze', chunks: 3 },
|
CH_ZGB_PERS: { collection: 'bp_compliance_gesetze', chunks: 5, qdrant_id: 'ch_zgb_pers' },
|
||||||
FI_TIETOSUOJALAKI: { collection: 'bp_compliance_gesetze', chunks: 2 },
|
|
||||||
DK_DATABESKYTTELSESLOVEN: { collection: 'bp_compliance_gesetze', chunks: 2 },
|
// === Nationale Gesetze (andere EU) in bp_compliance_gesetze ===
|
||||||
LU_DPA_LAW: { collection: 'bp_compliance_gesetze', chunks: 2 },
|
ES_LOPDGDD: { collection: 'bp_compliance_gesetze', chunks: 782, qdrant_id: 'es_lopdgdd' },
|
||||||
// EDPB Guidelines (bp_compliance_datenschutz)
|
IT_CODICE_PRIVACY: { collection: 'bp_compliance_gesetze', chunks: 59, qdrant_id: 'it_codice_privacy' },
|
||||||
EDPB_GUIDELINES_5_2020: { collection: 'bp_compliance_datenschutz', chunks: 245 },
|
NL_UAVG: { collection: 'bp_compliance_gesetze', chunks: 523, qdrant_id: 'nl_uavg' },
|
||||||
EDPB_GUIDELINES_7_2020: { collection: 'bp_compliance_datenschutz', chunks: 347 },
|
FR_CNIL_GUIDE: { collection: 'bp_compliance_gesetze', chunks: 562, qdrant_id: 'fr_loi_informatique' },
|
||||||
// Frameworks (bp_compliance_datenschutz)
|
IE_DPA_2018: { collection: 'bp_compliance_gesetze', chunks: 64, qdrant_id: 'ie_dpa_2018' },
|
||||||
ENISA_SECURE_BY_DESIGN: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
UK_DPA_2018: { collection: 'bp_compliance_gesetze', chunks: 156, qdrant_id: 'uk_dpa_2018' },
|
||||||
ENISA_SUPPLY_CHAIN: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
UK_GDPR: { collection: 'bp_compliance_gesetze', chunks: 45, qdrant_id: 'uk_gdpr' },
|
||||||
NIST_SSDF: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
NO_PERSONOPPLYSNINGSLOVEN: { collection: 'bp_compliance_gesetze', chunks: 41, qdrant_id: 'no_pol' },
|
||||||
NIST_CSF_2: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
SE_DATASKYDDSLAG: { collection: 'bp_compliance_gesetze', chunks: 56, qdrant_id: 'se_dataskyddslag' },
|
||||||
OECD_AI_PRINCIPLES: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
PL_UODO: { collection: 'bp_compliance_gesetze', chunks: 39, qdrant_id: 'pl_ustawa' },
|
||||||
EFRAG_ENDORSEMENT: { collection: 'bp_compliance_datenschutz', chunks: 0 },
|
CZ_ZOU: { collection: 'bp_compliance_gesetze', chunks: 238, qdrant_id: 'cz_zakon' },
|
||||||
|
HU_INFOTV: { collection: 'bp_compliance_gesetze', chunks: 747, qdrant_id: 'hu_info_tv' },
|
||||||
|
LU_DPA_LAW: { collection: 'bp_compliance_gesetze', chunks: 2, qdrant_id: 'lu_dpa_law' },
|
||||||
|
|
||||||
|
// === EDPB Guidelines (bp_compliance_datenschutz) ===
|
||||||
|
EDPB_GUIDELINES_5_2020: { collection: 'bp_compliance_datenschutz', chunks: 236, qdrant_id: 'edpb_05_2020' },
|
||||||
|
EDPB_GUIDELINES_7_2020: { collection: 'bp_compliance_datenschutz', chunks: 347, qdrant_id: 'edpb_guidelines_7_2020' },
|
||||||
|
EDPB_GUIDELINES_1_2020: { collection: 'bp_compliance_datenschutz', chunks: 337, qdrant_id: 'edpb_01_2020' },
|
||||||
|
EDPB_GUIDELINES_1_2022: { collection: 'bp_compliance_datenschutz', chunks: 510, qdrant_id: 'edpb_01_2022' },
|
||||||
|
EDPB_GUIDELINES_2_2023: { collection: 'bp_compliance_datenschutz', chunks: 94, qdrant_id: 'edpb_02_2023' },
|
||||||
|
EDPB_GUIDELINES_2_2024: { collection: 'bp_compliance_datenschutz', chunks: 79, qdrant_id: 'edpb_02_2024' },
|
||||||
|
EDPB_GUIDELINES_4_2019: { collection: 'bp_compliance_datenschutz', chunks: 202, qdrant_id: 'edpb_04_2019' },
|
||||||
|
EDPB_GUIDELINES_9_2022: { collection: 'bp_compliance_datenschutz', chunks: 243, qdrant_id: 'edpb_09_2022' },
|
||||||
|
EDPB_DPIA_LIST: { collection: 'bp_compliance_datenschutz', chunks: 29, qdrant_id: 'edpb_dpia_list' },
|
||||||
|
EDPB_LEGITIMATE_INTEREST: { collection: 'bp_compliance_datenschutz', chunks: 336, qdrant_id: 'edpb_legitimate_interest' },
|
||||||
|
EDPS_DPIA_LIST: { collection: 'bp_compliance_datenschutz', chunks: 35, qdrant_id: 'edps_dpia_list' },
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -151,20 +167,19 @@ export const REGULATION_INFO: RegulationInfo[] = [
|
|||||||
{ code: 'EU_IFRS_EN', name: 'EU-IFRS (EN)', type: 'eu_regulation' },
|
{ code: 'EU_IFRS_EN', name: 'EU-IFRS (EN)', type: 'eu_regulation' },
|
||||||
// DE Gesetze
|
// DE Gesetze
|
||||||
{ code: 'TDDDG', name: 'TDDDG', type: 'de_law' },
|
{ code: 'TDDDG', name: 'TDDDG', type: 'de_law' },
|
||||||
|
{ code: 'TMG_KOMPLETT', name: 'TMG', type: 'de_law' },
|
||||||
{ code: 'BDSG_FULL', name: 'BDSG', type: 'de_law' },
|
{ code: 'BDSG_FULL', name: 'BDSG', type: 'de_law' },
|
||||||
{ code: 'DE_DDG', name: 'DDG', type: 'de_law' },
|
{ code: 'DE_DDG', name: 'DDG', type: 'de_law' },
|
||||||
{ code: 'DE_BGB_AGB', name: 'BGB/AGB', type: 'de_law' },
|
{ code: 'DE_BGB_AGB', name: 'BGB/AGB', type: 'de_law' },
|
||||||
{ code: 'DE_EGBGB', name: 'EGBGB', type: 'de_law' },
|
{ code: 'DE_EGBGB', name: 'EGBGB', type: 'de_law' },
|
||||||
{ code: 'DE_HGB_RET', name: 'HGB', type: 'de_law' },
|
{ code: 'DE_HGB_RET', name: 'HGB', type: 'de_law' },
|
||||||
{ code: 'DE_AO_RET', name: 'AO', type: 'de_law' },
|
{ code: 'DE_AO_RET', name: 'AO', type: 'de_law' },
|
||||||
{ code: 'DE_UWG', name: 'UWG', type: 'de_law' },
|
|
||||||
{ code: 'DE_TKG', name: 'TKG', type: 'de_law' },
|
{ code: 'DE_TKG', name: 'TKG', type: 'de_law' },
|
||||||
{ code: 'DE_PANGV', name: 'PAngV', type: 'de_law' },
|
|
||||||
{ code: 'DE_DLINFOV', name: 'DL-InfoV', type: 'de_law' },
|
{ code: 'DE_DLINFOV', name: 'DL-InfoV', type: 'de_law' },
|
||||||
{ code: 'DE_BETRVG', name: 'BetrVG', type: 'de_law' },
|
{ code: 'DE_BETRVG', name: 'BetrVG', type: 'de_law' },
|
||||||
{ code: 'DE_GESCHGEHG', name: 'GeschGehG', type: 'de_law' },
|
{ code: 'DE_GESCHGEHG', name: 'GeschGehG', type: 'de_law' },
|
||||||
{ code: 'DE_BSIG', name: 'BSIG', type: 'de_law' },
|
|
||||||
{ code: 'DE_USTG_RET', name: 'UStG', type: 'de_law' },
|
{ code: 'DE_USTG_RET', name: 'UStG', type: 'de_law' },
|
||||||
|
{ code: 'DE_URHG', name: 'UrhG', type: 'de_law' },
|
||||||
// BSI
|
// BSI
|
||||||
{ code: 'BSI-TR-03161-1', name: 'BSI-TR Teil 1', type: 'bsi_standard' },
|
{ code: 'BSI-TR-03161-1', name: 'BSI-TR Teil 1', type: 'bsi_standard' },
|
||||||
{ code: 'BSI-TR-03161-2', name: 'BSI-TR Teil 2', type: 'bsi_standard' },
|
{ code: 'BSI-TR-03161-2', name: 'BSI-TR Teil 2', type: 'bsi_standard' },
|
||||||
@@ -185,13 +200,9 @@ export const REGULATION_INFO: RegulationInfo[] = [
|
|||||||
{ code: 'CH_DSG', name: 'DSG Schweiz', type: 'ch_law' },
|
{ code: 'CH_DSG', name: 'DSG Schweiz', type: 'ch_law' },
|
||||||
{ code: 'CH_DSV', name: 'DSV', type: 'ch_law' },
|
{ code: 'CH_DSV', name: 'DSV', type: 'ch_law' },
|
||||||
{ code: 'CH_OR_AGB', name: 'OR/AGB', type: 'ch_law' },
|
{ code: 'CH_OR_AGB', name: 'OR/AGB', type: 'ch_law' },
|
||||||
{ code: 'CH_UWG', name: 'UWG CH', type: 'ch_law' },
|
|
||||||
{ code: 'CH_FMG', name: 'FMG', type: 'ch_law' },
|
|
||||||
{ code: 'CH_GEBUV', name: 'GeBuV', type: 'ch_law' },
|
{ code: 'CH_GEBUV', name: 'GeBuV', type: 'ch_law' },
|
||||||
{ code: 'CH_ZERTES', name: 'ZertES', type: 'ch_law' },
|
{ code: 'CH_ZERTES', name: 'ZertES', type: 'ch_law' },
|
||||||
{ code: 'CH_ZGB_PERS', name: 'ZGB', type: 'ch_law' },
|
{ code: 'CH_ZGB_PERS', name: 'ZGB', type: 'ch_law' },
|
||||||
// LI
|
|
||||||
{ code: 'LI_DSG', name: 'DSG Liechtenstein', type: 'national_law' },
|
|
||||||
// Andere EU nationale
|
// Andere EU nationale
|
||||||
{ code: 'ES_LOPDGDD', name: 'LOPDGDD Spanien', type: 'national_law' },
|
{ code: 'ES_LOPDGDD', name: 'LOPDGDD Spanien', type: 'national_law' },
|
||||||
{ code: 'IT_CODICE_PRIVACY', name: 'Codice Privacy Italien', type: 'national_law' },
|
{ code: 'IT_CODICE_PRIVACY', name: 'Codice Privacy Italien', type: 'national_law' },
|
||||||
@@ -205,18 +216,26 @@ export const REGULATION_INFO: RegulationInfo[] = [
|
|||||||
{ code: 'PL_UODO', name: 'UODO Polen', type: 'national_law' },
|
{ code: 'PL_UODO', name: 'UODO Polen', type: 'national_law' },
|
||||||
{ code: 'CZ_ZOU', name: 'Zakon Tschechien', type: 'national_law' },
|
{ code: 'CZ_ZOU', name: 'Zakon Tschechien', type: 'national_law' },
|
||||||
{ code: 'HU_INFOTV', name: 'Infotv. Ungarn', type: 'national_law' },
|
{ code: 'HU_INFOTV', name: 'Infotv. Ungarn', type: 'national_law' },
|
||||||
{ code: 'BE_DPA_LAW', name: 'Datenschutzgesetz Belgien', type: 'national_law' },
|
|
||||||
{ code: 'FI_TIETOSUOJALAKI', name: 'Tietosuojalaki Finnland', type: 'national_law' },
|
|
||||||
{ code: 'DK_DATABESKYTTELSESLOVEN', name: 'Databeskyttelsesloven DK', type: 'national_law' },
|
|
||||||
{ code: 'LU_DPA_LAW', name: 'Datenschutzgesetz Luxemburg', type: 'national_law' },
|
{ code: 'LU_DPA_LAW', name: 'Datenschutzgesetz Luxemburg', type: 'national_law' },
|
||||||
// EDPB
|
// EDPB
|
||||||
{ code: 'EDPB_GUIDELINES_5_2020', name: 'EDPB GL Einwilligung', type: 'eu_guideline' },
|
{ code: 'EDPB_GUIDELINES_5_2020', name: 'EDPB GL Einwilligung', type: 'eu_guideline' },
|
||||||
{ code: 'EDPB_GUIDELINES_7_2020', name: 'EDPB GL C/P Konzepte', type: 'eu_guideline' },
|
{ code: 'EDPB_GUIDELINES_7_2020', name: 'EDPB GL C/P Konzepte', type: 'eu_guideline' },
|
||||||
// Frameworks
|
{ code: 'EDPB_GUIDELINES_1_2020', name: 'EDPB GL Fahrzeuge', type: 'eu_guideline' },
|
||||||
{ code: 'ENISA_SECURE_BY_DESIGN', name: 'ENISA Secure by Design', type: 'international_standard' },
|
{ code: 'EDPB_GUIDELINES_1_2022', name: 'EDPB GL Bussgelder', type: 'eu_guideline' },
|
||||||
{ code: 'ENISA_SUPPLY_CHAIN', name: 'ENISA Supply Chain', type: 'international_standard' },
|
{ code: 'EDPB_GUIDELINES_2_2023', name: 'EDPB GL Art. 37 Scope', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPB_GUIDELINES_2_2024', name: 'EDPB GL 2024', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPB_GUIDELINES_4_2019', name: 'EDPB GL Art. 25 DPbD', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPB_GUIDELINES_9_2022', name: 'EDPB GL Datenschutzverletzung', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPB_DPIA_LIST', name: 'EDPB DPIA-Liste', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPB_LEGITIMATE_INTEREST', name: 'EDPB Berecht. Interesse', type: 'eu_guideline' },
|
||||||
|
{ code: 'EDPS_DPIA_LIST', name: 'EDPS DPIA-Liste', type: 'eu_guideline' },
|
||||||
|
// International Standards
|
||||||
{ code: 'NIST_SSDF', name: 'NIST SSDF', type: 'international_standard' },
|
{ code: 'NIST_SSDF', name: 'NIST SSDF', type: 'international_standard' },
|
||||||
{ code: 'NIST_CSF_2', name: 'NIST CSF 2.0', type: 'international_standard' },
|
{ code: 'NIST_CSF_2', name: 'NIST CSF 2.0', type: 'international_standard' },
|
||||||
{ code: 'OECD_AI_PRINCIPLES', name: 'OECD AI Principles', type: 'international_standard' },
|
{ code: 'OECD_AI_PRINCIPLES', name: 'OECD AI Principles', type: 'international_standard' },
|
||||||
{ code: 'EFRAG_ENDORSEMENT', name: 'EFRAG Endorsement', type: 'eu_guideline' },
|
{ code: 'ENISA_SECURE_BY_DESIGN', name: 'CISA Secure by Design', type: 'international_standard' },
|
||||||
|
{ code: 'ENISA_SUPPLY_CHAIN', name: 'ENISA Supply Chain', type: 'international_standard' },
|
||||||
|
{ code: 'ENISA_THREAT_LANDSCAPE', name: 'ENISA Threat Landscape', type: 'international_standard' },
|
||||||
|
{ code: 'ENISA_ICS_SCADA', name: 'ENISA ICS/SCADA', type: 'international_standard' },
|
||||||
|
{ code: 'ENISA_CYBERSECURITY_2024', name: 'ENISA Cybersecurity 2024', type: 'international_standard' },
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -121,24 +121,25 @@ export async function GET(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
case 'regulation-counts-batch': {
|
case 'regulation-counts-batch': {
|
||||||
const col = searchParams.get('collection') || 'bp_compliance_gesetze'
|
const col = searchParams.get('collection') || 'bp_compliance_gesetze'
|
||||||
const codes = (searchParams.get('codes') || '').split(',').filter(Boolean)
|
// Accept qdrant_ids (actual regulation_id values in Qdrant payload)
|
||||||
|
const qdrantIds = (searchParams.get('qdrant_ids') || '').split(',').filter(Boolean)
|
||||||
const results: Record<string, number> = {}
|
const results: Record<string, number> = {}
|
||||||
for (let i = 0; i < codes.length; i += 10) {
|
for (let i = 0; i < qdrantIds.length; i += 10) {
|
||||||
const batch = codes.slice(i, i + 10)
|
const batch = qdrantIds.slice(i, i + 10)
|
||||||
await Promise.all(batch.map(async (code) => {
|
await Promise.all(batch.map(async (qid) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${QDRANT_URL}/collections/${encodeURIComponent(col)}/points/count`, {
|
const res = await fetch(`${QDRANT_URL}/collections/${encodeURIComponent(col)}/points/count`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
filter: { must: [{ key: 'regulation_code', match: { value: code } }] },
|
filter: { must: [{ key: 'regulation_id', match: { value: qid } }] },
|
||||||
exact: true,
|
exact: true,
|
||||||
}),
|
}),
|
||||||
cache: 'no-store',
|
cache: 'no-store',
|
||||||
})
|
})
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
results[code] = data.result?.count || 0
|
results[qid] = data.result?.count || 0
|
||||||
}
|
}
|
||||||
} catch { /* skip failed counts */ }
|
} catch { /* skip failed counts */ }
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user