linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
566 stars 146 forks source link

fix #364 Unable to serialize JSON-LD #388

Closed ericprud closed 4 years ago

ericprud commented 4 years ago

convertToJson's first waterfall function is expected to get called repeatedly. Apparently async's waterfall expects a single invocation. I moved the second callback into the first:

    n3Parser.parse(n3String, function (error, quad, prefix) {
      if (error) {
        throw error;
      } else if (quad !== null) {
        n3Writer.addQuad(quad);
      } else {
        n3Writer.end(callback);
      }
    });

https://github.com/linkeddata/rdflib.js/issues/364#issuecomment-584894816

nickevansuk commented 4 years ago

+1

Could we get this merged, as it's currently preventing RDF -> JSON-LD conversion from working?

megoth commented 4 years ago

@ericprud has committed a fix for the requested changes - @RubenVerborgh are you ok with the fix?