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

REGEX should use $1 instead of \1 etc. #1664

Open
hannahbast opened this issue Dec 5, 2024 · 0 comments
Open

REGEX should use $1 instead of \1 etc. #1664

hannahbast opened this issue Dec 5, 2024 · 0 comments

Comments

@hannahbast
Copy link
Member

The following query does not quite do what it should:

SELECT * WHERE {
  wd:P12047 wdt:P1630 ?formatterURL .
  ?wikidataitem wdt:P12047 ?mimotextid ;
                wdt:P50 ?author .
  BIND (IRI(REPLACE(?mimotextid, "^(.+)$", ?formatterURL)) AS ?mimotextitem) .
}

https://qlever.cs.uni-freiburg.de/wikidata/9U5biA

The issue seems to be that ?formatterURL has the value http://data.mimotext.uni-trier.de/entity/$1, but QLever wants \\1 instead of $1. It seems that the standard says it should be $1:

https://www.w3.org/TR/sparql11-query/#func-replace
https://www.w3.org/TR/xpath-functions/#func-replace

@hannahbast hannahbast changed the title REPLACE problem when third argument is a variable REGEX should use $1 instead of \1 etc. Dec 5, 2024
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