From ce84dc9ed95099eb1aee42cfc78aba1e41c57077 Mon Sep 17 00:00:00 2001 From: emgeier Date: Fri, 5 Dec 2025 10:20:41 -0600 Subject: [PATCH 1/2] error messaging and query prevention for source only persons queries temporary until rdf update --- .gitignore | 7 +++++++ dev.html | 2 +- mode.js | 22 +++++++++++++++++++++- modes/person.js | 1 + person/person.json | 40 ---------------------------------------- person/search.js | 19 +++++++++++++++++++ 6 files changed, 49 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 075d850f0..1a8a61c5b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,10 @@ autodeploy2 autodeploy dev-neptune-queries/* +dev/* +dev-neptune-queries +PersonURIs_SPEAR.txt +PersonURIs_SPEAR_sorted.txt +missing_from_person_json.txt +person_values.txt +person_values_sorted.txt \ No newline at end of file diff --git a/dev.html b/dev.html index 755e0aa08..aebe11db0 100644 --- a/dev.html +++ b/dev.html @@ -113,7 +113,7 @@
-
+
diff --git a/mode.js b/mode.js index c98d37237..4e71bac1c 100644 --- a/mode.js +++ b/mode.js @@ -1,5 +1,6 @@ // mode.js + export function boot({ registry, defaultType = 'person' } = {}) { const state = { type: null, filters: {} }; @@ -63,14 +64,33 @@ export function boot({ registry, defaultType = 'person' } = {}) { state.type = type; togglePanels(type); + + function showUserFacetError(msg) { + console.warn("Showing user facet error:", msg); + const container = document.getElementById("source-error-container"); + if (!container) return; + + container.innerHTML = ` +
+ ${msg} +
+ `; + } + const runSearch = async () => { if (!mode.fetch || !mode.render) return; try { const rows = await mode.fetch(state); - if (!rows) { + // Early exit for source only facet error + if (!rows) { return; } + if (rows?.error) { + showUserFacetError(rows.message); + return; // STOP — do not call mode.render + } + mode.render(rows, state); } catch (err) { console.error('Search failed:', err); diff --git a/modes/person.js b/modes/person.js index c6260d51f..339cb46cf 100644 --- a/modes/person.js +++ b/modes/person.js @@ -69,6 +69,7 @@ export default { +
diff --git a/person/person.json b/person/person.json index 4f1adc886..da91c6fbd 100644 --- a/person/person.json +++ b/person/person.json @@ -8074,26 +8074,6 @@ "value": "A patriarch of Antioch about whom only very little is known, Euphrasius came to the episcopal throne in 521 and was in all likelihood a fierce persecutor of the miaphysites. He was killed in an earthquake that struck Antioch in 526, an end which for later miaphysite authors seemed fitting because of his deeds." } }, - { - "person": { - "type": "uri", - "value": "http://syriaca.org/person/2278" - }, - "label_en": { - "xml:lang": "en", - "type": "literal", - "value": "Euphrasios" - }, - "label_syr": { - "xml:lang": "syr", - "type": "literal", - "value": "ܐܘܦܪܘܣ" - }, - "description": { - "type": "literal", - "value": "A patriarch of Antioch about whom only very little is known, Euphrasius came to the episcopal throne in 521 and was in all likelihood a fierce persecutor of the miaphysites. He was killed in an earthquake that struck Antioch in 526, an end which for later miaphysite authors seemed fitting because of his deeds." - } - }, { "person": { "type": "uri", @@ -8474,26 +8454,6 @@ "value": "Eutyches was a controversial and polemical monastic teacher active in Constantinople in the early fifth century. He opposed dyophysite (two-nature) Christology, but the precise nature of his own one-nature Christology is uncertain. He was condemned in 448 at a synod, restored in 449 at the Second Council of Ephesus , and condemned again at the Council of Chalcedon where he was championed by the Syriac monk Barsauma . In later theological discussions, Eutyches' one-nature Christology was equally condemned by Chalcedonian theologians and the Coptic and Syriac Orthodox Churches. Eutyches was archimandrite of a monk in Constantinople and opposed the doctrine of the two natures in Christ. He was condemned as a heretic at the council of Chalcedon in 451 for supposedly denying the human nature in Christ." } }, - { - "person": { - "type": "uri", - "value": "http://syriaca.org/person/482" - }, - "label_en": { - "xml:lang": "en", - "type": "literal", - "value": "Eutyches" - }, - "label_syr": { - "xml:lang": "syr", - "type": "literal", - "value": "ܐܘܛܘܟܝܢܣܛܐ (used as adjective)" - }, - "description": { - "type": "literal", - "value": "Eutyches was a controversial and polemical monastic teacher active in Constantinople in the early fifth century. He opposed dyophysite (two-nature) Christology, but the precise nature of his own one-nature Christology is uncertain. He was condemned in 448 at a synod, restored in 449 at the Second Council of Ephesus , and condemned again at the Council of Chalcedon where he was championed by the Syriac monk Barsauma . In later theological discussions, Eutyches' one-nature Christology was equally condemned by Chalcedonian theologians and the Coptic and Syriac Orthodox Churches. Eutyches was archimandrite of a monk in Constantinople and opposed the doctrine of the two natures in Christ. He was condemned as a heretic at the council of Chalcedon in 451 for supposedly denying the human nature in Christ." - } - }, { "person": { "type": "uri", diff --git a/person/search.js b/person/search.js index 819a1f409..5892c61f5 100644 --- a/person/search.js +++ b/person/search.js @@ -156,6 +156,25 @@ export async function fetchData(state) { const query = buildMultiFilterQuery(state); console.log("Build Person MultiFilterQuery with state:", state); console.log('Fetching persons with multi-type query:', query); + + // --- EARLY EXIT CONDITION: Source-only selection crashes Neptune--- + const onlySourceSelected = + state.selectedSourceKeywords.size > 0 && state.selectedSourceKeywords.size < 3 && + (!state.persons || state.persons.length === 0) && + state.selectedEventKeywords.size === 0 && + state.selectedRelationshipKeywords.size === 0 && + state.selectedOccupationKeywords.size === 0 && + state.selectedGenderKeywords.size === 0 && + state.selectedPlaceKeywords.size === 0; + + if (onlySourceSelected) { + console.warn("Source-only facet query prevented."); + return { + error: true, + message: "Source choice alone is insufficient for query. Please select at least one additional facet.", + rows: [] + }; + } query.split('\n').forEach((line,i)=>console.log(String(i+1).padStart(3,' '), line)); const controller = new AbortController(); From 419b6eb8448397076be63273b0977ece247729cd Mon Sep 17 00:00:00 2001 From: Erin Geier <115035002+emgeier@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:17:13 -0600 Subject: [PATCH 2/2] Update all_code_to_s3.yml --- .github/workflows/all_code_to_s3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all_code_to_s3.yml b/.github/workflows/all_code_to_s3.yml index 1a97e7ec6..ab140f880 100644 --- a/.github/workflows/all_code_to_s3.yml +++ b/.github/workflows/all_code_to_s3.yml @@ -49,4 +49,4 @@ jobs: --paths "/*" env: AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} \ No newline at end of file + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}