Class: Root

Root


new Root( [json])

A GEDCOM X document.
Parameters:
Name Type Argument Description
json Object <optional>
See:

Extends

Methods


addAgent(agent)

Add an agent
Parameters:
Name Type Description
agent Agent | Object
Returns:
Type
Root

addCollection(collection)

Add a collection
Parameters:
Name Type Description
collection Collection
Returns:
this
Type
Root

addDocument(doc)

Add a document
Parameters:
Name Type Description
doc Document | Object
Returns:
Type
Root

addEvent(event)

Add an event
Parameters:
Name Type Description
event Event | Object
Returns:
Type
Root

addField(field)

Add a field
Parameters:
Name Type Description
field Field
Inherited From:
Returns:
this
Type
ExtensibleData

Add a link
Parameters:
Name Type Description
link Link
Inherited From:
Returns:
this
Type
ExtensibleData

addPerson(person)

Add a person
Parameters:
Name Type Description
person Person | Object
Returns:
This instance
Type
Root

addPlace(place)

Add a place
Parameters:
Name Type Description
place PlaceDescription
Returns:
Type
Root

addRecordDescriptor(recordDescriptor)

Add a record descriptor
Parameters:
Name Type Description
recordDescriptor RecordDescriptor
Returns:
this
Type
Root

addRelationship(relationship)

Add a relationship
Parameters:
Name Type Description
relationship Relationship | Object
Returns:
Type
Root

addSourceDescription(sourceDescription)

Add a ource description
Parameters:
Name Type Description
sourceDescription SourceDescription | Object
Returns:
Type
Root

getAgents()

Get the agents
Returns:
Type
Array.<Agent>

getAttribution()

Get attritbution
Returns:
Type
Attribution

getCollections()

Get the collections
Returns:
collections
Type
Array.<Collection>

getDescription()

Get the description
Returns:
Type
String

getDocuments()

Get the documents
Returns:
Type
Array.<Document>

getEvents()

Get events
Returns:
Type
Array.<Event>

getFields()

Get the fields
Inherited From:
Returns:
Type
Array.<Field>

getId()

Get the object's id.
Inherited From:
Returns:
Id
Type
String

getLang()

Get the lang
Returns:
Type
String

Get a link
Parameters:
Name Type Description
rel String
Inherited From:
Returns:
Type
Link

Get the links
Inherited From:
Returns:
Type
Array.<Link>

getPersonById(id)

Get the person matching a given ID.
Parameters:
Name Type Description
id String | Integer Person ID
Returns:
Person matching the given ID.
Type
Person

getPersons()

Get the persons
Returns:
Type
Array.<Person>

getPersonsChildRelationships(person)

Get a person's child relationships, meaning relationships where the person is a parent (relationships with their children).
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Relationship>

getPersonsChildren(person)

Get a person's children.
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Person>

getPersonsCoupleRelationships(person)

Get a person's couple relationships.
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Relationship>

getPersonsParentRelationships(person)

Get a person's parent relationships, meaning relationships where the person is a child (relationships with their parents).
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Relationship>

getPersonsParents(person)

Get a person's parents.
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Person>

getPersonsRelationships(person)

Get the relationships involving a specific person
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Person's relationships.
Type
Array.<Relationship>

getPersonsSpouses(person)

Get a person's spouses.
Parameters:
Name Type Description
person Person | String Person or person ID
Returns:
Type
Array.<Person>

getPlaces()

Get places
Returns:
Type
Array.<PlaceDescription>

getPrincipalPerson()

Get the principle person, if one exists.
Returns:
Principal person if one exists; otherwise undefined.
Type
Person

getRecordDescriptors()

Get the recordDescriptors
Returns:
recordDescriptors
Type
Boolean

getRelationships()

Get all relationships
Returns:
Type
Array.<Relationship>

getSourceDescriptions()

Get the source descriptions
Returns:
Type
Array.<SourceDescription>

init(json)

Initialize from JSON
Parameters:
Name Type Description
json Object
Overrides:
Returns:
this
Type
Root

<static> isInstance(obj)

Check whether the given object is an instance of this class.
Parameters:
Name Type Description
obj Object
Returns:
Type
Boolean

setAgents(agents)

Set the agents
Parameters:
Name Type Description
agents Array.<Agent> | Array.<Object>
Returns:
Type
Root

setAttribution(attribution)

Set attribution
Parameters:
Name Type Description
attribution Attribution
Returns:
Type
Root

setCollections(collections)

Set the collections
Parameters:
Name Type Description
collections Array.<Collection>
Returns:
this
Type
Root

setDescription(description)

Set the description
Parameters:
Name Type Description
description String URI that must resolve to a SourceDescription
Returns:
This instance
Type
Root

setDocuments(documents)

Set the documents
Parameters:
Name Type Description
documents Array.<Documents> | Array.<Object>
Returns:
Type
Root

setEvents(events)

Set events
Parameters:
Name Type Description
events Array.<Event> | Array.<Object>
Returns:
Type
Root

setFields(fields)

Set the fields
Parameters:
Name Type Description
fields Array.<Field>
Inherited From:
Returns:
this
Type
ExtensibleData

setId(id)

Set the object's id.
Parameters:
Name Type Description
id String
Inherited From:
Returns:
This object, for chaining.
Type
ExtensibleData

setLang(lang)

Set the lang
Parameters:
Name Type Description
lang String
Returns:
This instance
Type
Root

Set the links
Parameters:
Name Type Description
links Links
Inherited From:
Returns:
this
Type
ExtensibleData

setPersons(persons)

Set the persons
Parameters:
Name Type Description
persons Array.<Person> | Array.<Object>
Returns:
This instance
Type
Root

setPlaces(places)

Set the places
Parameters:
Name Type Description
places Array.<PlaceDescription> | Object
Returns:
Type
Root

setRecordDescriptors(recordDescriptors)

Set the record descriptors
Parameters:
Name Type Description
recordDescriptors Array.<RecordDescriptor>
Returns:
this
Type
Root

setRelationships(relationships)

Set the relationships
Parameters:
Name Type Description
relationships Array.<Relationship> | Array.<Object>
Returns:
Type
Root

setSourceDescriptions(sourceDescriptions)

Set the source descriptions
Parameters:
Name Type Description
sourceDescriptions Array.<SourceDescription> | Array.<Object>
Returns:
Type
Root

toJSON()

Export the object as JSON
Overrides:
Returns:
JSON object
Type
Object