In [7]:
from rdflib import *
import pandas as pd
import slugify

In [3]:
sio = Graph()
sio.load('http://semanticscience.org/ontology/sio.owl',format='xml')

chear = Graph()
chear.load('chear.ttl',format='turtle')

In [5]:
sio_mappings = pd.DataFrame.from_records(data=list(sio.query('select ?class ?label where { ?class a owl:Class; rdfs:label ?label}',
                                                   initNs=dict(owl=OWL, rdfs=RDFS))), 
                                         columns=['class','label'] )


Out[5]:
class label
0 http://semanticscience.org/resource/SIO_001025 prognosis
1 http://semanticscience.org/resource/SIO_000999 procedure
2 http://semanticscience.org/resource/SIO_000165 thesis document
3 http://semanticscience.org/resource/SIO_011105 protactinium atom
4 http://semanticscience.org/resource/SIO_001349 gene-disease association linked with chromosom...
5 http://semanticscience.org/resource/SIO_000783 spatial boundary
6 http://semanticscience.org/resource/SIO_000170 diary
7 http://semanticscience.org/resource/SIO_000017 function
8 http://semanticscience.org/resource/SIO_001071 text span start position
9 http://semanticscience.org/resource/SIO_010432 ligand
10 http://semanticscience.org/resource/SIO_000519 bar
11 http://semanticscience.org/resource/SIO_000921 dependent variable
12 http://semanticscience.org/resource/SIO_010309 catabolism
13 http://semanticscience.org/resource/SIO_001054 measuring
14 http://semanticscience.org/resource/SIO_001294 very poor quality
15 http://semanticscience.org/resource/SIO_011078 bohrium atom
16 http://semanticscience.org/resource/SIO_001144 maintenance of frequency of process
17 http://semanticscience.org/resource/SIO_001191 SOAP web service
18 http://semanticscience.org/resource/SIO_001295 poor quality
19 http://semanticscience.org/resource/SIO_010283 chemical transport
20 http://semanticscience.org/resource/SIO_011070 astatine atom
21 http://semanticscience.org/resource/SIO_010379 virus
22 http://semanticscience.org/resource/SIO_001125 regulation of transcription
23 http://semanticscience.org/resource/SIO_000104 language
24 http://semanticscience.org/resource/SIO_011044 rhodium atom
25 http://semanticscience.org/resource/SIO_000907 heatmap
26 http://semanticscience.org/resource/SIO_000593 interacting
27 http://semanticscience.org/resource/SIO_001009 toxic
28 http://semanticscience.org/resource/SIO_000038 1D extent quantity
29 http://semanticscience.org/resource/SIO_010517 isomerization reaction
... ... ...
1514 http://semanticscience.org/resource/SIO_000876 student advisor role
1515 http://semanticscience.org/resource/SIO_001393 post-translational modification
1516 http://semanticscience.org/resource/SIO_000613 ordinal position
1517 http://semanticscience.org/resource/SIO_000986 functional rna coding gene
1518 http://semanticscience.org/resource/SIO_011018 potassium atom
1519 http://semanticscience.org/resource/SIO_000868 sorrow
1520 http://semanticscience.org/resource/SIO_001293 quality descriptor
1521 http://semanticscience.org/resource/SIO_010525 biochemical pathway
1522 http://semanticscience.org/resource/SIO_001335 node
1523 http://semanticscience.org/resource/SIO_000542 to serve as
1524 http://semanticscience.org/resource/SIO_000115 identifier
1525 http://semanticscience.org/resource/SIO_001308 satisfaction qualifier
1526 http://semanticscience.org/resource/SIO_011051 tellurium atom
1527 http://semanticscience.org/resource/SIO_000333 3D cartesian coordinate
1528 http://semanticscience.org/resource/SIO_000308 edition number
1529 http://semanticscience.org/resource/SIO_010288 biochemical activation
1530 http://semanticscience.org/resource/SIO_000590 biosynthesis
1531 http://semanticscience.org/resource/SIO_000166 honor's thesis
1532 http://semanticscience.org/resource/SIO_000753 column
1533 http://semanticscience.org/resource/SIO_000600 structure
1534 http://semanticscience.org/resource/SIO_010023 tertiary structure descriptor
1535 http://semanticscience.org/resource/SIO_000852 loneliness
1536 http://semanticscience.org/resource/SIO_001029 peer reviewed article
1537 http://semanticscience.org/resource/SIO_000848 interest
1538 http://semanticscience.org/resource/SIO_000111 document section
1539 http://semanticscience.org/resource/SIO_010778 optical isomer
1540 http://semanticscience.org/resource/SIO_001370 slide
1541 http://semanticscience.org/resource/SIO_010096 mature mRNA
1542 http://semanticscience.org/resource/SIO_001380 protein family
1543 http://semanticscience.org/resource/SIO_001245 standard score

