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

Fix index build for literal "\"^^"@en #371

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/util/Conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,12 @@ inline string removeLeadingZeros(const string& orig) {

// _____________________________________________________________________________
bool isXsdValue(const string& val) {
// starting the search for "^^ at position 1 makes sure it's not in the
// quotes as we already checked that the first char is the first quote
return !val.empty() && val[0] == '\"' && val.find("\"^^", 1) != string::npos;
// Search for the last quote and check if it is followed by ^^.
// NOTE: searching for "^^ starting at position 1 (as done previously) fails
// for literal "\"^^"@en (which is contained in the RDF dump of DBpedia).
size_t posLastQuote = val.rfind("\"");
return !val.empty() && val[0] == '\"' && posLastQuote > 0 &&
val.find("^^", posLastQuote) != string::npos;
}

// _____________________________________________________________________________
Expand Down