rootsdev / gedcomx-js

JavaScript library for GEDCOM X
http://rootsdev.org/gedcomx-js/
MIT License
10 stars 1 forks source link

Better URI resolution and comparison #33

Open justincy opened 7 years ago

justincy commented 7 years ago

In ResourceReference.matches() and some other places, we assume that ResourceReferences are fragment identifiers. However they can also be absolute or relatives URIs. In those latter cases we fail to properly compare them.

Can we provide generic utilities that can solve these problems? I'm worried that we won't always be able to compare.


The current case I'm struggling with is a response for Person Matches from the FamilySearch API. The response is essentially a list of GEDCOM X documents with some metadata in the Atom format. Relationship resource references have absolute URIs even though the persons being pointed to are in the document (yet relationships from other endpoints use fragments identifiers). I can create an FS custom solution for comparing absolute person URIs to person IDs or just use the resourceId property but neither of those will necessarily work for GEDCOM X data from other sources.

justincy commented 7 years ago

If we can't fix our current usage to work in more general situations then we ought to remove the functionality, but that's a breaking change.