Skip to main content

Changing the Default Autocomplete Query

The default autocomplete query of PoolParty can be overruled by a query provided via a file named AutocompleteSetup.xml.

Note

This guide assumes the following:

  • You have installed PoolParty to the default directory (also see Installation Guide).Installation Guide

  • You also you have no service running on the server using port 80.

The file has to be placed in PoolParty's configuration folder in the following locations respectively:

  • Linux: /opt/poolparty/config/

  • Windows: C:\Users\Public\PoolParty\config\

You can edit the file by accessing it from:

Expand the Tools menu, click the Admin Scripts menu entry, then click the Autocomplete Settings link.

23901760.png

Note

If you change the file directly you have to restart the server.

Changing the default autocomplete query to a query of your choice can affect performance.

Search for URIs in Your Thesaurus Using Autocomplete

This section contains a short guide on how to adjust the default autocomplete query in PoolParty to enable a URI search.

Note

Your user needs to have the PoolPartySuperAdmin role assigned in order for you to be able to edit this query.

The previous section explains how to edit the autocomplete query in PoolParty.

You can edit that query as follows. The autocomplete function provided in the search bar at the top will then enable the search for URIs throughout the current thesaurus via autocomplete.

Use the following SPARQL query, which represents an extension on the default PoolParty is shipped with:

SPARL Query to Enable URI Search in PoolParty

PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?ID
FROM <%%%graph%%%>
WHERE {
{
?ID a skos:Concept.
FILTER(regex('%%%searchString%%%', '^https?://', 'i') = true)
FILTER(str(?ID) = replace('%%%searchString%%%', '\\\\\\.', '\\.'))
} UNION {
?ID a skos:Concept .
FILTER(regex('%%%searchString%%%', '^https?://', 'i') = false)
{
?ID skos:prefLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '^%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
} UNION {
?ID skos:prefLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
} UNION {
?ID skos:altLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '^%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
} UNION {
?ID skos:altLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
} UNION {
?ID skos:hiddenLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '^%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
} UNION {
?ID skos:hiddenLabel ?searchLabel . 
FILTER(regex(LCASE(str(?searchLabel)), '%%%searchString%%%', 'i') && lang(?searchLabel)='%%%lang%%%')
}
}
} LIMIT %%%limit%%%

In order to make use of this query, expand the Tools menu, click the Admin Scripts menu entry, then click the Autocomplete Settings link. The editing field opens.

Follow these steps:

  1. Replace the whole entry in the Autocomplete Query field with this one.

  2. Click Submit.