1544 rows × 2 columns


In [12]:
sio_mappings['numeric_uri'] = [x.replace('http://semanticscience.org/resource/','sio:')
                               for x in sio_mappings['class']]
sio_mappings['label_uri'] = ['sio:'+''.join(w if w.isupper() else w.capitalize() for w in x.split())
                            for x in sio_mappings['label']]
sio_mappings


Out[12]:
class label numeric_uri label_uri
0 http://semanticscience.org/resource/SIO_001025 prognosis sio:SIO_001025 sio:Prognosis
1 http://semanticscience.org/resource/SIO_000999 procedure sio:SIO_000999 sio:Procedure
2 http://semanticscience.org/resource/SIO_000165 thesis document sio:SIO_000165 sio:ThesisDocument
3 http://semanticscience.org/resource/SIO_011105 protactinium atom sio:SIO_011105 sio:ProtactiniumAtom
4 http://semanticscience.org/resource/SIO_001349 gene-disease association linked with chromosom... sio:SIO_001349 sio:Gene-diseaseAssociationLinkedWithChromosom...
5 http://semanticscience.org/resource/SIO_000783 spatial boundary sio:SIO_000783 sio:SpatialBoundary
6 http://semanticscience.org/resource/SIO_000170 diary sio:SIO_000170 sio:Diary
7 http://semanticscience.org/resource/SIO_000017 function sio:SIO_000017 sio:Function
8 http://semanticscience.org/resource/SIO_001071 text span start position sio:SIO_001071 sio:TextSpanStartPosition
9 http://semanticscience.org/resource/SIO_010432 ligand sio:SIO_010432 sio:Ligand
10 http://semanticscience.org/resource/SIO_000519 bar sio:SIO_000519 sio:Bar
11 http://semanticscience.org/resource/SIO_000921 dependent variable sio:SIO_000921 sio:DependentVariable
12 http://semanticscience.org/resource/SIO_010309 catabolism sio:SIO_010309 sio:Catabolism
13 http://semanticscience.org/resource/SIO_001054 measuring sio:SIO_001054 sio:Measuring
14 http://semanticscience.org/resource/SIO_001294 very poor quality sio:SIO_001294 sio:VeryPoorQuality
15 http://semanticscience.org/resource/SIO_011078 bohrium atom sio:SIO_011078 sio:BohriumAtom
16 http://semanticscience.org/resource/SIO_001144 maintenance of frequency of process sio:SIO_001144 sio:MaintenanceOfFrequencyOfProcess
17 http://semanticscience.org/resource/SIO_001191 SOAP web service sio:SIO_001191 sio:SOAPWebService
18 http://semanticscience.org/resource/SIO_001295 poor quality sio:SIO_001295 sio:PoorQuality
19 http://semanticscience.org/resource/SIO_010283 chemical transport sio:SIO_010283 sio:ChemicalTransport
20 http://semanticscience.org/resource/SIO_011070 astatine atom sio:SIO_011070 sio:AstatineAtom
21 http://semanticscience.org/resource/SIO_010379 virus sio:SIO_010379 sio:Virus
22 http://semanticscience.org/resource/SIO_001125 regulation of transcription sio:SIO_001125 sio:RegulationOfTranscription
23 http://semanticscience.org/resource/SIO_000104 language sio:SIO_000104 sio:Language
24 http://semanticscience.org/resource/SIO_011044 rhodium atom sio:SIO_011044 sio:RhodiumAtom
25 http://semanticscience.org/resource/SIO_000907 heatmap sio:SIO_000907 sio:Heatmap
26 http://semanticscience.org/resource/SIO_000593 interacting sio:SIO_000593 sio:Interacting
27 http://semanticscience.org/resource/SIO_001009 toxic sio:SIO_001009 sio:Toxic
28 http://semanticscience.org/resource/SIO_000038 1D extent quantity sio:SIO_000038 sio:1DExtentQuantity
29 http://semanticscience.org/resource/SIO_010517 isomerization reaction sio:SIO_010517 sio:IsomerizationReaction
... ... ... ... ...
1514 http://semanticscience.org/resource/SIO_000876 student advisor role sio:SIO_000876 sio:StudentAdvisorRole
1515 http://semanticscience.org/resource/SIO_001393 post-translational modification sio:SIO_001393 sio:Post-translationalModification
1516 http://semanticscience.org/resource/SIO_000613 ordinal position sio:SIO_000613 sio:OrdinalPosition
1517 http://semanticscience.org/resource/SIO_000986 functional rna coding gene sio:SIO_000986 sio:FunctionalRnaCodingGene
1518 http://semanticscience.org/resource/SIO_011018 potassium atom sio:SIO_011018 sio:PotassiumAtom
1519 http://semanticscience.org/resource/SIO_000868 sorrow sio:SIO_000868 sio:Sorrow
1520 http://semanticscience.org/resource/SIO_001293 quality descriptor sio:SIO_001293 sio:QualityDescriptor
1521 http://semanticscience.org/resource/SIO_010525 biochemical pathway sio:SIO_010525 sio:BiochemicalPathway
1522 http://semanticscience.org/resource/SIO_001335 node sio:SIO_001335 sio:Node
1523 http://semanticscience.org/resource/SIO_000542 to serve as sio:SIO_000542 sio:ToServeAs
1524 http://semanticscience.org/resource/SIO_000115 identifier sio:SIO_000115 sio:Identifier
1525 http://semanticscience.org/resource/SIO_001308 satisfaction qualifier sio:SIO_001308 sio:SatisfactionQualifier
1526 http://semanticscience.org/resource/SIO_011051 tellurium atom sio:SIO_011051 sio:TelluriumAtom
1527 http://semanticscience.org/resource/SIO_000333 3D cartesian coordinate sio:SIO_000333 sio:3DCartesianCoordinate
1528 http://semanticscience.org/resource/SIO_000308 edition number sio:SIO_000308 sio:EditionNumber
1529 http://semanticscience.org/resource/SIO_010288 biochemical activation sio:SIO_010288 sio:BiochemicalActivation
1530 http://semanticscience.org/resource/SIO_000590 biosynthesis sio:SIO_000590 sio:Biosynthesis
1531 http://semanticscience.org/resource/SIO_000166 honor's thesis sio:SIO_000166 sio:Honor'sThesis
1532 http://semanticscience.org/resource/SIO_000753 column sio:SIO_000753 sio:Column
1533 http://semanticscience.org/resource/SIO_000600 structure sio:SIO_000600 sio:Structure
1534 http://semanticscience.org/resource/SIO_010023 tertiary structure descriptor sio:SIO_010023 sio:TertiaryStructureDescriptor
1535 http://semanticscience.org/resource/SIO_000852 loneliness sio:SIO_000852 sio:Loneliness
1536 http://semanticscience.org/resource/SIO_001029 peer reviewed article sio:SIO_001029 sio:PeerReviewedArticle
1537 http://semanticscience.org/resource/SIO_000848 interest sio:SIO_000848 sio:Interest
1538 http://semanticscience.org/resource/SIO_000111 document section sio:SIO_000111 sio:DocumentSection
1539 http://semanticscience.org/resource/SIO_010778 optical isomer sio:SIO_010778 sio:OpticalIsomer
1540 http://semanticscience.org/resource/SIO_001370 slide sio:SIO_001370 sio:Slide
1541 http://semanticscience.org/resource/SIO_010096 mature mRNA sio:SIO_010096 sio:MatureMrna
1542 http://semanticscience.org/resource/SIO_001380 protein family sio:SIO_001380 sio:ProteinFamily
1543 http://semanticscience.org/resource/SIO_001245 standard score sio:SIO_001245 sio:StandardScore

