w3c/banana-rdf — pull request #178 by bblfish (2014-10-31 10:56:27+00:00)
Title: Topic/n triples

Implemented pure Scala NTriples parser that passes all the W3C tests.
Remove the unneeded JSON-LD parsers since one parser should parse all the formats.

Running on some very large files one gets the following using the [LinkedMDB Ntriples dump](
http://queens.db.toronto.edu/~oktie/linkedmdb/) which is about 800MB unzipped.

```scala
sbt> project plantain
sbt> console
scala> import org.w3.banana.io._
scala> import org.w3.banana.plantain._
scala> object PlantainNTripleTestSuite extends NTriplesTestSuite[Plantain]
scala> PlantainNTripleTestSuite.main(Array("/Users/hjs/Downloads/Safari/linkedmdb-latest-dump.nt"))
...
time to parse 6153776 triples was 31508. Found 11389 failures.
```

Plantain for the JVM uses the akka.URI class which fully parses each URI, so this is a lot less efficient than it could be ( one may want to for example lookup URI string in a hashtable before reprising them. But it is very good quality ( I think.)

(This suggests that there should be an abstraction that is underneath ops, to be called before a triple is returned, so that another framework can decide on how to transform strings into URIs.)

with Sesame we get the following:

```scala
scala> main(Array("/Users/hjs/Downloads/Safari/linkedmdb-latest-dump.nt"))
time to parse 6148122 triples was 14661. Found 81 failures.
```

Many less failures and it finishes twice as fast.