Skip to content

Commit

Permalink
fix: Point to a correct graph to retrieve creator labels
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Oct 25, 2023
1 parent 5621193 commit 4ed5fdf
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/rdf/query-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Literal, NamedNode } from "rdf-js";
import StreamClient from "sparql-http-client";
import ParsingClient from "sparql-http-client/ParsingClient";

import { Awaited, truthy } from "@/domain/types";
import { truthy } from "@/domain/types";
import { RequestQueryMeta } from "@/graphql/query-meta";
import {
DataCubePublicationStatus,
Expand Down Expand Up @@ -178,13 +178,6 @@ export const searchCubes = async ({
?theme ${ns.schema.name} ?themeName.
`)}
${(creatorValues.length > 0 ? identity : optional)(
sparql`
?iri ${ns.dcterms.creator} ?creator.
?creator ${ns.schema.name} ?creatorLabel.
`
)}
${makeVisualizeDatasetFilter({
includeDrafts: !!includeDrafts,
cubeIriVar: "?iri",
Expand All @@ -195,9 +188,20 @@ export const searchCubes = async ({
${makeInFilter("creator", creatorValues)}
FILTER(!BOUND(?description) || ?lang = LANG(?description))
FILTER(!BOUND(?creatorLabel) || ?lang = LANG(?creatorLabel))
FILTER(!BOUND(?themeName) || ?lang = LANG(?themeName))
${(creatorValues.length > 0 ? identity : optional)(sparql`
?iri ${ns.dcterms.creator} ?creator .
GRAPH <https://lindas.admin.ch/sfa/opendataswiss> {
?creator a ${ns.schema.Organization} ;
${ns.schema.inDefinedTermSet} <https://register.ld.admin.ch/opendataswiss/org> .
OPTIONAL {
?creator ${ns.schema.name} ?creatorLabel .
FILTER(!BOUND(?creatorLabel) || LANG(?creatorLabel) = ?lang)
}
}
`)}
${
query
? `FILTER(
Expand Down

0 comments on commit 4ed5fdf

Please sign in to comment.