1544 rows × 4 columns


In [19]:
query = '''
select ?class (sample(?label) as ?label) (count(?super) as ?depth) where {
  ?class rdfs:label ?label.
  optional { ?class rdfs:subClassOf+ ?super. }
  filter (regex(str(?class),"^http://hadatac.org/ont/chear#.+"))
} group by ?class order by ?depth ?label
'''

chear_mappings = pd.DataFrame.from_records(data=list(chear.query(query,
                                                   initNs=dict(owl=OWL, rdfs=RDFS))), 
                                         columns=['class','label', 'depth'] )
chear_mappings


Out[19]:
class label depth
0 http://hadatac.org/ont/chear#PHEN2PHEN3 2-hydroxyphenanthrene + 3-hydroxyphenanthrene 0
1 http://hadatac.org/ont/chear#MCOCH Cyclohexane-1,2-dicarboxylic acid mono carboxy... 0
2 http://hadatac.org/ont/chear#MHNCH Cyclohexane-1,2-dicarboxylic acid mono hydroxy... 0
3 http://hadatac.org/ont/chear#homa_ir_unit HOMA-IR 0
4 http://hadatac.org/ont/chear#MEOHTP Mono-2-ethyl-5-oxohexylterephthalate 0
5 http://hadatac.org/ont/chear#PHET Phenanthrene tetrol 0
6 http://hadatac.org/ont/chear#billion_parts_per... billion parts per microgram 0
7 http://hadatac.org/ont/chear#international_uni... international units per litre 0
8 http://hadatac.org/ont/chear#micrograms_per_gram microgram per gram 0
9 http://hadatac.org/ont/chear#micrograms_per_de... micrograms per deciliter 0
10 http://hadatac.org/ont/chear#micrograms_per_me... micrograms per meter cubed 0
11 http://hadatac.org/ont/chear#microunits_per_mi... microunits per milliliter 0
12 http://hadatac.org/ont/chear#milligram_per_gram milligram per gram 0
13 http://hadatac.org/ont/chear#millimole_per_liter millimole per liter 0
14 http://hadatac.org/ont/chear#million_parts_per... million parts per microgram 0
15 http://hadatac.org/ont/chear#MECPTP mono-2-ethyl-5- carboxypentyl terephthalate (D... 0
16 http://hadatac.org/ont/chear#MEHHTP mono-2-ethyl-5-hydroxyhexyl terephthalate (DEHTP) 0
17 http://hadatac.org/ont/chear#MONP monooxoisononyl phthalate (DiNP) 0
18 http://hadatac.org/ont/chear#parasites_per_mic... parasites per microgram 0
19 http://hadatac.org/ont/chear#picomoles_per_mil... picomoles per milliliter 0
20 http://hadatac.org/ont/chear#thousand_parts_pe... thousand parts per microgram 0
21 http://hadatac.org/ont/chear#SamplePairing A Sample has a Pairing 1
22 http://hadatac.org/ont/chear#Comment_90 Abnormal hemoglobin variant observed 1
23 http://hadatac.org/ont/chear#Acculturation Acculturation 1
24 http://hadatac.org/ont/chear#ATIDU Alcohol, Tobacco, and Illicit Drug Use 1
25 http://hadatac.org/ont/chear#AnalysisMode Analysis Mode 1
26 http://hadatac.org/ont/chear#Analyte Analyte 1
27 http://hadatac.org/ont/chear#Comment_38 Analyzed at a later date than rest of samples ... 1
28 http://hadatac.org/ont/chear#Anthropometry Anthropometry 1
29 http://hadatac.org/ont/chear#AFSInstrument Atomic Fluorescence Spectroscopy Instrument 1
... ... ... ...
473 http://hadatac.org/ont/chear#SomeElementarySchool Some Elementary School 6
474 http://hadatac.org/ont/chear#SomeHighSchool Some High School 6
475 http://hadatac.org/ont/chear#SomeMiddleSchool Some Middle School 6
476 http://hadatac.org/ont/chear#Step Step 6
477 http://hadatac.org/ont/chear#TechnicalPostJuni... Technical Post Junior College 6
478 http://hadatac.org/ont/chear#UPLCMS Ultra Performance Liquid Chromatography - Mass... 6
479 http://hadatac.org/ont/chear#Conception Conception 7
480 http://hadatac.org/ont/chear#EducationGrade1 Education Grade 1 7
481 http://hadatac.org/ont/chear#EducationGrade2 Education Grade 2 7
482 http://hadatac.org/ont/chear#EducationGrade3 Education Grade 3 7
483 http://hadatac.org/ont/chear#EducationGrade5 Education Grade 5 7
484 http://hadatac.org/ont/chear#EducationGrade6 Education Grade 6 7
485 http://hadatac.org/ont/chear#EducationGrade7 Education Grade 7 7
486 http://hadatac.org/ont/chear#ElementarySchool Elementary School 7
487 http://hadatac.org/ont/chear#NormalWeight Normal Weight 7
488 http://hadatac.org/ont/chear#Pregnancy Pregnancy 7
489 http://hadatac.org/ont/chear#TechnicalPostPrim... Technical Post Primary School 7
490 http://hadatac.org/ont/chear#TechnicalPostMidd... Technical Post-Middle School 7
491 http://hadatac.org/ont/chear#Child Child 8
492 http://hadatac.org/ont/chear#EducationGrade4 Education Grade 4 8
493 http://hadatac.org/ont/chear#HeadOfHousehold Head Of Household 8
494 http://hadatac.org/ont/chear#Parent Parent 8
495 http://hadatac.org/ont/chear#UPLCMSMS Ultra-Performance Liquid Chromatography - Tand... 8
496 http://hadatac.org/ont/chear#HPLCMSMS High Performance Liquid Chromatography - Tande... 9
497 http://hadatac.org/ont/chear#QuitAfterPregnancy Quit Smoking After Pregnancy 9
498 http://hadatac.org/ont/chear#QuitBeforePregnancy Quit Smoking Before Pregnancy 9
499 http://hadatac.org/ont/chear#Daughter Daughter 10
500 http://hadatac.org/ont/chear#Father Father 10
501 http://hadatac.org/ont/chear#Mother Mother 10
502 http://hadatac.org/ont/chear#Son Son 10

