Sfoglia il codice sorgente

queries migliorate, aggiunta query toponimi + antroponimi

Francesco 2 anni fa
parent
commit
a9e2eb3dfe
2 ha cambiato i file con 5 aggiunte e 22 eliminazioni
  1. 0 17
      js/lettera.js
  2. 5 5
      js/lettera_query.js

File diff suppressed because it is too large
+ 0 - 17
js/lettera.js


+ 5 - 5
js/lettera_query.js

@@ -35,9 +35,9 @@ async function doJsonQuery(query, isUnique = false){
 
     let out = response['results']['bindings'];
     if(!isUnique) return out;
-    if(!out.length) throw "Letter not found";
-    if(out.length>1) throw "Ambiguity -- multiple letters matching URI";
-    return out;
+    if(!out.length) throw "ERROR: Letter not found";
+    if(out.length>1) throw "ERROR: ambiguity in search -- multiple letters matching search parameters";
+    return out[0];
 
 }
 
@@ -137,13 +137,13 @@ rdfs:label ?raccolta . \
 ?racc_type rdfs:label 'Raccolta'. \
 }"
 
-queryToponimo = prefixes + "SELECT DISTINCT ?link_toponimo ?toponimo \
+queryToponimi = prefixes + "SELECT DISTINCT ?link_toponimo ?toponimo \
 WHERE {<" + thisUrlParams.link + "> crm:P67_refers_to ?link_toponimo . \
 ?link_toponimo rdfs:label ?toponimo ; \
 crm:P2_has_type 'Toponimo' . \
 }"
 
-queryAntroponimo = prefixes + "SELECT DISTINCT * \
+queryAntroponimi = prefixes + "SELECT DISTINCT * \
 WHERE {<" + thisUrlParams.link + "> crm:P67_refers_to ?link_antroponimo . \
 ?link_antroponimo rdfs:label ?antroponimo; \
 crm:P2_has_type 'Antroponimo'}"

Some files were not shown because too many files changed in this diff