timofeysie / khipu

Electron PWA starter
MIT License
4 stars 1 forks source link

Pendulum rocket fallacy has no detail page #24

Closed timofeysie closed 3 years ago

timofeysie commented 3 years ago

The response is:

{
   "entities":{
      "Q7162532":{
         "pageid":7063037,
         "ns":0,
         "title":"Q7162532",
         "lastrevid":1287319128,
         "modified":"2020-10-06T05:39:44Z",
         "type":"item",
         "id":"Q7162532",
         "labels":{
            "en":{
               "language":"en",
               "value":"pendulum rocket fallacy"
            },
            "es":{
               "language":"es",
               "value":"falacia del cohete p\u00e9ndulo"
            },
            "nl":{
               "language":"nl",
               "value":"Slingerraketmisvatting"
            },
            "fr":{
               "language":"fr",
               "value":"Confusion de la fus\u00e9e pendulaire"
            }
         },
         "descriptions":{
            "en":{
               "language":"en",
               "value":"common misunderstanding of the mechanics of rocket flight"
            }
         },
         "aliases":{

         },
         "claims":{
            "P31":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P31",
                     "datavalue":{
                        "value":{
                           "entity-type":"item",
                           "numeric-id":186150,
                           "id":"Q186150"
                        },
                        "type":"wikibase-entityid"
                     },
                     "datatype":"wikibase-item"
                  },
                  "type":"statement",
                  "qualifiers":{
                     "P642":[
                        {
                           "snaktype":"value",
                           "property":"P642",
                           "hash":"ac34efe992f5475754aad9eee77ef16ec84298a3",
                           "datavalue":{
                              "value":{
                                 "entity-type":"item",
                                 "numeric-id":2325497,
                                 "id":"Q2325497"
                              },
                              "type":"wikibase-entityid"
                           },
                           "datatype":"wikibase-item"
                        }
                     ]
                  },
                  "qualifiers-order":[
                     "P642"
                  ],
                  "id":"Q7162532$bba9a2ef-4ba8-7f9b-bfa2-79c61692e959",
                  "rank":"normal"
               }
            ],
            "P2581":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P2581",
                     "datavalue":{
                        "value":"02046247n",
                        "type":"string"
                     },
                     "datatype":"external-id"
                  },
                  "type":"statement",
                  "id":"Q7162532$3bee60e4-492e-fd6f-fa38-ce4a476cd247",
                  "rank":"normal"
               }
            ],
            "P6366":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P6366",
                     "datavalue":{
                        "value":"44231203",
                        "type":"string"
                     },
                     "datatype":"external-id"
                  },
                  "type":"statement",
                  "id":"Q7162532$E8B043A1-9B7D-4434-9F58-8AB8E1C4F90D",
                  "rank":"normal"
               }
            ],
            "P18":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P18",
                     "datavalue":{
                        "value":"Goddard and Rocket.jpg",
                        "type":"string"
                     },
                     "datatype":"commonsMedia"
                  },
                  "type":"statement",
                  "id":"Q7162532$ea124fcb-484f-4477-77fb-90cc6dc4595f",
                  "rank":"normal"
               },
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P18",
                     "datavalue":{
                        "value":"Pendulum rocket fallacy.png",
                        "type":"string"
                     },
                     "datatype":"commonsMedia"
                  },
                  "type":"statement",
                  "qualifiers":{
                     "P2096":[
                        {
                           "snaktype":"value",
                           "property":"P2096",
                           "hash":"a9f8caaa32cbf7c307bc573001eb0abdb778ca43",
                           "datavalue":{
                              "value":{
                                 "text":"Free body diagrams illustrating the pendulum rocket fallacy. On the left are typical rockets with thrust applied at the base; on the right, thrust is applied at the nose of the rocket. The upper row shows the actual set of forces on each rocket (weight W, drag D, and thrust T), with the thrust vector passing through the center of mass of the rocket. The lower row shows the fallacy in which the thrust vector is assumed to point upward at all times, and acts as a destabilizing or stabilizing force depending on where it is applied.",
                                 "language":"en"
                              },
                              "type":"monolingualtext"
                           },
                           "datatype":"monolingualtext"
                        }
                     ]
                  },
                  "qualifiers-order":[
                     "P2096"
                  ],
                  "id":"Q7162532$d30c8083-47f3-61c5-b694-721d8ba029ec",
                  "rank":"normal"
               }
            ],
            "P1269":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P1269",
                     "datavalue":{
                        "value":{
                           "entity-type":"item",
                           "numeric-id":23064627,
                           "id":"Q23064627"
                        },
                        "type":"wikibase-entityid"
                     },
                     "datatype":"wikibase-item"
                  },
                  "type":"statement",
                  "id":"Q7162532$f8fa0064-47fd-78a0-a25c-2febcc5b98f9",
                  "rank":"normal"
               }
            ],
            "P1479":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P1479",
                     "datavalue":{
                        "value":{
                           "entity-type":"item",
                           "numeric-id":20702,
                           "id":"Q20702"
                        },
                        "type":"wikibase-entityid"
                     },
                     "datatype":"wikibase-item"
                  },
                  "type":"statement",
                  "qualifiers":{
                     "P3831":[
                        {
                           "snaktype":"value",
                           "property":"P3831",
                           "hash":"f5f8cbf502ad3a216fc0062893168a6ce8b320d1",
                           "datavalue":{
                              "value":{
                                 "entity-type":"item",
                                 "numeric-id":18534,
                                 "id":"Q18534"
                              },
                              "type":"wikibase-entityid"
                           },
                           "datatype":"wikibase-item"
                        }
                     ]
                  },
                  "qualifiers-order":[
                     "P3831"
                  ],
                  "id":"Q7162532$111b92b3-43bc-4d90-59ec-6442e7ab5416",
                  "rank":"normal"
               }
            ],
            "P138":[
               {
                  "mainsnak":{
                     "snaktype":"value",
                     "property":"P138",
                     "datavalue":{
                        "value":{
                           "entity-type":"item",
                           "numeric-id":20702,
                           "id":"Q20702"
                        },
                        "type":"wikibase-entityid"
                     },
                     "datatype":"wikibase-item"
                  },
                  "type":"statement",
                  "qualifiers":{
                     "P5168":[
                        {
                           "snaktype":"value",
                           "property":"P5168",
                           "hash":"b3103d61fcdd4728a2dc7110d5bc340c0efc357e",
                           "datavalue":{
                              "value":{
                                 "text":"pendulum rocket fallacy",
                                 "language":"en"
                              },
                              "type":"monolingualtext"
                           },
                           "datatype":"monolingualtext"
                        }
                     ]
                  },
                  "qualifiers-order":[
                     "P5168"
                  ],
                  "id":"Q7162532$38e5719c-4bcd-370c-166d-c3d0d99f312e",
                  "rank":"normal"
               }
            ]
         },
         "sitelinks":{
            "eswiki":{
               "site":"eswiki",
               "title":"Falacia del cohete p\u00e9ndulo",
               "badges":[

               ],
               "url":"https://es.wikipedia.org/wiki/Falacia_del_cohete_p%C3%A9ndulo"
            },
            "frwiki":{
               "site":"frwiki",
               "title":"Confusion de la fus\u00e9e pendulaire",
               "badges":[

               ],
               "url":"https://fr.wikipedia.org/wiki/Confusion_de_la_fus%C3%A9e_pendulaire"
            },
            "nlwiki":{
               "site":"nlwiki",
               "title":"Slingerraketmisvatting",
               "badges":[

               ],
               "url":"https://nl.wikipedia.org/wiki/Slingerraketmisvatting"
            }
         }
      }
   }
}
timofeysie commented 3 years ago

There is no English site link. What do we do in this situation?

timofeysie commented 3 years ago

After adding the description for the server, we are getting this error:

core.js:4002 ERROR TypeError: Cannot read property 'url' of undefined
    at ItemDetailsStore.push../src/app/features/category-item-details/item-details/item-details-store.ts.ItemDetailsStore.getTitle (item-details-store.ts:44)

We used the url title as a means to get the description, but this wont work if there is no link to get it from, so we need a fallback or better way of getting that title.

There appears to be no Wikipedia page for this fallacy. There is an English description on the Wikidata page, and a longer description in the "media legend" section.

If there is no link in the current language selected, we will just show the label in that language in regular text. Otherwise, show the link text and a hyperlink to the Wikipedia page.