linkeddata / rdflib.js

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

bug in statementsMatching function in formula.ts #518

Open bblfish opened 2 years ago

bblfish commented 2 years ago

There is a bug here in rdflib.js statementsMatching implementation in formula.ts. The last line below compares the graph to the subject.

statementsMatching<JustOne extends boolean = false>(
    s?: Quad_Subject | null,
    p?: Quad_Predicate | null,
    o?: Quad_Object | null,
    g?: Quad_Graph | null,
    justOne?: boolean
  ): Statement[] {
    const sts = this.statements.filter(st =>
      (!s || s.equals(st.subject)) &&
      (!p || p.equals(st.predicate)) &&
      (!o || o.equals(st.object)) &&
      (!g || g.equals(st.subject))
    )
bourgeoa commented 2 years ago

test to be added to the PR #518