parseText method

  1. @Deprecated('Use [Graph.parseTurtle] instead for parsing a turtle string')
dynamic parseText(
  1. String text
)

Parses whole text and update graph accordingly.

Implementation

@Deprecated('Use [Graph.parseTurtle] instead for parsing a turtle string')
parseText(String text) {
  List<String> lines = text.split('\n');
  try {
    Map<String, dynamic> config = {
      'prefix': false,
      'sub': URIRef('http://sub.placeholder.pl'),
      'pre': URIRef('http://pre.placeholder.pl')
    };
    for (var i = 0; i < lines.length; i++) {
      // Removes leading and trailing spaces.
      String line = lines[i].trim();
      config = _parseLine(line, config);
    }
  } catch (e) {
    print('Error in parsing text: $e');
  }
}