Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
8d5affa8
Commit
8d5affa8
authored
6 years ago
by
Esko Ikkala
Browse files
Options
Downloads
Patches
Plain Diff
Improve tgn suggestions, use only simple suggestions
parent
65b7e54c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/server/Datasets.js
+71
-58
71 additions, 58 deletions
src/server/Datasets.js
src/server/SparqlApi.js
+0
-1
0 additions, 1 deletion
src/server/SparqlApi.js
with
71 additions
and
59 deletions
src/server/Datasets.js
+
71
−
58
View file @
8d5affa8
...
@@ -4,24 +4,24 @@ module.exports = {
...
@@ -4,24 +4,24 @@ module.exports = {
'
shortTitle
'
:
'
KMN
'
,
'
shortTitle
'
:
'
KMN
'
,
'
timePeriod
'
:
'
1922-1944
'
,
'
timePeriod
'
:
'
1922-1944
'
,
'
endpoint
'
:
'
http://ldf.fi/warsa/sparql
'
,
'
endpoint
'
:
'
http://ldf.fi/warsa/sparql
'
,
'
suggestionQuery
'
:
`
//
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
//
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
//
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
//
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
//
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
//
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
//
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
//
WHERE {
GRAPH <http://ldf.fi/warsa/places/karelian_places> {
//
GRAPH <http://ldf.fi/warsa/places/karelian_places> {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
//
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
}
//
}
?s skos:prefLabel ?lbl .
//
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
//
BIND(STR(?lbl) AS ?label)
}
//
}
GROUP BY ?label
//
GROUP BY ?label
ORDER BY DESC(MAX(?score)) ?label
//
ORDER BY DESC(MAX(?score)) ?label
LIMIT 50
//
LIMIT 50
`
,
//
`,
'
simpleSuggestionQuery
'
:
`
'
simpleSuggestionQuery
'
:
`
PREFIX text: <http://jena.apache.org/text#>
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
...
@@ -73,23 +73,23 @@ module.exports = {
...
@@ -73,23 +73,23 @@ module.exports = {
'
timePeriod
'
:
'
1939-1944
'
,
'
timePeriod
'
:
'
1939-1944
'
,
'
lang
'
:
''
,
'
lang
'
:
''
,
'
endpoint
'
:
'
http://ldf.fi/warsa/sparql
'
,
'
endpoint
'
:
'
http://ldf.fi/warsa/sparql
'
,
'
suggestionQuery
'
:
`
//
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
//
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
//
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
//
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
//
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
//
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
//
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
//
WHERE {
GRAPH <http://ldf.fi/warsa/places/municipalities> {
//
GRAPH <http://ldf.fi/warsa/places/municipalities> {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
//
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
}
//
}
?s skos:prefLabel ?lbl .
//
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
//
BIND(STR(?lbl) AS ?label)
}
//
}
GROUP BY ?label
//
GROUP BY ?label
ORDER BY DESC(MAX(?score)) ?label
//
ORDER BY DESC(MAX(?score)) ?label
`
,
//
`,
'
simpleSuggestionQuery
'
:
`
'
simpleSuggestionQuery
'
:
`
PREFIX text: <http://jena.apache.org/text#>
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
...
@@ -184,48 +184,61 @@ module.exports = {
...
@@ -184,48 +184,61 @@ module.exports = {
'
tgn
'
:
{
'
tgn
'
:
{
// Getty LOD documentation:
// Getty LOD documentation:
// http://vocab.getty.edu/queries#Places_by_Type
// 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://groups.google.com/forum/#!topic/gettyvocablod/r4wsSJyne84
// https://confluence.ontotext.com/display/OWLIMv54/OWLIM-SE+Full-text+Search
// 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
'
,
'
title
'
:
'
The Getty Thesaurus of Geographic Names
'
,
'
shortTitle
'
:
'
TGN
'
,
'
shortTitle
'
:
'
TGN
'
,
'
timePeriod
'
:
'
contemporary
'
,
'
timePeriod
'
:
'
contemporary
'
,
'
endpoint
'
:
'
http://vocab.getty.edu/sparql.json
'
,
'
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
'
:
'
resultQuery
'
:
'
SELECT+?s+(COALESCE(?labelEn,?labelGVP)+AS+?label)+?typeLabel+?broaderAreaLabel+?source+?lat+?long
'
+
'
SELECT+?s+(COALESCE(?labelEn,?labelGVP)+AS+?label)+?typeLabel+?broaderAreaLabel+?source+?lat+?long+
'
+
'
{?s+luc:term+"<QUERYTERM>";+
'
+
'
WHERE+{
'
+
'
?s+luc:term+"<QUERYTERM>";+
'
+
'
skos:inScheme+tgn:;+
'
+
'
skos:inScheme+tgn:;+
'
+
'
gvp:placeTypePreferred+[gvp:prefLabelGVP+[xl:literalForm+?typeLabel;dct:language+gvp_lang:en]];+
'
+
'
gvp:placeTypePreferred+[gvp:prefLabelGVP+[xl:literalForm+?typeLabel;dct:language+gvp_lang:en]];+
'
+
'
gvp:parentStringAbbrev+?broaderAreaLabel+.+
'
+
'
gvp:parentStringAbbrev+?broaderAreaLabel+.+
'
+
'
OPTIONAL+{?s+xl:prefLabel+[xl:literalForm+?labelEn;+dct:language+gvp_lang:en]}+
'
+
'
OPTIONAL+{?s+xl:prefLabel+[xl:literalForm+?labelEn;+dct:language+gvp_lang:en]}+
'
+
'
OPTIONAL{?s+gvp:prefLabelGVP+[xl:literalForm?labelGVP]}+
'
+
'
OPTIONAL{?s+gvp:prefLabelGVP+[xl:literalForm?labelGVP]}+
'
+
'
OPTIONAL{?s+foaf:focus+?place+.+?place+wgs:lat+?lat;+wgs:long+?long}+
'
+
'
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
'
:
{
'
kotus
'
:
{
'
title
'
:
'
Institute for the Languages of Finland (Kotus) Digital Names archive
'
,
'
title
'
:
'
Institute for the Languages of Finland (Kotus) Digital Names archive
'
,
'
shortTitle
'
:
'
DNA
'
,
'
shortTitle
'
:
'
DNA
'
,
'
endpoint
'
:
'
http://ldf.fi/kotus-digital-names-archive/sparql
'
,
'
endpoint
'
:
'
http://ldf.fi/kotus-digital-names-archive/sparql
'
,
//'endpoint': 'http://localhost:3037/ds/sparql',
//'endpoint': 'http://localhost:3037/ds/sparql',
'
suggestionQuery
'
:
`
//
'suggestionQuery': `
PREFIX text: <http://jena.apache.org/text#>
//
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
//
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
//
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
//
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
//
PREFIX gs: <http://www.opengis.net/ont/geosparql#>
PREFIX hipla: <http://ldf.fi/schema/hipla/>
//
PREFIX hipla: <http://ldf.fi/schema/hipla/>
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
//
SELECT DISTINCT ?label (COUNT(?s) AS ?count)
WHERE {
//
WHERE {
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
//
(?s ?score) text:query (skos:prefLabel '<QUERYTERM>*') .
?s hipla:type [] .
//
?s hipla:type [] .
?s skos:prefLabel ?lbl .
//
?s skos:prefLabel ?lbl .
BIND(STR(?lbl) AS ?label)
//
BIND(STR(?lbl) AS ?label)
}
//
}
ORDER BY DESC(MAX(?score)) ?label
//
ORDER BY DESC(MAX(?score)) ?label
LIMIT
5
0
//
LIMIT
2
0
`
,
//
`,
'
simpleSuggestionQuery
'
:
`
'
simpleSuggestionQuery
'
:
`
PREFIX text: <http://jena.apache.org/text#>
PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
...
...
This diff is collapsed.
Click to expand it.
src/server/SparqlApi.js
+
0
−
1
View file @
8d5affa8
...
@@ -20,7 +20,6 @@ class SparqlApi {
...
@@ -20,7 +20,6 @@ class SparqlApi {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
endpoint
===
'
http://vocab.getty.edu/sparql.json
'
)
{
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
;
const
url
=
this
.
endpoint
+
'
?query=
'
+
query
;
fetch
(
url
)
fetch
(
url
)
.
then
(
response
=>
{
.
then
(
response
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment