GithubHelp home page GithubHelp logo

gedcomx-csharp's People

Contributors

alexc155 avatar cutflame avatar joerghoffmannatgithub avatar misbach avatar peacemode avatar stoicflame avatar weitzhandler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gedcomx-csharp's Issues

Gedcomx.CLI RecordSetToCSV doesn't extract Record's persistent identifier

The Gedcomx.CLI RecordSetToCSV utility will take a GEDCOM X xml record and flatten it into a CSV file with each row containing information about each record. A critical piece of data is missing from the GEDCOM X -> CSV conversion—the persistent identifier. The persistent identifier is located inside of a <sourceDescription> element and is the value for the about attribute. This persistent identifier needs to be extracted and written to the CSV.

Example of the sourceDescription element:

<record description="#s1" id="r_187094460">
  <!-- record data... -->
    <sourceDescription about="https://familysearch.org/pal:/MM9.1.2/M421-DGM" resourceType="http://gedcomx.org/Record" id="s1">
      <identifier type="http://gedcomx.org/Persistent">https://familysearch.org/pal:/MM9.1.2/M421-DGM</identifier>
    </sourceDescription>
</record>

Note, there may be several sourceDescription elements found within a record. The persistent identifier is found within the element that contains the resrource resourceType of "http://gedcomx.org/Record".

Vulnerabilities detected

The RestSharp package (104.5.0) has at least one vulnerability with high serverity. It may lead to specific problems in this project. Try updating the package version.

Details
Advisory (hight serverity): GHSA-9pq7-rcxv-47vq

FS Gedcomx property and data loading

Hi,

I am new to the API and I was wondering whether all the classes in the API (let's say PersonState) store genealogy info (in properties), or are just a means for request data, but not to be used as entity classes.

It's just that I still didn't manage to load current user as a person record along with its birth date and some other conclusions.

Here's my code:

var uri = new Uri("https://integration.familysearch.org/platform/collections/tree");
var tree = new FamilySearchFamilyTree(uri);
var state = tree.AuthenticateViaOAuth2Password(Username, Password, ClientId);

Debug.Assert(state.IsAuthenticated);
var current = tree.ReadPersonForCurrentUser();
var name = current.GetName(); //null
var conclusion = current.GetConclusion(); //null
var conclusions = current.LoadConclusions();

Now my question is what's next? Why is the name and conclusion field null, if the tree looks like so:

Here's a screenshot of what I see in my debugger for the variable conclusions:

State transitions fail when domain of target resource is different than the domain of the source resource

If a resource links to a resource at a different domain, the request attempt will be made to the domain of the source resource.

For example, when an attempt to authenticate in production to an instance of FamilySearchFamilyTree, the Family Tree state is at "https://familysearch.org/platform/collections/tree" and the link to the OAuth 2 authentication resource is at "https://ident.familysearch.org/cis-web/oauth2/v3/token", but the AuthenticateViaOAuth2 method attempts to authenticate to "https://familysearch.org/cis-web/oauth2/v3/token" and not "ident.familysearch.org".

@shanewalters, I would appreciate any advice you can provide to fix this issue.

ReadAncestry and ReadDescendancy results don't include d.o.b.

Hi,

I'm doing some of the above calls in my development, and the Person objects in the results don't seem to include any information about the date of birth, either in the display properties or the Facts.

Is this by design? Was hoping to avoid having to make separate ReadPerson requests for each person I find in the ancestry/descendancy in order to populate some birth events on our product's timeline.

Regards
Jamie Hirst

JSON serialization should ignore any ignorable properties

When serializing the model to JSON, I see things like "known_" and "_Specified". These properties are provided in the model, but they're just convenience accessors.

Basically, anything with attribute [System.Xml.Serialization.XmlIgnoreAttribute] should be ignored in JSON.

Can't get beta data?

I can receive data just fine on sandbox when I call with the FamilySearchFamilyTree, but when I call a person using FamilyTreePersonState on the beta server, it gives me problems, not actually retrieving any persons.

myPerson = p_Ft.ReadPersonById(item);

Parsing through the code on that line, I find two 400 errors:
"Unable to read tf person" and "Requested feature 'birth-date-not-considered-death-declaration' is not defined," though the second error may just be a fault of the first.

I'm using ID's that I know work, as I pulled them directly from the beta site manually. I've also made sure to change the initializer of the FamilySearchFamilyTree to false, so that it knows I'm not in sandbox anymore. The dev team directed me here to ask the question.

Is this something that anyone else has encountered?

Abbreviated middle names preceded by period

Both Person.GetDisplayProperties.Name and Name.NameForm.FullText return names with abbreviated middle name PRECEDED by period, thus:
Ava .F GEORGE [KWQ7-Y58]
Riley .F WILEY [KWQ7-Y59]
Dempsey .M LUCAS [KWQ7-Y56]

Proposal: support the Portable Class Library

I made an attempt tonight to convert this project to PCL. The attempt failed, but wasn't too far off on the GEDCOM projects. The test projects and command line items do not need to be ported to PCL, so I first converted all the GEDCOM X * projects to profile259. Json.Net has support for 259. That went fine. I had to remove all of the SOAP attributes after that. I think we could safely ditch SOAP for a PCL library. JSON has totally conquered the SOAP world anyhow. I changed usages of Stack to Stack<object>. (BTW, code exposing that publically doesn't appear quite right, either.) typeof(T).IsAssignableFrom(extension.GetType()) should obviously be extension is T.

