Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting list of creators / publishers is slow #20

Open
coret opened this issue Dec 5, 2023 · 1 comment
Open

Getting list of creators / publishers is slow #20

coret opened this issue Dec 5, 2023 · 1 comment

Comments

@coret
Copy link
Contributor

coret commented Dec 5, 2023

The search form in the demonstrator has pulldown lists to select a creator and/or publisher. This lists are populated via the SPARQL query:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?creator ?creator_name WHERE {
	?dataset a dcat:Dataset .
	?dataset dct:creator ?creator .
	?creator foaf:name ?creator_name
	FILTER isIRI(?creator) 
	FILTER(LANG(?creator_name) = "" || LANGMATCHES(LANG(?creator_name), "'.$lang.'")) 
	BIND(LCASE(STRDT(STR(?creator_name), xsd:string)) AS ?creator_name2)
} ORDER BY ?creator_name2

This query takes 1.8s ?!? Although the results are cached, these queries must be optimized.

@coret
Copy link
Contributor Author

coret commented Dec 5, 2023

The query with parts commented out has the same responsetime (so the optimization part isn't to be found in the commented out part):

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?creator ?creator_name WHERE {
#   ?dataset a dcat:Dataset .
    ?dataset dct:creator ?creator .
    ?creator foaf:name ?creator_name .
#   FILTER isIRI(?creator) 
#   FILTER(LANG(?creator_name) = "" || LANGMATCHES(LANG(?creator_name), "nl")) 
#   BIND(LCASE(STRDT(STR(?creator_name), xsd:string)) AS ?creator_name2)
}
#ORDER BY ?creator_name2

coret added a commit that referenced this issue Dec 22, 2023
Not a real solution for #20 but at least is looks faster in the GUI (because loading isn't blocking)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant