Skip to content
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

write a more detailed description of Dataset.equals #41

Open
bergos opened this issue Aug 19, 2016 · 2 comments
Open

write a more detailed description of Dataset.equals #41

bergos opened this issue Aug 19, 2016 · 2 comments
Assignees

Comments

@bergos
Copy link
Member

bergos commented Aug 19, 2016

The description should contain more details about the normalization step.

@bergos bergos self-assigned this Aug 19, 2016
@bergos bergos transferred this issue from rdfjs/data-model-spec Jan 25, 2019
@awwright
Copy link
Member

awwright commented Apr 8, 2019

+1 for this, I'm looking for some elaboration as to what Dataset#equals is supposed to do.

Currently, master branch says

Blank Nodes will be normalized.

But it also notes

The given dataset and its content must be treated as immutable

So what data structure, exactly, is being normalized, if not the input Dataset?

This section should make a normative reference to RDF 1.1 Concepts and Abstract Syntax.

@vhf
Copy link
Member

vhf commented Apr 8, 2019

What about comparing canonicalized versions of the datasets?

  equals (other) {
    const thisCanonical = this.toCanonical()
    const otherCanonical = other.toCanonical()
    return otherCanonical.trim() === thisCanonical.trim()
  }

  toCanonical () {
    return canonize.canonizeSync(this.toArray(), { algorithm: 'URDNA2015', native: false })
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants