Open jeswr opened 1 year ago
I'm struggling to find a grammar that I can get my head around to work out how this needs to be written. I.e. do we need re-write it as {?s a ?o} => {?s a ?o}
; or can we make the above form valid n3 with a couple of minor tweaks.
I've also not been able to find any other JavaScript TypeScript N3 writers for this purpose.
@josd Would you be able to point me to the package / code responsible for serializing N3 in Eye as a reference point?
The code doing the reasoning output in eye starts at https://github.com/eyereasoner/eye/blob/6405dcb4b1dacb806af9e18f909cc06db31b3059/eye.pl#L3431 and ends at https://github.com/eyereasoner/eye/blob/6405dcb4b1dacb806af9e18f909cc06db31b3059/eye.pl#L4649 This also includes the writing of proofs and that's why it is so longwinded :-)
write those quads back to
text/n3
using the Stream Writer
Just want to note that N3.js at the moment does not support Notation3 writing (because it cannot be done in a streaming way).
Just as a note - the code I am currently using to do N3 writing is https://github.com/eyereasoner/eye-js/blob/main/lib/n3Writer.temp.ts
If we parse the statement
{?s a ?o} => {?s a ?o}.
into RDF/JS quads and then write those quads back totext/n3
using the Stream Writer we getWhen trying to parse this result again we get the error
Error: Expected entity but got { on line 1.
Can be reproduced by running this script