< Research in programming Wikidata

The article deals with the study of spacecrafts and stations based on the Wikidata international project data. For the items classified as "spacecraft and stations" the queries were performed via SPARQL and the following lists were received: the list of all spacecrafts and stations, the list of spacecrafts and stations that has been designed in the USSR and Russia, the bar chart for spaceships and stations that shows the number of designed spacecrafts for decades, in the period from 1960 to 2017. Moreover, the Wikidata were evaluated from the point of their completeness. It showed that many objects have the wrong value of property "instance of (P31)".

Examples of the objects "Spacecrafts and stations"

Let's build up a list of all spacecrafts in English and Russian.

#List of spacecraft in English and Russian
SELECT  ?spacecraft ?label_en ?label_ru
WHERE
{
  ?spacecraft wdt:P31 wd:Q40218.
  ?spacecraft rdfs:label ?label_en filter (lang(?label_en) = "en").
  ?spacecraft rdfs:label ?label_ru filter (lang(?label_ru) = "ru").
}

SPARQL-request, 16 objects.

Let's build up a list of all space stations in English and Russian.

#List of space station in English and Russian
SELECT ?space_station ?spacecraft ?label_en ?label_ru
WHERE
{
  ?space_station wdt:P31 wd:Q25956.
  ?space_station rdfs:label ?label_en filter (lang(?label_en) = "en").
  ?space_station rdfs:label ?label_ru filter (lang(?label_ru) = "ru").
}

SPARQL-request, 14 objects.

Positive and negative objects

Examples of the most fully filled in objects "spacestation (Q40218)" are:

  1. International Space Station
  2. Mir
  3. Tiangong-1

Examples of poorly filled in objects "spacecraft (Q25956)" were:

  1. SpaceX Dragon
  2. Orion
  3. Voskhod

The list of hierarchy and output of spacecrafts

The aim was to build up a hierarchy of spacecrafts so that to obtain the final list of spacecrafts which includes transport spaceships, fictional starships, and other space transportation. The tasks were to write a script that will list all the spacecrafts on the hierarchy basis. Spacecrafts are transport (designed for people), freight, fictional, and all others. This hierarchy will be used for solving the task. The following script helps to fulfil this task:

#List of spacecraft in English 
SELECT  ?spacecraft  ?label_en ?label_ru
WHERE
{
  {?spacecraft wdt:P31 wd:Q40218.} UNION #spacecraft
  {?spacecraft wdt:P31 wd:Q18039177.} UNION #fictional spacecraft
  {?spacecraft wdt:P31 wd:Q402330.} #robotic spacecraft
  ?spacecraft rdfs:label ?label_en filter (lang(?label_en) = "en").
}

SPARQL-request returns 136 spacecrafts of all types.

The search for Soviet Union and Russian spacecrafts among the objects of the Wikidata

From the general list of spacecrafts we deduce those that were designed in the USSR or Russia.

#List of spacecraft in English 
SELECT  ?spacecraft  ?label_en ?label_ru
WHERE
{
  {?spacecraft wdt:P31 wd:Q40218.} UNION #spacecraft
  {?spacecraft wdt:P31 wd:Q18039177.} UNION #fictional spacecraft
  {?spacecraft wdt:P31 wd:Q402330.}#robotic spacecraft
  {?spacecraft wdt:P17 wd:Q15180. } UNION #USSR
  {?spacecraft wdt:P17 wd:Q159. } #Russia
  ?spacecraft rdfs:label ?label_en filter (lang(?label_en) = "en").
  ?spacecraft rdfs:label ?label_ru filter (lang(?label_ru) = "ru").
}

SPARQL-request returns 103 spacecrafts.

Analysis of Wikidata completeness

At the moment the analysis was conducted there were too few Wikidata in the field of spacecrafts and stations. The requests on all the spacecrafts and stations showed 48 results all in all, and only 3 of them were withdrawn on the request for Russian and Soviet Union spacecrafts. At the same time the data in the article Soviet space program, the English Wikipedia, showed 42 spacecrafts designed in the USSR, which indicates the fact that the data in Wikidata are being far from complete. The website "Encyclopedia of the Winged Space" [1] describes 39 spacecrafts developed in the USSR. The script, with the help of which the search for Russian and Soviet Union spacecrafts in the knowledge base was made, is shown below:

#List of spacecraft in the USSR
SELECT  ?spacecraft  
WHERE
{
  {?spacecraft wdt:P31 wd:Q40218.} UNION #spacecraft
  {?spacecraft wdt:P31 wd:Q18039177.} UNION #fictional spacecraft
  {?spacecraft wdt:P31 wd:Q402330.}#robotic spacecraft
  {?spacecraft wdt:P17 wd:Q15180. } UNION #USSR
  {?spacecraft wdt:P17 wd:Q159. } #Russia
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

SPARQL-request returns 3 results, 30.10.2017.

It turned out that the objects of the spacecrafts do exist, but they have wrong value in the property "instance of": for example, as a "manned flight."

Filling in Wikidata on the objects of spacecrafts and stations.

In order to get more records when executing the script to search for Russian and Soviet Union spacecrafts and stations, it was decided to fill in the property "instance of (P86)" for objects of the type human spaceflight (Q752783) ". The results are presented below:

#List of spacecraft in English 
SELECT  ?spacecraft  
WHERE
{
  {?spacecraft wdt:P31 wd:Q40218.} UNION
  {?spacecraft wdt:P31 wd:Q18039177.} UNION
  {?spacecraft wdt:P31 wd:Q402330.}
  {?spacecraft wdt:P17 wd:Q15180. } UNION
  {?spacecraft wdt:P17 wd:Q159. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}

SPARQL-request returns 103 results, 09.11.2017.

Before we made the corrections in Wikidata, some of these objects had the property "instance of" with the wrong value "manned flight". These errors were fixed. These Wikidata corrections allow us to construct more correct time schedules presented at bar graphs below.


Time schedules of space exploration in Russia and the USSR and in the world

The following script constructs the bar graph with the schedule of launching spacecraft in Russia and the USSR from 1960 to 2017.

 
SELECT (str(?decade) AS ?decade) (COUNT(?inception) AS ?quantity) # number of "inceptions" ...
WHERE {
   {?item wdt:P31 wd:Q40218.} UNION #spacecraft
  {?item wdt:P31 wd:Q18039177.} UNION #fiction spacecraft
  {?item wdt:P31 wd:Q402330.} #robotic spacecraft
  {?item wdt:P17 wd:Q15180. } UNION #Russian and Soviet Union
  {?item wdt:P17 wd:Q159. }
  ?item wdt:P619 ?inception.
  BIND( YEAR(?inception) as ?year ) 
  BIND( FLOOR(?year/10)*10 as ?decade ) # ... per each 10 years
} 
GROUP BY ?decade 
ORDER BY ?decade

SPARQL-request.

Time schedule for launching spacecraft in Russia and the USSR

It can be seen from the graph that the most active period of space exploration in Russia and the USSR was in the 1970-1999 years.

The same graph with script for the whole world are shown below:

SELECT (str(?decade) AS ?decade) (COUNT(?inception) AS ?quantity) # number of "inceptions" ...
WHERE {
   {?item wdt:P31 wd:Q40218.} UNION #spacecraft
  {?item wdt:P31 wd:Q18039177.} UNION #fiction spacecraft
  {?item wdt:P31 wd:Q402330.} #robotic spacecraft
  ?item wdt:P619 ?inception.
  BIND( YEAR(?inception) as ?year ) 
  BIND( FLOOR(?year/10)*10 as ?decade ) # ... per each 10 years
} 
GROUP BY ?decade 
ORDER BY ?decade

SPARQL-request.

Time schedule for launching spacecraft in the world

The graph shows that at the current moment the data on Russian and Soviet Union spacecrafts prevail in the Wikidata, and spacecrafts from other countries are undistinguishable.

Future work

  • Calculate and display the list of ships that are sent or planned to be sent to Mars.
  • Calculate and make bar chart depicting the share of the ships intended for travelling to Mars and to the Moon.
  • Find crashed spacecrafts.

Exercises

1 Choose how many spacecrafts were launched in the USSR in the 60's, 70's and 80's of the XX century.

342911
60th
70th
80th

2 Arrange the number of spacecrafts launched by decades in ascending order.

1234
1970s.
1980s.
1990s.
2000s.

3 Write the name of the country where these spaceships were designed.

Soyuz 19 Soyuz-T Soviet lunar lander drawing

SPARQL-request with answers:
Answer to the first 2 questions.

Images of spacecrafts.

Acknowledgements

The authors are grateful to Evgenia Ivanovna Sokolova, the Head of the Foreign Languages Department at PetrSU, for the help in translating the article into the English language.

References

  1. Lukashivich 1998.
  • "All ships" (in Russian). 1998.
This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.