503 rows × 3 columns


In [24]:
chear_mappings['numeric_uri'] = ['hhear:%05d' % (i+1) for  i in chear_mappings.index]
chear_mappings['label_uri'] = [x.replace('http://hadatac.org/ont/chear#','chear:')
                               for x in chear_mappings['class']]

In [25]:
chear_mappings


Out[25]:
class label depth numeric_uri label_uri
0 http://hadatac.org/ont/chear#PHEN2PHEN3 2-hydroxyphenanthrene + 3-hydroxyphenanthrene 0 hhear:00001 chear:PHEN2PHEN3
1 http://hadatac.org/ont/chear#MCOCH Cyclohexane-1,2-dicarboxylic acid mono carboxy... 0 hhear:00002 chear:MCOCH
2 http://hadatac.org/ont/chear#MHNCH Cyclohexane-1,2-dicarboxylic acid mono hydroxy... 0 hhear:00003 chear:MHNCH
3 http://hadatac.org/ont/chear#homa_ir_unit HOMA-IR 0 hhear:00004 chear:homa_ir_unit
4 http://hadatac.org/ont/chear#MEOHTP Mono-2-ethyl-5-oxohexylterephthalate 0 hhear:00005 chear:MEOHTP
5 http://hadatac.org/ont/chear#PHET Phenanthrene tetrol 0 hhear:00006 chear:PHET
6 http://hadatac.org/ont/chear#billion_parts_per... billion parts per microgram 0 hhear:00007 chear:billion_parts_per_microgram
7 http://hadatac.org/ont/chear#international_uni... international units per litre 0 hhear:00008 chear:international_units_per_litre
8 http://hadatac.org/ont/chear#micrograms_per_gram microgram per gram 0 hhear:00009 chear:micrograms_per_gram
9 http://hadatac.org/ont/chear#micrograms_per_de... micrograms per deciliter 0 hhear:00010 chear:micrograms_per_deciliter
10 http://hadatac.org/ont/chear#micrograms_per_me... micrograms per meter cubed 0 hhear:00011 chear:micrograms_per_meter_cubed
11 http://hadatac.org/ont/chear#microunits_per_mi... microunits per milliliter 0 hhear:00012 chear:microunits_per_milliliter
12 http://hadatac.org/ont/chear#milligram_per_gram milligram per gram 0 hhear:00013 chear:milligram_per_gram
13 http://hadatac.org/ont/chear#millimole_per_liter millimole per liter 0 hhear:00014 chear:millimole_per_liter
14 http://hadatac.org/ont/chear#million_parts_per... million parts per microgram 0 hhear:00015 chear:million_parts_per_microgram
15 http://hadatac.org/ont/chear#MECPTP mono-2-ethyl-5- carboxypentyl terephthalate (D... 0 hhear:00016 chear:MECPTP
16 http://hadatac.org/ont/chear#MEHHTP mono-2-ethyl-5-hydroxyhexyl terephthalate (DEHTP) 0 hhear:00017 chear:MEHHTP
17 http://hadatac.org/ont/chear#MONP monooxoisononyl phthalate (DiNP) 0 hhear:00018 chear:MONP
18 http://hadatac.org/ont/chear#parasites_per_mic... parasites per microgram 0 hhear:00019 chear:parasites_per_microgram
19 http://hadatac.org/ont/chear#picomoles_per_mil... picomoles per milliliter 0 hhear:00020 chear:picomoles_per_milliliter
20 http://hadatac.org/ont/chear#thousand_parts_pe... thousand parts per microgram 0 hhear:00021 chear:thousand_parts_per_microgram
21 http://hadatac.org/ont/chear#SamplePairing A Sample has a Pairing 1 hhear:00022 chear:SamplePairing
22 http://hadatac.org/ont/chear#Comment_90 Abnormal hemoglobin variant observed 1 hhear:00023 chear:Comment_90
23 http://hadatac.org/ont/chear#Acculturation Acculturation 1 hhear:00024 chear:Acculturation
24 http://hadatac.org/ont/chear#ATIDU Alcohol, Tobacco, and Illicit Drug Use 1 hhear:00025 chear:ATIDU
25 http://hadatac.org/ont/chear#AnalysisMode Analysis Mode 1 hhear:00026 chear:AnalysisMode
26 http://hadatac.org/ont/chear#Analyte Analyte 1 hhear:00027 chear:Analyte
27 http://hadatac.org/ont/chear#Comment_38 Analyzed at a later date than rest of samples ... 1 hhear:00028 chear:Comment_38
28 http://hadatac.org/ont/chear#Anthropometry Anthropometry 1 hhear:00029 chear:Anthropometry
29 http://hadatac.org/ont/chear#AFSInstrument Atomic Fluorescence Spectroscopy Instrument 1 hhear:00030 chear:AFSInstrument
... ... ... ... ... ...
473 http://hadatac.org/ont/chear#SomeElementarySchool Some Elementary School 6 hhear:00474 chear:SomeElementarySchool
474 http://hadatac.org/ont/chear#SomeHighSchool Some High School 6 hhear:00475 chear:SomeHighSchool
475 http://hadatac.org/ont/chear#SomeMiddleSchool Some Middle School 6 hhear:00476 chear:SomeMiddleSchool
476 http://hadatac.org/ont/chear#Step Step 6 hhear:00477 chear:Step
477 http://hadatac.org/ont/chear#TechnicalPostJuni... Technical Post Junior College 6 hhear:00478 chear:TechnicalPostJuniorCollege
478 http://hadatac.org/ont/chear#UPLCMS Ultra Performance Liquid Chromatography - Mass... 6 hhear:00479 chear:UPLCMS
479 http://hadatac.org/ont/chear#Conception Conception 7 hhear:00480 chear:Conception
480 http://hadatac.org/ont/chear#EducationGrade1 Education Grade 1 7 hhear:00481 chear:EducationGrade1
481 http://hadatac.org/ont/chear#EducationGrade2 Education Grade 2 7 hhear:00482 chear:EducationGrade2
482 http://hadatac.org/ont/chear#EducationGrade3 Education Grade 3 7 hhear:00483 chear:EducationGrade3
483 http://hadatac.org/ont/chear#EducationGrade5 Education Grade 5 7 hhear:00484 chear:EducationGrade5
484 http://hadatac.org/ont/chear#EducationGrade6 Education Grade 6 7 hhear:00485 chear:EducationGrade6
485 http://hadatac.org/ont/chear#EducationGrade7 Education Grade 7 7 hhear:00486 chear:EducationGrade7
486 http://hadatac.org/ont/chear#ElementarySchool Elementary School 7 hhear:00487 chear:ElementarySchool
487 http://hadatac.org/ont/chear#NormalWeight Normal Weight 7 hhear:00488 chear:NormalWeight
488 http://hadatac.org/ont/chear#Pregnancy Pregnancy 7 hhear:00489 chear:Pregnancy
489 http://hadatac.org/ont/chear#TechnicalPostPrim... Technical Post Primary School 7 hhear:00490 chear:TechnicalPostPrimarySchool
490 http://hadatac.org/ont/chear#TechnicalPostMidd... Technical Post-Middle School 7 hhear:00491 chear:TechnicalPostMiddleSchool
491 http://hadatac.org/ont/chear#Child Child 8 hhear:00492 chear:Child
492 http://hadatac.org/ont/chear#EducationGrade4 Education Grade 4 8 hhear:00493 chear:EducationGrade4
493 http://hadatac.org/ont/chear#HeadOfHousehold Head Of Household 8 hhear:00494 chear:HeadOfHousehold
494 http://hadatac.org/ont/chear#Parent Parent 8 hhear:00495 chear:Parent
495 http://hadatac.org/ont/chear#UPLCMSMS Ultra-Performance Liquid Chromatography - Tand... 8 hhear:00496 chear:UPLCMSMS
496 http://hadatac.org/ont/chear#HPLCMSMS High Performance Liquid Chromatography - Tande... 9 hhear:00497 chear:HPLCMSMS
497 http://hadatac.org/ont/chear#QuitAfterPregnancy Quit Smoking After Pregnancy 9 hhear:00498 chear:QuitAfterPregnancy
498 http://hadatac.org/ont/chear#QuitBeforePregnancy Quit Smoking Before Pregnancy 9 hhear:00499 chear:QuitBeforePregnancy
499 http://hadatac.org/ont/chear#Daughter Daughter 10 hhear:00500 chear:Daughter
500 http://hadatac.org/ont/chear#Father Father 10 hhear:00501 chear:Father
501 http://hadatac.org/ont/chear#Mother Mother 10 hhear:00502 chear:Mother
502 http://hadatac.org/ont/chear#Son Son 10 hhear:00503 chear:Son

503 rows × 5 columns


In [27]:
sio_mappings.to_csv('sio_mappings.csv')
chear_mappings.to_csv('chear2hhear_mappings.csv')

In [ ]: