-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible serialization issue #208
Comments
I'm assuming that if you use strings in node it works fine but if you give RDF/JS input and request string output then you get this problem? |
The fix should be easy - we just need the same logic as Lines 26 to 28 in 3b2e074
_encodePredicate method in lib/n3Writer.temp.ts .
Could you make a PR with the changes? |
exactly |
Actually, I think the problem is not in eye-js but in the N3 parser: import { Parser } from 'n3'
const text = `
@prefix : <http://ex.org/> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
:a :b :c, :d .
{
(?x {:a :b ?x } ?list) log:collectAllIn _:x .
}
=>
{
:result :is ?list
} .
`
const quads = new Parser({ format: 'text/n3' }).parse(text)
console.log(quads.map(x => `${x.subject.value} ${x.predicate.value} ${x.object.value} ${x.graph.value}`))
// 'http://ex.org/a http://ex.org/b http://ex.org/c ',
// 'http://ex.org/a http://ex.org/b http://ex.org/d ',
// 'n3-1 http://www.w3.org/1999/02/22-rdf-syntax-ns#first x n3-0',
// 'http://ex.org/a http://ex.org/b x n3-2',
// 'n3-1 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest n3-3 n3-0',
// 'n3-3 http://www.w3.org/1999/02/22-rdf-syntax-ns#first list n3-0',
// 'n3-3 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#nil n3-0',
// 'n3-1 http://www.w3.org/2000/10/swap/log#collectAllIn n3-0.x n3-0',
// 'http://ex.org/result http://ex.org/is list n3-4',
// 'n3-0 http://www.w3.org/2000/10/swap/log#implies n3-4 ' here the list links n3-1 directly to n3-3,skipping n3-2 |
the following rule works fine in the browser but gives no result using node.
Apparently, its serialization in the temporary file is missing
{:a :b ?x }
The text was updated successfully, but these errors were encountered: