familysearch / gedcomx-csharp Goto Github PK
View Code? Open in Web Editor NEWC# Libraries for GEDCOM X Processing
License: Apache License 2.0
C# Libraries for GEDCOM X Processing
License: Apache License 2.0
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
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>
.
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".
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.
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.
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
:
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.
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]
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.
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
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.
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?
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?
Hi,
As per .NET's naming conventions, interface names should alway start with an additional I
.
Please check this for more info.
The Gedcom X library interfaces do not obey to this convention.
Here are some:
Although this is obviously a breaking change, I believe this has no effect, I think we can assume nobody have directly implemented these interfaces.
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 I develop proprietary project based on FamilySearch/gedcomx-csharp?
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
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.
In this GedcomX document I'm currently looking at, there are 4,000 records and 17,231 names, but the current tool only extracts 4,000 names. Here is a link to the gedcomx document in question:
https://www.dropbox.com/s/q4z0v5rxdowidtf/gedcomx.1.gz?dl=0
It appears that the extraction tool may be only extracting the first person in the record. The desired behavior would be to extract all persons in the record.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.