After those changes, I was left with some miscellaneous items that were more difficult. ZipArchive is going to have to change to something from Microsoft.Bcl.Compression. The TimeZone call is going to have to change to some 3rd party solution. RecordHelper is going to have to ditch DataTable. And the usage of IsAssignableFrom in the JsonConverters; we need a different plan there. These items would all take some work.

My point is: does anyone else want this feature? Is it worth working on? Wait for the next version of .NET?

DateInfo to GedcomxDate?

Hi,

There should be a unified way to extract an object-oriented date value for ordering purposes from a DateInfo class.

I'd say you should add Day, Month, and Year properties to the DateInfo class, that will return the year parsed out from the date (maybe via regex). Actually having these properties as read-write would be very nice too.
I think the DateInfo lacks some manipulation functionality such as dealing with partial dates, as well as conversion to and from .NET DateTime when possible.

UPDATE,
And the truth is that it's all in the GedcomxDate library, there is just no connection between the two.

Gedcomx.CLI RecordSetToCSV doesn't extract Person's persistent identifier

Each person record contains a persistent identifier. It looks like this:

<person principal="true" extracted="true" id="p_1">
      <identifier type="http://gedcomx.org/Persistent">https://familysearch.org/pal:/MM9.1.1/MZYH-SSM</identifier>

The persistent identifier for the person isn't being extracted as a field in the CSV. This is critical because the person persistent identifier is the key for future updates to the personas.

FactType order

Hi,

I'd like to ask for a change in the enum type ordering of the members.

Currently as I see, it's ordered alphabetically, but when searching for stuff, I'd want to retrieve items by priority.
For example, I want to retrieve all the facts of a person related to birth or death. Meaning all the facts that have a KnownType which is Death, Funeral, Burial etc., selecting the first significant one that's available, in this case, Death should come before Burial, but since its ordered alphabetically it's not.

Here's example code:

_Death = Person.Facts
        .OrderBy(f => f.KnownType) //Since Burial comes before Death, it will return it first.
        .FirstOrDefault(f => f.KnownType == FactType.Death || f.KnownType == FactType.Funeral);

I'm new to this repo and don't know how strict things are here about pull requests, so I'm just talking out. Meanwhile I'm gonna use a custom IComparer<KnownType>.

Please add some samples and diagrams

Hi,

Please add some screenshots of the class-diagram of the Gedcom.Model library.
Also, please include some sample input and output .gedcomx and .xml files containing some sample data to be able to start working with.

Here's one I made myself.
Please refer to it on the main page / screenshots / gedcomx.org website etc.
Or (preferably) make up your own.

http://i.imgur.com/9fGJ65n.png

Empty collection as default value for various lists

Let's start with an example, take a look at these two lines:

private System.Collections.Generic.List<Gx.Records.Field> _fields;
private System.Collections.Generic.List<Gx.Common.Qualifier> _qualifiers;

And their accessing properties:

public System.Collections.Generic.List<Gx.Common.Qualifier> Qualifiers
{
  get
  {
    return this._qualifiers;
  }
  set
  {
    this._qualifiers = value;
  }
}

Now I assume the only reason these properties are not null is because they need to be serialized, but practically, they're evaluating as null many times, which makes it pretty verbose to access them having to check if they're null.
So my suggestion is have their getters replace with the following, to initialize them if they happen to be null:

get
{
  return this._qualifiers ?? (_qualifiers = new List<Qualifier>());
}

I haven't dug into the serializer config, but we should make sure it omits the collection if it contains no values.

I chose an example about the Qualifiers, but I'd like to see this issue addressed also in Person.Facts and all other collection properties.
I'd gladly do it myself if I have your green light to approve my pull.

Agent using Properties got an NullReferenceException

Hi
i try to get the model under test for testing the serialization. So I use the Set - Methods like "SetAccount" and I use the Properties directly. It will caused an Exception.

var agent = new Agent();
agent.Accounts.Add(CreateOnlineAccount());
agent.Addresses.Add(CreateAddress());
agent.Emails.Add(CreateRessource());
agent.Homepage = CreateRessource();
agent.Identifiers.Add(CreateIdentifier());
agent.Names.Add(CreateTextValue());
agent.Openid = CreateRessource();
agent.Phones.Add(CreateRessource());
agent.Id = "id";
agent.Links.Add(CreateLink());

Why the error happened is clear to me, but why was it realized so? Can not you simply initialize the properties and remove the methods?

I have fixed the issue in #43 but if this have a deeper meaning I would be glad to learn it

Nuget package is incomplete?

Hi

If I start a new project and install the nuget package FamilySearch.API.SDK (1.0.5422.31549) - on the first line of SDK code, getting the family tree collection:

FamilySearchFamilyTree ft = new FamilySearchFamilyTree(useSandbox);

I get a runtime error stating that the file or assembly Gedcomx.File cannot be loaded.

If I then install the nuget package Gedcomx.File (1.0.5422.31544) - the same line instead gives a runtime error that it can't find the file or assembly Link:

Could not load file or assembly 'Link, Version=1.0.5416.32154, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.