diff --git a/lib/src/graph.dart b/lib/src/graph.dart index 9db8e4e..001a395 100644 --- a/lib/src/graph.dart +++ b/lib/src/graph.dart @@ -568,11 +568,8 @@ class Graph { /// /// Updates [Graph.ctx], [Graph.groups] and [Graph.triples] in the process. void parseTurtle(String fileContent) { - String processedContent = _preprocessTurtleContent(fileContent); - final String content = _removeComments(processedContent); - + final String content = _removeComments(fileContent); List parsedList = parser.parse(content).value; - for (List tripleList in parsedList) { _saveToContext(tripleList); } @@ -925,29 +922,4 @@ class Graph { } return rtnStr; } - - /// Preprocesses Turtle content to handle multiline string literals. - /// - /// This function addresses the issue of multiline literals in Turtle syntax, - /// which are enclosed within triple quotes `"""`. - String _preprocessTurtleContent(String turtleContent) { - // Regular expression to match multiline literals. - - final multilineLiteralRegex = RegExp(r'"""(.*?)"""', dotAll: true); - - // Replace each multiline literal with a processed version. - - return turtleContent.replaceAllMapped(multilineLiteralRegex, (match) { - // Get the multiline literal, excluding the triple quotes. - - String multilineLiteral = match.group(1)!; - - // Process the multiline literal as needed. - // Example: Replace line breaks with a special sequence. - String processedLiteral = multilineLiteral.replaceAll('\n', '\\n'); - - // Return the processed literal with the original triple quotes - return '"$processedLiteral"'; - }); - } }