Skip to content

Commit 2bb9813

Browse files
author
Miel Vander Sande
committed
Flip to Simple Literal only
1 parent 12b7eba commit 2bb9813

4 files changed

Lines changed: 457 additions & 29 deletions

File tree

libhdt/include/SingleTriple.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,15 @@ class TripleString
394394
* @param object
395395
*/
396396
void setObject(const std::string &object) {
397-
this->object = IS_SIMPLELITERAL(object) ? object + postfix : object;
397+
this->object = object;
398+
399+
// Normalize xsd:strings to simple literals
400+
size_t oSize = object.length();
401+
size_t pfSize = postfix.length();
402+
403+
if (oSize > 0 && oSize >= pfSize && object.compare(oSize - pfSize, pfSize, postfix) == 0) {
404+
this->object.erase(oSize - pfSize);
405+
}
398406
}
399407

400408
/**

0 commit comments

Comments
 (0)