Skip to content
Snippets Groups Projects
Commit 8d5affa8 authored by Esko Ikkala's avatar Esko Ikkala
Browse files

Improve tgn suggestions, use only simple suggestions

parent 65b7e54c
No related branches found
No related tags found
No related merge requests found
......@@ -4,24 +4,24 @@ module.exports = {
'shortTitle': 'KMN',
'timePeriod': '1922-1944',
'endpoint': 'http://ldf.fi/warsa/sparql',
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
GRAPH <http://ldf.fi/warsa/places/karelian_places> {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
}
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
}
GROUP BY ?label
ORDER BY DESC(MAX(?score)) ?label
LIMIT 50
`,
// 'suggestionQuery': `
// PREFIX text: <http://jena.apache.org/text#>
// PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
// PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
// PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
// PREFIX gs: <http://www.opengis.net/ont/geosparql#>
// SELECT DISTINCT ?label (COUNT(?s) AS ?count)
// WHERE {
// GRAPH <http://ldf.fi/warsa/places/karelian_places> {
// (?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
// }
// ?s skos:prefLabel ?lbl .
// BIND(STR(?lbl) AS ?label)
// }
// GROUP BY ?label
// ORDER BY DESC(MAX(?score)) ?label
// LIMIT 50
// `,
'simpleSuggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
......@@ -73,23 +73,23 @@ module.exports = {
'timePeriod': '1939-1944',
'lang': '',
'endpoint': 'http://ldf.fi/warsa/sparql',
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
GRAPH <http://ldf.fi/warsa/places/municipalities> {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
}
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
}
GROUP BY ?label
ORDER BY DESC(MAX(?score)) ?label
`,
// 'suggestionQuery': `
// PREFIX text: <http://jena.apache.org/text#>
// PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
// PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
// PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
// PREFIX gs: <http://www.opengis.net/ont/geosparql#>
// SELECT DISTINCT ?label (COUNT(?s) AS ?count)
// WHERE {
// GRAPH <http://ldf.fi/warsa/places/municipalities> {
// (?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
// }
// ?s skos:prefLabel ?lbl .
// BIND(STR(?lbl) AS ?label)
// }
// GROUP BY ?label
// ORDER BY DESC(MAX(?score)) ?label
// `,
'simpleSuggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
......@@ -184,48 +184,61 @@ module.exports = {
'tgn': {
// Getty LOD documentation:
// http://vocab.getty.edu/queries#Places_by_Type
// http://vocab.getty.edu/doc/#TGN_Place_Types
// http://vocab.getty.edu/doc/queries/#Full_Text_Search_Query
// https://groups.google.com/forum/#!topic/gettyvocablod/r4wsSJyne84
// https://confluence.ontotext.com/display/OWLIMv54/OWLIM-SE+Full-text+Search
// http://vocab.getty.edu/queries#Combination_Full-Text_and_Exact_String_Match
// http://vocab.getty.edu/doc/#TGN_Place_Types
'title': 'The Getty Thesaurus of Geographic Names',
'shortTitle': 'TGN',
'timePeriod': 'contemporary',
'endpoint': 'http://vocab.getty.edu/sparql.json',
'simpleSuggestionQuery': 'SELECT+DISTINCT+?label{?s+a+skos:Concept;+luc:term+"<QUERYTERM>*";+skos:inScheme+tgn:;gvp:prefLabelGVP/xl:literalForm+?lbl+.+BIND(STR(?lbl)+AS+?label)}LIMIT+20',
'simpleSuggestionQuery':
'SELECT+DISTINCT+?label+' +
'WHERE+{' +
'?s+a+skos:Concept;+' +
'luc:term+"<QUERYTERM>*";+' +
'skos:inScheme+tgn:;' +
'gvp:prefLabelGVP/xl:literalForm+?lbl+.' +
'+BIND(STR(?lbl)+AS+?label)' +
'FILTER+(STRSTARTS(LCASE(?lbl),+"<QUERYTERM>"))' +
'}' +
'LIMIT+20',
'resultQuery':
'SELECT+?s+(COALESCE(?labelEn,?labelGVP)+AS+?label)+?typeLabel+?broaderAreaLabel+?source+?lat+?long' +
'{?s+luc:term+"<QUERYTERM>";+' +
'SELECT+?s+(COALESCE(?labelEn,?labelGVP)+AS+?label)+?typeLabel+?broaderAreaLabel+?source+?lat+?long+' +
'WHERE+{' +
'?s+luc:term+"<QUERYTERM>";+' +
'skos:inScheme+tgn:;+' +
'gvp:placeTypePreferred+[gvp:prefLabelGVP+[xl:literalForm+?typeLabel;dct:language+gvp_lang:en]];+' +
'gvp:parentStringAbbrev+?broaderAreaLabel+.+' +
'OPTIONAL+{?s+xl:prefLabel+[xl:literalForm+?labelEn;+dct:language+gvp_lang:en]}+' +
'OPTIONAL{?s+gvp:prefLabelGVP+[xl:literalForm?labelGVP]}+' +
'OPTIONAL{?s+foaf:focus+?place+.+?place+wgs:lat+?lat;+wgs:long+?long}+' +
'BIND("TGN"+AS+?source)+}',
'FILTER+EXISTS+{?s+xl:prefLabel/gvp:term+?term+.+FILTER+(LCASE(STR(?term))="<QUERYTERM>")}' +
'BIND("TGN"+AS+?source)+' +
'}',
},
'kotus': {
'title': 'Institute for the Languages of Finland (Kotus) Digital Names archive',
'shortTitle': 'DNA',
'endpoint': 'http://ldf.fi/kotus-digital-names-archive/sparql',
//'endpoint': 'http://localhost:3037/ds/sparql',
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
PREFIX hipla: <http://ldf.fi/schema/hipla/>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
?s hipla:type [] .
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
}
ORDER BY DESC(MAX(?score)) ?label
LIMIT 50
`,
// 'suggestionQuery': `
// PREFIX text: <http://jena.apache.org/text#>
// PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
// PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
// PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
// PREFIX gs: <http://www.opengis.net/ont/geosparql#>
// PREFIX hipla: <http://ldf.fi/schema/hipla/>
// SELECT DISTINCT ?label (COUNT(?s) AS ?count)
// WHERE {
// (?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
// ?s hipla:type [] .
// ?s skos:prefLabel ?lbl .
// BIND(STR(?lbl) AS ?label)
// }
// ORDER BY DESC(MAX(?score)) ?label
// LIMIT 20
// `,
'simpleSuggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
......
......@@ -20,7 +20,6 @@ class SparqlApi {
return new Promise((resolve, reject) => {
if (this.endpoint === 'http://vocab.getty.edu/sparql.json') {
//const q = 'select*{?s+a+gvp:Facet;skos:inScheme+aat:;gvp:prefLabelGVP/xl:literalForm?label}';
const url = this.endpoint + '?query=' + query;
fetch(url)
.then(response => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment