diff --git a/lib/TermUtil.ts b/lib/TermUtil.ts index 1831fca..cb2f886 100644 --- a/lib/TermUtil.ts +++ b/lib/TermUtil.ts @@ -107,7 +107,7 @@ export function stringToTerm(value: string | undefined, dataFactory?: RDF.DataFa return dataFactory.literal(getLiteralValue(value), language || type); case '<': default: - if (value.startsWith('<<') && value.endsWith('>>')) { + if (value[0] === '<' && value.length > 4 && value[1] === '<' && value[value.length - 1] === '>' && value[value.length - 2] === '>') { // Iterate character-by-character to detect spaces that are *not* wrapped in <<>> const terms = value.slice(2, -2).trim(); let stringTerms: string[] = [];