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

Lists of GROUP_CONCAT are shown incorrectly #29

Open
graue70 opened this issue Aug 10, 2020 · 0 comments
Open

Lists of GROUP_CONCAT are shown incorrectly #29

graue70 opened this issue Aug 10, 2020 · 0 comments

Comments

@graue70
Copy link
Contributor

graue70 commented Aug 10, 2020

Take the following query for example:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?predicate (GROUP_CONCAT(?alias) AS ?aliases) WHERE {
  { SELECT ?predicate
    WHERE { ?x ql:has-predicate ?predicate }
    GROUP BY ?predicate }
  ?entity ?tmp ?predicate .
  ?entity @en@rdfs:label|@en@skos:altLabel ?alias .
  FILTER REGEX(?predicate, "^<http://www\\.wikidata\\.org/prop/direct")
}
GROUP BY ?predicate
ORDER BY ASC(?predicate)

The aliases column shows an unedited (correct) tooltip. For the actual contents of the column, the first " and the last "@en is cut off, which leaves strings like ZDB ID"@en "ZDB identifier or in other words a list of elements separated by the string "@en ".

It would be preferable to iterate over all elements of the list (separated by a space) and cut off the beginning and end from every one of them instead of from the whole thing. A new separator would be needed in that case. Using semicolon, this would yield ZDB ID; ZDB identifier for the mentioned example.

This might lead to problems if the actual content contains the separator (e.g. semicolon), so it should be chosen carefully. I suggest ; or |.

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