Skip to content

Commit

Permalink
Update termennetwerk source to get better mactches
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogier Bom committed Nov 4, 2023
1 parent a6ad628 commit d9ebfe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/components/DataEditor/DataEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function renderImage(item: any) {
// }
function getResult() {
manifestStore.resetTerms()
let url =
'https://nijdam.nu/maniiifision-api/?imageUrl=' +
manifestStore.getCurrentImage() +
Expand Down Expand Up @@ -137,7 +138,8 @@ async function fetchTerms(name: string) {
query Terms {
terms(
sources: [
"https://query.wikidata.org/sparql#entities-all",
"https://data.beeldengeluid.nl/id/datadownload/0031",
"http://vocab.getty.edu/aat/sparql",
]
query: "${name}"
queryMode: OPTIMIZED
Expand Down Expand Up @@ -169,7 +171,8 @@ async function fetchTerms(name: string) {
)
.then((res) => res.json())
.then((result) => {
manifestStore.addTerm(result.data.terms[0].result.terms.slice(0, 5))
manifestStore.addTerm(
result.data.terms.flatMap((element) => element.result.terms).slice(0, 5))

Check failure on line 175 in src/components/DataEditor/DataEditor.vue

View workflow job for this annotation

GitHub Actions / publish

Parameter 'element' implicitly has an 'any' type.
})
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/stores/manifest.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const useManifest = defineStore('manifest', {
updateItems(items: any) {
this.items = items
},
setTerms(terms: any) {
this.terms = terms
resetTerms() {
this.terms = []
},
addTerm(term: any) {
this.terms.push(term)
Expand Down

0 comments on commit d9ebfe4

Please sign in to comment.