Newer
Older
import { has } from 'lodash'
import { runSelectQuery } from './SparqlApi'
import { fullTextQuery } from './SparqlQueriesGeneral'
import { makeObjectList } from './SparqlObjectMapper'
const config = backendSearchConfig[resultClass]
let endpoint
if (has(config, 'endpoint')) {
endpoint = config.endpoint
} else {
endpoint = backendSearchConfig[config.perspectiveID].endpoint
}
const { properties } = config
q = q.replace('<QUERY>', `?id text:query ('${queryTerm.toLowerCase()}' 2000) .`)
const results = await runSelectQuery({
query: endpoint.prefixes + q,
resultMapper: makeObjectList,
resultFormat