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

Replaced langMatches(a, b) with lang(a) = b #223

Merged
merged 3 commits into from Apr 17, 2019

Conversation

floriankramer
Copy link
Member

This fixes the standard conformance problems mentioned in #194. This pr does not implement any version of langMatches though.

@niklas88
Copy link
Member

niklas88 commented Apr 4, 2019

@floriankramer, @joka921 so I'm thinking we should add this implementation of lang(a) == b but also keep the current langMatches() until we have implemented it correctly. I know the current version breaks the spec but a) keeping it means we don't break existing queries b) our result for langMatches() is a subset of the correct result c) langMatches() is a pretty weird and in my opinion useless function.

@niklas88 niklas88 changed the title Replaced langMatches(a, b) with lang(a) == b Replaced langMatches(a, b) with lang(a) = b Apr 5, 2019
@niklas88
Copy link
Member

niklas88 commented Apr 8, 2019

@floriankramer after readding the old langMatches() behavior, i've this running on Wikidata but it seems the syntax doesn't work. The old langMatches() still works fine but e.g. the following query returns empty results instead of German cities. I also tried the wrong == but that is correctly recognized as invalid syntax.

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?name ?populationWHERE {
  ?city wdt:P31 wd:Q515 .
  ?city wdt:P17 wd:Q183 .
  ?city wdt:P1082 ?population .
  ?city schema:name ?name .
  FILTER (lang(?name) = "de") .
}
ORDER BY DESC(?population)

Copy link
Member

@niklas88 niklas88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not LGTM as I currenlt can't get this to work, would guess this is something small though

floriankramer and others added 2 commits April 17, 2019 11:40
The implementation of langMatches was actually simply the implementation
of lang(a) == b.
@floriankramer
Copy link
Member Author

@niklas88 The code was trying to get the language tag from the = sign instead of the actual language tag. Should be fixed now.

Copy link
Member

@niklas88 niklas88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tested

@niklas88 niklas88 merged commit f2ba7ff into ad-freiburg:master Apr 17, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants