Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/db/AreaSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const MetadataSchema = new Schema<IAreaMetadata>({
bbox: [{ type: Number, required: false }],
leftRightIndex: { type: Number, required: false },
ext_id: { type: String, required: false, index: true },
wikidata_id: { type: String, required: false, index: true },
area_id: {
type: 'object',
value: { type: 'Buffer' },
Expand Down
7 changes: 7 additions & 0 deletions src/db/AreaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ export interface IAreaMetadata {
* this field will record their external relation.
* */
ext_id?: string

/**
* Some areas have an identifier on https://www.wikidata.org
* This identifier matches the regex `^Q\d+$`
* */
wikidata_id?: string

/**
* All external IDs for areas are expressed as UUIDs. As such, when resolving ids at the
* GQL layer use these values for querying and identification of areas.
Expand Down
1 change: 1 addition & 0 deletions src/db/ClimbSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const MetadataSchema = new Schema<IClimbMetadata>({
left_right_index: { type: Number, required: true, default: -1 },
mp_id: { type: String, required: false },
mp_crag_id: { type: String, required: true },
wikidata_id: { type: String, required: false },
areaRef: {
type: Schema.Types.Mixed,
value: { type: 'Buffer' },
Expand Down
3 changes: 3 additions & 0 deletions src/db/ClimbTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export interface DisciplineType {
/** https://en.wikipedia.org/wiki/Top_rope_climbing */
tr?: boolean
}

export interface IClimbMetadata {
lnglat?: Point
left_right_index?: number
Expand All @@ -137,6 +138,8 @@ export interface IClimbMetadata {
* for its crag to also be available
*/
mp_crag_id?: string
/** The Wikidata identifier for the route */
wikidata_id?: string
/** the parent Area in which this climb appears */
areaRef: MUUID
}
Expand Down
1 change: 1 addition & 0 deletions src/graphql/schema/Area.gql
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ type AreaMetadata {

"Mountainproject ID (if associated)"
mp_id: String!
wikidata_id: String!
area_id: ID!
areaId: ID!

Expand Down
1 change: 1 addition & 0 deletions src/graphql/schema/Climb.gql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type ClimbMetadata {
leftRightIndex: Int
"If this climb originated from Mountain Project, this is the ID"
mp_id: String
wikidata_id: String!
climb_id: ID!
climbId: ID!
}
Expand Down
Loading