Planet Notebook
In [1]:
!which python
/home/kiran/.miniconda3/envs/dgraphpandas/bin/python
In [5]:
!python -m pip install dgraphpandas
!python -m pip install pandas
Requirement already satisfied: dgraphpandas in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (0.0.4) Requirement already satisfied: pandas in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from dgraphpandas) (1.1.5) Requirement already satisfied: python-dateutil>=2.7.3 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas->dgraphpandas) (2.8.1) Requirement already satisfied: numpy>=1.15.4 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas->dgraphpandas) (1.19.5) Requirement already satisfied: pytz>=2017.2 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas->dgraphpandas) (2021.1) Requirement already satisfied: six>=1.5 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from python-dateutil>=2.7.3->pandas->dgraphpandas) (1.15.0) Requirement already satisfied: pandas in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (1.1.5) Requirement already satisfied: pytz>=2017.2 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas) (2021.1) Requirement already satisfied: python-dateutil>=2.7.3 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas) (2.8.1) Requirement already satisfied: numpy>=1.15.4 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from pandas) (1.19.5) Requirement already satisfied: six>=1.5 in /home/kiran/.miniconda3/envs/dgraphpandas/lib/python3.6/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
In [6]:
from dgraphpandas.strategies.horizontal import horizontal_transform
from dgraphpandas.writers.upserts import generate_upserts
import pandas as pd
pd.set_option('mode.chained_assignment', None)
file = '../planets/solar_system.csv'
In [7]:
# View Source Data
pd.read_csv(file).head()
Out[7]:
id | name | type | order_from_sun | diameter_earth_relative | diameter_km | mass_earth_relative | mean_distance_from_sun_au | orbital_period_years | orbital_eccentricity | ... | mean_temperature_surface_c | gravity_equator_earth_relative | escape_velocity_km_sec | mean_density | atmospheric_composition | number_moons | rings | parent | image | uri | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | Sun | Star | 0 | 109.000 | 1392000.0 | 333000.000 | 0.00 | 0.00 | 0.0000 | ... | 5600 | 28.00 | 617.70 | 1.40 | H2+He | 0 | False | NaN | Images/Sun.jpg | http://en.wikipedia.org/wiki/Sun |
1 | 1 | Mercury | Terrestrial planet | 1 | 0.382 | 4878.0 | 0.055 | 0.39 | 0.24 | 0.2056 | ... | 125 | 0.38 | 4.25 | 5.43 | none | 0 | False | 1.0 | Images/Mercury.jpg | http://en.wikipedia.org/wiki/Mercury_(planet) |
2 | 2 | Venus | Terrestrial planet | 2 | 0.949 | 12104.0 | 0.815 | 0.72 | 0.62 | 0.0068 | ... | 465 | 0.90 | 10.36 | 5.25 | CO2 | 0 | False | 1.0 | Images/Venus.jpg | http://en.wikipedia.org/wiki/Venus |
3 | 3 | Earth | Terrestrial planet | 3 | 1.000 | 12756.0 | 1.000 | 1.00 | 1.00 | 0.0167 | ... | 15 | 1.00 | 11.18 | 5.52 | N2+O2 | 1 | False | 1.0 | Images/Earth.jpg | http://en.wikipedia.org/wiki/Earth |
4 | 4 | Mars | Terrestrial planet | 4 | 0.532 | 6787.0 | 0.107 | 1.52 | 1.88 | 0.0934 | ... | -53 | 0.38 | 5.02 | 3.93 | CO2 | 2 | False | 1.0 | Images/Mars.jpg | http://en.wikipedia.org/wiki/Mars |
5 rows × 23 columns
In [8]:
## Define Configuration
config = {
"transform": "horizontal",
"files": {
"planet": {
"subject_fields": ["id"],
"edge_fields": ["type"],
"type_overrides": {
"order_from_sun": "int32",
"diameter_earth_relative": "float32",
"diameter_km": "float32",
"mass_earth_relative": "float32",
"mean_distance_from_sun_au": "float32",
"orbital_period_years": "float32",
"orbital_eccentricity": "float32",
"mean_orbital_velocity_km_sec": "float32",
"rotation_period_days": "float32",
"inclination_axis_degrees": "float32",
"mean_temperature_surface_c": "float32",
"gravity_equator_earth_relative": "float32",
"escape_velocity_km_sec": "float32",
"mean_density": "float32",
"number_moons": "int32",
"rings": "bool"
},
"ignore_fields": ["image", "parent"]
}
}
}
In [9]:
# Perform a Horizontal Transform on the passed file using the config/key
intrinsic, edges = horizontal_transform(file, config, "planet")
In [10]:
intrinsic
Out[10]:
subject | predicate | object | type | |
---|---|---|---|---|
0 | planet_0 | name | Sun | <xs:string> |
1 | planet_1 | name | Mercury | <xs:string> |
2 | planet_2 | name | Venus | <xs:string> |
3 | planet_3 | name | Earth | <xs:string> |
4 | planet_4 | name | Mars | <xs:string> |
... | ... | ... | ... | ... |
9 | planet_9 | dgraph.type | planet | <xs:string> |
10 | planet_10 | dgraph.type | planet | <xs:string> |
11 | planet_11 | dgraph.type | planet | <xs:string> |
12 | planet_12 | dgraph.type | planet | <xs:string> |
13 | planet_13 | dgraph.type | planet | <xs:string> |
277 rows × 4 columns
In [11]:
edges
Out[11]:
subject | predicate | object | type | |
---|---|---|---|---|
14 | planet_0 | type | type_Star | None |
15 | planet_1 | type | type_Terrestrialplanet | None |
16 | planet_2 | type | type_Terrestrialplanet | None |
17 | planet_3 | type | type_Terrestrialplanet | None |
18 | planet_4 | type | type_Terrestrialplanet | None |
19 | planet_5 | type | type_Gasgiant | None |
20 | planet_6 | type | type_Gasgiant | None |
21 | planet_7 | type | type_Gasgiant | None |
22 | planet_8 | type | type_Gasgiant | None |
23 | planet_9 | type | type_Dwarfplanet | None |
24 | planet_10 | type | type_Dwarfplanet | None |
25 | planet_11 | type | type_Dwarfplanet | None |
26 | planet_12 | type | type_Dwarfplanet | None |
27 | planet_13 | type | type_Dwarfplanet | None |
In [12]:
# Generate RDF Upsert statements
intrinsic_upserts, edges_upserts = generate_upserts(intrinsic, edges)
In [13]:
display(intrinsic_upserts)
['<planet_0> <name> "Sun"^^<xs:string> .', '<planet_1> <name> "Mercury"^^<xs:string> .', '<planet_2> <name> "Venus"^^<xs:string> .', '<planet_3> <name> "Earth"^^<xs:string> .', '<planet_4> <name> "Mars"^^<xs:string> .', '<planet_5> <name> "Jupiter"^^<xs:string> .', '<planet_6> <name> "Saturn"^^<xs:string> .', '<planet_7> <name> "Uranus"^^<xs:string> .', '<planet_8> <name> "Neptune"^^<xs:string> .', '<planet_9> <name> "Ceres"^^<xs:string> .', '<planet_10> <name> "Pluto"^^<xs:string> .', '<planet_11> <name> "Haumea"^^<xs:string> .', '<planet_12> <name> "Makemake"^^<xs:string> .', '<planet_13> <name> "Eris"^^<xs:string> .', '<planet_0> <order_from_sun> "0"^^<xs:int> .', '<planet_1> <order_from_sun> "1"^^<xs:int> .', '<planet_2> <order_from_sun> "2"^^<xs:int> .', '<planet_3> <order_from_sun> "3"^^<xs:int> .', '<planet_4> <order_from_sun> "4"^^<xs:int> .', '<planet_5> <order_from_sun> "6"^^<xs:int> .', '<planet_6> <order_from_sun> "7"^^<xs:int> .', '<planet_7> <order_from_sun> "8"^^<xs:int> .', '<planet_8> <order_from_sun> "9"^^<xs:int> .', '<planet_9> <order_from_sun> "5"^^<xs:int> .', '<planet_10> <order_from_sun> "10"^^<xs:int> .', '<planet_11> <order_from_sun> "11"^^<xs:int> .', '<planet_12> <order_from_sun> "12"^^<xs:int> .', '<planet_13> <order_from_sun> "13"^^<xs:int> .', '<planet_0> <diameter_earth_relative> "109.0"^^<xs:float> .', '<planet_1> <diameter_earth_relative> "0.38199999928474426"^^<xs:float> .', '<planet_2> <diameter_earth_relative> "0.9490000009536743"^^<xs:float> .', '<planet_3> <diameter_earth_relative> "1.0"^^<xs:float> .', '<planet_4> <diameter_earth_relative> "0.5320000052452087"^^<xs:float> .', '<planet_5> <diameter_earth_relative> "11.208999633789062"^^<xs:float> .', '<planet_6> <diameter_earth_relative> "9.4399995803833"^^<xs:float> .', '<planet_7> <diameter_earth_relative> "4.006999969482422"^^<xs:float> .', '<planet_8> <diameter_earth_relative> "3.882999897003174"^^<xs:float> .', '<planet_9> <diameter_earth_relative> "0.07599999755620956"^^<xs:float> .', '<planet_10> <diameter_earth_relative> "0.18000000715255737"^^<xs:float> .', '<planet_11> <diameter_earth_relative> "0.10999999940395355"^^<xs:float> .', '<planet_12> <diameter_earth_relative> "0.12549999356269836"^^<xs:float> .', '<planet_13> <diameter_earth_relative> "0.21150000393390656"^^<xs:float> .', '<planet_0> <diameter_km> "1392000.0"^^<xs:float> .', '<planet_1> <diameter_km> "4878.0"^^<xs:float> .', '<planet_2> <diameter_km> "12104.0"^^<xs:float> .', '<planet_3> <diameter_km> "12756.0"^^<xs:float> .', '<planet_4> <diameter_km> "6787.0"^^<xs:float> .', '<planet_5> <diameter_km> "142800.0"^^<xs:float> .', '<planet_6> <diameter_km> "120000.0"^^<xs:float> .', '<planet_7> <diameter_km> "51118.0"^^<xs:float> .', '<planet_8> <diameter_km> "49528.0"^^<xs:float> .', '<planet_9> <diameter_km> "974.5999755859375"^^<xs:float> .', '<planet_10> <diameter_km> "2300.0"^^<xs:float> .', '<planet_11> <diameter_km> "1300.0"^^<xs:float> .', '<planet_12> <diameter_km> "1420.0"^^<xs:float> .', '<planet_13> <diameter_km> "2326.0"^^<xs:float> .', '<planet_0> <mass_earth_relative> "333000.0"^^<xs:float> .', '<planet_1> <mass_earth_relative> "0.054999999701976776"^^<xs:float> .', '<planet_2> <mass_earth_relative> "0.8149999976158142"^^<xs:float> .', '<planet_3> <mass_earth_relative> "1.0"^^<xs:float> .', '<planet_4> <mass_earth_relative> "0.10700000077486038"^^<xs:float> .', '<planet_5> <mass_earth_relative> "318.0"^^<xs:float> .', '<planet_6> <mass_earth_relative> "95.0"^^<xs:float> .', '<planet_7> <mass_earth_relative> "15.0"^^<xs:float> .', '<planet_8> <mass_earth_relative> "17.0"^^<xs:float> .', '<planet_9> <mass_earth_relative> "0.00015999999595806003"^^<xs:float> .', '<planet_10> <mass_earth_relative> "0.0020000000949949026"^^<xs:float> .', '<planet_11> <mass_earth_relative> "0.000699999975040555"^^<xs:float> .', '<planet_12> <mass_earth_relative> "0.0006699999794363976"^^<xs:float> .', '<planet_13> <mass_earth_relative> "0.00279999990016222"^^<xs:float> .', '<planet_0> <mean_distance_from_sun_au> "0.0"^^<xs:float> .', '<planet_1> <mean_distance_from_sun_au> "0.38999998569488525"^^<xs:float> .', '<planet_2> <mean_distance_from_sun_au> "0.7200000286102295"^^<xs:float> .', '<planet_3> <mean_distance_from_sun_au> "1.0"^^<xs:float> .', '<planet_4> <mean_distance_from_sun_au> "1.5199999809265137"^^<xs:float> .', '<planet_5> <mean_distance_from_sun_au> "5.199999809265137"^^<xs:float> .', '<planet_6> <mean_distance_from_sun_au> "9.539999961853027"^^<xs:float> .', '<planet_7> <mean_distance_from_sun_au> "19.18000030517578"^^<xs:float> .', '<planet_8> <mean_distance_from_sun_au> "30.059999465942383"^^<xs:float> .', '<planet_9> <mean_distance_from_sun_au> "2.7659599781036377"^^<xs:float> .', '<planet_10> <mean_distance_from_sun_au> "39.439998626708984"^^<xs:float> .', '<planet_11> <mean_distance_from_sun_au> "43.334999084472656"^^<xs:float> .', '<planet_12> <mean_distance_from_sun_au> "45.79100036621094"^^<xs:float> .', '<planet_13> <mean_distance_from_sun_au> "67.66809844970703"^^<xs:float> .', '<planet_0> <orbital_period_years> "0.0"^^<xs:float> .', '<planet_1> <orbital_period_years> "0.23999999463558197"^^<xs:float> .', '<planet_2> <orbital_period_years> "0.6200000047683716"^^<xs:float> .', '<planet_3> <orbital_period_years> "1.0"^^<xs:float> .', '<planet_4> <orbital_period_years> "1.8799999952316284"^^<xs:float> .', '<planet_5> <orbital_period_years> "11.859999656677246"^^<xs:float> .', '<planet_6> <orbital_period_years> "29.459999084472656"^^<xs:float> .', '<planet_7> <orbital_period_years> "84.01000213623047"^^<xs:float> .', '<planet_8> <orbital_period_years> "164.8000030517578"^^<xs:float> .', '<planet_9> <orbital_period_years> "4.598999977111816"^^<xs:float> .', '<planet_10> <orbital_period_years> "247.6999969482422"^^<xs:float> .', '<planet_11> <orbital_period_years> "285.3999938964844"^^<xs:float> .', '<planet_12> <orbital_period_years> "309.8800048828125"^^<xs:float> .', '<planet_13> <orbital_period_years> "557.0"^^<xs:float> .', '<planet_0> <orbital_eccentricity> "0.0"^^<xs:float> .', '<planet_1> <orbital_eccentricity> "0.20559999346733093"^^<xs:float> .', '<planet_2> <orbital_eccentricity> "0.006800000090152025"^^<xs:float> .', '<planet_3> <orbital_eccentricity> "0.016699999570846558"^^<xs:float> .', '<planet_4> <orbital_eccentricity> "0.0934000015258789"^^<xs:float> .', '<planet_5> <orbital_eccentricity> "0.04830000177025795"^^<xs:float> .', '<planet_6> <orbital_eccentricity> "0.0560000017285347"^^<xs:float> .', '<planet_7> <orbital_eccentricity> "0.04610000178217888"^^<xs:float> .', '<planet_8> <orbital_eccentricity> "0.009700000286102295"^^<xs:float> .', '<planet_9> <orbital_eccentricity> "0.07976000010967255"^^<xs:float> .', '<planet_10> <orbital_eccentricity> "0.24819999933242798"^^<xs:float> .', '<planet_11> <orbital_eccentricity> "0.18874000012874603"^^<xs:float> .', '<planet_12> <orbital_eccentricity> "0.1589999943971634"^^<xs:float> .', '<planet_13> <orbital_eccentricity> "0.4417699873447418"^^<xs:float> .', '<planet_0> <mean_orbital_velocity_km_sec> "0.0"^^<xs:float> .', '<planet_1> <mean_orbital_velocity_km_sec> "47.88999938964844"^^<xs:float> .', '<planet_2> <mean_orbital_velocity_km_sec> "35.029998779296875"^^<xs:float> .', '<planet_3> <mean_orbital_velocity_km_sec> "29.790000915527344"^^<xs:float> .', '<planet_4> <mean_orbital_velocity_km_sec> "24.1299991607666"^^<xs:float> .', '<planet_5> <mean_orbital_velocity_km_sec> "13.0600004196167"^^<xs:float> .', '<planet_6> <mean_orbital_velocity_km_sec> "9.640000343322754"^^<xs:float> .', '<planet_7> <mean_orbital_velocity_km_sec> "6.809999942779541"^^<xs:float> .', '<planet_8> <mean_orbital_velocity_km_sec> "5.429999828338623"^^<xs:float> .', '<planet_9> <mean_orbital_velocity_km_sec> "17.881999969482422"^^<xs:float> .', '<planet_10> <mean_orbital_velocity_km_sec> "4.739999771118164"^^<xs:float> .', '<planet_11> <mean_orbital_velocity_km_sec> "4.484000205993652"^^<xs:float> .', '<planet_12> <mean_orbital_velocity_km_sec> "4.419000148773193"^^<xs:float> .', '<planet_13> <mean_orbital_velocity_km_sec> "3.436000108718872"^^<xs:float> .', '<planet_0> <rotation_period_days> "25.049999237060547"^^<xs:float> .', '<planet_1> <rotation_period_days> "58.650001525878906"^^<xs:float> .', '<planet_2> <rotation_period_days> "-243.0"^^<xs:float> .', '<planet_3> <rotation_period_days> "1.0"^^<xs:float> .', '<planet_4> <rotation_period_days> "1.0299999713897705"^^<xs:float> .', '<planet_5> <rotation_period_days> "0.4099999964237213"^^<xs:float> .', '<planet_6> <rotation_period_days> "0.4399999976158142"^^<xs:float> .', '<planet_7> <rotation_period_days> "-0.7200000286102295"^^<xs:float> .', '<planet_8> <rotation_period_days> "0.7200000286102295"^^<xs:float> .', '<planet_9> <rotation_period_days> "0.3779999911785126"^^<xs:float> .', '<planet_10> <rotation_period_days> "-6.380000114440918"^^<xs:float> .', '<planet_11> <rotation_period_days> "0.16300000250339508"^^<xs:float> .', '<planet_12> <rotation_period_days> "0.3199999928474426"^^<xs:float> .', '<planet_13> <rotation_period_days> "1.0"^^<xs:float> .', '<planet_0> <inclination_axis_degrees> "7.25"^^<xs:float> .', '<planet_1> <inclination_axis_degrees> "0.0"^^<xs:float> .', '<planet_2> <inclination_axis_degrees> "177.39999389648438"^^<xs:float> .', '<planet_3> <inclination_axis_degrees> "23.450000762939453"^^<xs:float> .', '<planet_4> <inclination_axis_degrees> "23.979999542236328"^^<xs:float> .', '<planet_5> <inclination_axis_degrees> "3.0799999237060547"^^<xs:float> .', '<planet_6> <inclination_axis_degrees> "26.729999542236328"^^<xs:float> .', '<planet_7> <inclination_axis_degrees> "97.91999816894531"^^<xs:float> .', '<planet_8> <inclination_axis_degrees> "28.799999237060547"^^<xs:float> .', '<planet_9> <inclination_axis_degrees> "3.0"^^<xs:float> .', '<planet_10> <inclination_axis_degrees> "122.0"^^<xs:float> .', '<planet_0> <mean_temperature_surface_c> "5600.0"^^<xs:float> .', '<planet_1> <mean_temperature_surface_c> "125.0"^^<xs:float> .', '<planet_2> <mean_temperature_surface_c> "465.0"^^<xs:float> .', '<planet_3> <mean_temperature_surface_c> "15.0"^^<xs:float> .', '<planet_4> <mean_temperature_surface_c> "-53.0"^^<xs:float> .', '<planet_5> <mean_temperature_surface_c> "-150.0"^^<xs:float> .', '<planet_6> <mean_temperature_surface_c> "-170.0"^^<xs:float> .', '<planet_7> <mean_temperature_surface_c> "-200.0"^^<xs:float> .', '<planet_8> <mean_temperature_surface_c> "-210.0"^^<xs:float> .', '<planet_9> <mean_temperature_surface_c> "-106.0"^^<xs:float> .', '<planet_10> <mean_temperature_surface_c> "-220.0"^^<xs:float> .', '<planet_11> <mean_temperature_surface_c> "-223.0"^^<xs:float> .', '<planet_12> <mean_temperature_surface_c> "-240.0"^^<xs:float> .', '<planet_13> <mean_temperature_surface_c> "-230.0"^^<xs:float> .', '<planet_0> <gravity_equator_earth_relative> "28.0"^^<xs:float> .', '<planet_1> <gravity_equator_earth_relative> "0.3799999952316284"^^<xs:float> .', '<planet_2> <gravity_equator_earth_relative> "0.8999999761581421"^^<xs:float> .', '<planet_3> <gravity_equator_earth_relative> "1.0"^^<xs:float> .', '<planet_4> <gravity_equator_earth_relative> "0.3799999952316284"^^<xs:float> .', '<planet_5> <gravity_equator_earth_relative> "2.640000104904175"^^<xs:float> .', '<planet_6> <gravity_equator_earth_relative> "0.9300000071525574"^^<xs:float> .', '<planet_7> <gravity_equator_earth_relative> "0.8899999856948853"^^<xs:float> .', '<planet_8> <gravity_equator_earth_relative> "1.1200000047683716"^^<xs:float> .', '<planet_9> <gravity_equator_earth_relative> "0.02800000086426735"^^<xs:float> .', '<planet_10> <gravity_equator_earth_relative> "0.05999999865889549"^^<xs:float> .', '<planet_11> <gravity_equator_earth_relative> "0.04500000178813934"^^<xs:float> .', '<planet_12> <gravity_equator_earth_relative> "0.050999999046325684"^^<xs:float> .', '<planet_13> <gravity_equator_earth_relative> "0.0820000022649765"^^<xs:float> .', '<planet_0> <escape_velocity_km_sec> "617.7000122070312"^^<xs:float> .', '<planet_1> <escape_velocity_km_sec> "4.25"^^<xs:float> .', '<planet_2> <escape_velocity_km_sec> "10.359999656677246"^^<xs:float> .', '<planet_3> <escape_velocity_km_sec> "11.180000305175781"^^<xs:float> .', '<planet_4> <escape_velocity_km_sec> "5.019999980926514"^^<xs:float> .', '<planet_5> <escape_velocity_km_sec> "59.540000915527344"^^<xs:float> .', '<planet_6> <escape_velocity_km_sec> "35.4900016784668"^^<xs:float> .', '<planet_7> <escape_velocity_km_sec> "21.290000915527344"^^<xs:float> .', '<planet_8> <escape_velocity_km_sec> "23.709999084472656"^^<xs:float> .', '<planet_9> <escape_velocity_km_sec> "0.5099999904632568"^^<xs:float> .', '<planet_10> <escape_velocity_km_sec> "1.2699999809265137"^^<xs:float> .', '<planet_11> <escape_velocity_km_sec> "0.8399999737739563"^^<xs:float> .', '<planet_12> <escape_velocity_km_sec> "0.800000011920929"^^<xs:float> .', '<planet_13> <escape_velocity_km_sec> "1.309999942779541"^^<xs:float> .', '<planet_0> <mean_density> "1.399999976158142"^^<xs:float> .', '<planet_1> <mean_density> "5.429999828338623"^^<xs:float> .', '<planet_2> <mean_density> "5.25"^^<xs:float> .', '<planet_3> <mean_density> "5.519999980926514"^^<xs:float> .', '<planet_4> <mean_density> "3.930000066757202"^^<xs:float> .', '<planet_5> <mean_density> "1.3300000429153442"^^<xs:float> .', '<planet_6> <mean_density> "0.7099999785423279"^^<xs:float> .', '<planet_7> <mean_density> "1.2400000095367432"^^<xs:float> .', '<planet_8> <mean_density> "1.6699999570846558"^^<xs:float> .', '<planet_9> <mean_density> "2.0769999027252197"^^<xs:float> .', '<planet_10> <mean_density> "2.0299999713897705"^^<xs:float> .', '<planet_11> <mean_density> "2.950000047683716"^^<xs:float> .', '<planet_12> <mean_density> "2.0"^^<xs:float> .', '<planet_13> <mean_density> "1.7450000047683716"^^<xs:float> .', '<planet_0> <atmospheric_composition> "H2+He"^^<xs:string> .', '<planet_1> <atmospheric_composition> "none"^^<xs:string> .', '<planet_2> <atmospheric_composition> "CO2"^^<xs:string> .', '<planet_3> <atmospheric_composition> "N2+O2"^^<xs:string> .', '<planet_4> <atmospheric_composition> "CO2"^^<xs:string> .', '<planet_5> <atmospheric_composition> "H2+He"^^<xs:string> .', '<planet_6> <atmospheric_composition> "H2+He"^^<xs:string> .', '<planet_7> <atmospheric_composition> "H2+He"^^<xs:string> .', '<planet_8> <atmospheric_composition> "H2+He"^^<xs:string> .', '<planet_9> <atmospheric_composition> "none"^^<xs:string> .', '<planet_10> <atmospheric_composition> "CH4"^^<xs:string> .', '<planet_11> <atmospheric_composition> "none?"^^<xs:string> .', '<planet_12> <atmospheric_composition> "maybe CH4"^^<xs:string> .', '<planet_13> <atmospheric_composition> "maybe CH4"^^<xs:string> .', '<planet_0> <number_moons> "0"^^<xs:int> .', '<planet_1> <number_moons> "0"^^<xs:int> .', '<planet_2> <number_moons> "0"^^<xs:int> .', '<planet_3> <number_moons> "1"^^<xs:int> .', '<planet_4> <number_moons> "2"^^<xs:int> .', '<planet_5> <number_moons> "63"^^<xs:int> .', '<planet_6> <number_moons> "62"^^<xs:int> .', '<planet_7> <number_moons> "27"^^<xs:int> .', '<planet_8> <number_moons> "13"^^<xs:int> .', '<planet_9> <number_moons> "0"^^<xs:int> .', '<planet_10> <number_moons> "3"^^<xs:int> .', '<planet_11> <number_moons> "2"^^<xs:int> .', '<planet_12> <number_moons> "0"^^<xs:int> .', '<planet_13> <number_moons> "1"^^<xs:int> .', '<planet_0> <rings> "False"^^<xs:bool> .', '<planet_1> <rings> "False"^^<xs:bool> .', '<planet_2> <rings> "False"^^<xs:bool> .', '<planet_3> <rings> "False"^^<xs:bool> .', '<planet_4> <rings> "False"^^<xs:bool> .', '<planet_5> <rings> "True"^^<xs:bool> .', '<planet_6> <rings> "True"^^<xs:bool> .', '<planet_7> <rings> "True"^^<xs:bool> .', '<planet_8> <rings> "True"^^<xs:bool> .', '<planet_9> <rings> "False"^^<xs:bool> .', '<planet_10> <rings> "False"^^<xs:bool> .', '<planet_11> <rings> "False"^^<xs:bool> .', '<planet_12> <rings> "False"^^<xs:bool> .', '<planet_13> <rings> "False"^^<xs:bool> .', '<planet_0> <uri> "http://en.wikipedia.org/wiki/Sun"^^<xs:string> .', '<planet_1> <uri> "http://en.wikipedia.org/wiki/Mercury_(planet)"^^<xs:string> .', '<planet_2> <uri> "http://en.wikipedia.org/wiki/Venus"^^<xs:string> .', '<planet_3> <uri> "http://en.wikipedia.org/wiki/Earth"^^<xs:string> .', '<planet_4> <uri> "http://en.wikipedia.org/wiki/Mars"^^<xs:string> .', '<planet_5> <uri> "http://en.wikipedia.org/wiki/Jupiter"^^<xs:string> .', '<planet_6> <uri> "http://en.wikipedia.org/wiki/Saturn"^^<xs:string> .', '<planet_7> <uri> "http://en.wikipedia.org/wiki/Uranus"^^<xs:string> .', '<planet_8> <uri> "http://en.wikipedia.org/wiki/Neptune"^^<xs:string> .', '<planet_9> <uri> "http://en.wikipedia.org/wiki/Ceres_(dwarf_planet)"^^<xs:string> .', '<planet_10> <uri> "http://en.wikipedia.org/wiki/Pluto"^^<xs:string> .', '<planet_11> <uri> "http://en.wikipedia.org/wiki/Haumea_(dwarf_planet)"^^<xs:string> .', '<planet_12> <uri> "http://en.wikipedia.org/wiki/Makemake_(dwarf_planet)"^^<xs:string> .', '<planet_13> <uri> "http://en.wikipedia.org/wiki/Eris_(dwarf_planet)"^^<xs:string> .', '<planet_0> <dgraph.type> "planet"^^<xs:string> .', '<planet_1> <dgraph.type> "planet"^^<xs:string> .', '<planet_2> <dgraph.type> "planet"^^<xs:string> .', '<planet_3> <dgraph.type> "planet"^^<xs:string> .', '<planet_4> <dgraph.type> "planet"^^<xs:string> .', '<planet_5> <dgraph.type> "planet"^^<xs:string> .', '<planet_6> <dgraph.type> "planet"^^<xs:string> .', '<planet_7> <dgraph.type> "planet"^^<xs:string> .', '<planet_8> <dgraph.type> "planet"^^<xs:string> .', '<planet_9> <dgraph.type> "planet"^^<xs:string> .', '<planet_10> <dgraph.type> "planet"^^<xs:string> .', '<planet_11> <dgraph.type> "planet"^^<xs:string> .', '<planet_12> <dgraph.type> "planet"^^<xs:string> .', '<planet_13> <dgraph.type> "planet"^^<xs:string> .']
In [14]:
display(edges_upserts)
['<planet_0> <type> <type_Star> .', '<planet_1> <type> <type_Terrestrialplanet> .', '<planet_2> <type> <type_Terrestrialplanet> .', '<planet_3> <type> <type_Terrestrialplanet> .', '<planet_4> <type> <type_Terrestrialplanet> .', '<planet_5> <type> <type_Gasgiant> .', '<planet_6> <type> <type_Gasgiant> .', '<planet_7> <type> <type_Gasgiant> .', '<planet_8> <type> <type_Gasgiant> .', '<planet_9> <type> <type_Dwarfplanet> .', '<planet_10> <type> <type_Dwarfplanet> .', '<planet_11> <type> <type_Dwarfplanet> .', '<planet_12> <type> <type_Dwarfplanet> .', '<planet_13> <type> <type_Dwarfplanet> .']
In [15]:
!python -m pip uninstall dgraphpandas -y
Found existing installation: dgraphpandas 0.0.4 Uninstalling dgraphpandas-0.0.4: Successfully uninstalled dgraphpandas-0.0.4