rdf to-jelly: support generalized RDF input#98
Conversation
Karolina-Bogacka
left a comment
There was a problem hiding this comment.
Ok, this looks a bit hacky to me, but I trust that there is no other way to support these functionalities.
|
|
||
| protected final def parseTripleTermGeneralized: Node = | ||
| val t = parseTripleGeneralized | ||
| val x = nextToken |
There was a problem hiding this comment.
why value names like x or t, this is not very informative
There was a problem hiding this comment.
That's the original names from Jena... let's go with that for now.
| val ds = DatasetGraphFactory.create() | ||
| RDFParser.source(newIn).lang(JellyLanguage.JELLY).parse(ds) | ||
| ds.size() should be(4) // 4 named graphs | ||
| ds.getDefaultGraph.size() should be(4) // 4 triples in the default graph |
There was a problem hiding this comment.
this test seems kind of roundabout to me. Why do we have a separate test nq file only to check at the end the number of quads? wouldn't it make more sense to create an nq file dynamically from a set of statements and then compare the final graph to the first set of statements, or try to translate the above graph to nquad and compare the two .nq files/strings?
There was a problem hiding this comment.
The point is to just check if the parser works. Generating this dynamically is a pain, I'd prefer to have it in a file.
Resolves: #88
We basically spin our own versions of NT and NQ parsers that can ingest generalized RDF, and then we re-register them in Jena as the only NT/NQ parsers.
I don't think there is an easier way to achieve this. The checks disallowing generalized RDF are hardcoded into the parsers.