master/ldif/examples/life-science/mappings/ALL-to-Wiki.r2r.ttl

User picture

Commiter: Andrea Matteini

Author: Andrea Matteini

Revision: 67000aced3


File Size: 25.3 KB

(September 29, 2011 10:32 UTC) 8 months ago

updated documentation

 

Showing without highlighting since it looks like a big file and may slow your browser - show with highlighting

Show/hide line numbers
@prefix r2r: <http://www4.wiwiss.fu-berlin.de/bizer/r2r/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix mp: <http://www.example.org/smw-lde/smwTransformations/> .
   

#####################################################################################################
# KEGG GENES mappings
#####################################################################################################

   
###
# Gene
###
mp:Gene
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
   							 genes: <http://wiking.vulcan.com/neurobase/kegg_genes/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a genes:gene";
   r2r:targetPattern	"?SUBJ a smwcat:Gene";
   .

# Properties of Gene
mp:GeneID
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:GeneId ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggGeneId ?'x'^^xsd:string";
   .
mp:GeneDefinition
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:definition ?x";
   r2r:targetPattern	"?SUBJ smwprop:Description ?'x'^^xsd:string";
   .
mp:GeneName
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:name ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .
mp:hasPathway
	a r2r:PropertyMapping;
	r2r:mappingRef    	mp:Gene;
	r2r:sourcePattern 	"?SUBJ genes:hasPathway ?x";
	r2r:targetPattern	"?SUBJ smwprop:IsInvolvedIn ?x . ?x smwprop:Involves ?SUBJ";
	.
mp:hasDisease
	a r2r:PropertyMapping;
	r2r:mappingRef    	mp:Gene;
	r2r:sourcePattern 	"?SUBJ genes:hasDisease ?x";
	r2r:targetPattern	"?SUBJ smwprop:Causes ?x . ?x smwprop:IsCausedBy ?SUBJ";
	.
# external Links
mp:GeneLinkUniProt
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('UniProt:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:UniprotId ?'id'^^xsd:string";
   .
mp:GeneLinkMGI
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('MGI:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:MgiMarkerAccessionId ?'id'^^xsd:string";
   .
mp:GeneLinkEnsembl
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('Ensembl:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:EnsemblId ?'id'^^xsd:string";
   .
mp:GeneLinkHGNC
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('HGNC:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:HGNCId ?'id'^^xsd:string";
   .
mp:GeneLinkHPRD
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('HPRD:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:HPRDId ?'id'^^xsd:string";
   .
mp:GeneLinkNCBIGI
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('NCBI-GI:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:NCBIGIId ?'id'^^xsd:string";
   .
mp:GeneLinkNCBIGeneID
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('NCBI-GeneID:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:NCBIGeneId ?'id'^^xsd:string";
   .
mp:GeneLinkOMIM
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('OMIM:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:OMIMId ?'id'^^xsd:string";
   . 
mp:GeneLinkIMGT
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:Gene;
   r2r:sourcePattern 	"?SUBJ genes:externalLink ?x";
   r2r:transformation "?id = regexToList('IMGT:(.+)', ?x)";
   r2r:targetPattern
   		"?SUBJ smwprop:IMGTId ?'id'^^xsd:string";
   .

###
# Disease
###
mp:Disease
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
   							 genes: <http://wiking.vulcan.com/neurobase/kegg_genes/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a genes:disease";
   r2r:targetPattern	"?SUBJ a smwcat:Disease";
   .

# Properties of Disease
mp:DiseaseID
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Disease;
   r2r:sourcePattern 	"?SUBJ genes:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggDiseaseId ?'x'^^xsd:string";
   .

mp:DiseaseLabel
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Disease;
   r2r:sourcePattern 	"?SUBJ rdfs:label ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .

###
# Pathway
###
mp:Pathway
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
   							 genes: <http://wiking.vulcan.com/neurobase/kegg_genes/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a genes:pathway";
   r2r:targetPattern	"?SUBJ a smwcat:Pathway";
   .
   
# Properties of Pathway
mp:PathwayID
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Pathway;
   r2r:sourcePattern 	"?SUBJ genes:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggPathwayId ?'x'^^xsd:string";
   .

mp:PathwayLabel
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:Pathway;
   r2r:sourcePattern 	"?SUBJ rdfs:label ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .

#####################################################################################################
# ABA mappings
#####################################################################################################

###
# Gene
###
mp:GeneABA
   a r2r:ClassMapping;
   r2r:prefixDefinitions        """smwcat: <http://mywiki/resource/category/> .
                                                         smwprop: <http://mywiki/resource/property/> .
                                                         aba: <http://brain-map.org/gene/0.1#> .
                                                         uniprot: <http://purl.uniprot.org/core/> .
                                                         skos: <http://www.w3.org/2004/02/skos/core#> .
                                                         rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
                                                         xsd: <http://www.w3.org/2001/XMLSchema#>""";
   r2r:sourcePattern    "?SUBJ a aba:gene";
   r2r:targetPattern    "?SUBJ a smwcat:Gene";
   .

# Properties of Gene
mp:GeneidABA
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:GeneABA;
   r2r:transformation "?newX = [2 < strlen(?x) ? ?x : list()]" ; # only values of len > 2 are mapped (because of empty strings)
   r2r:sourcePattern    "?SUBJ aba:geneid ?x";
   r2r:targetPattern    "?SUBJ smwprop:AbaGeneId ?'newX'^^xsd:string";  ###MER: actually we must translate from unsignedInt to string here
   .

mp:EntrezgeneidABA
   a r2r:PropertyMapping;
   r2r:mappingRef       mp:GeneABA;
   r2r:transformation "?newX = [strlen(?x) > 2 ? ?x : list()]" ; # only values of len > 2 are mapped (because of empty strings)
   r2r:sourcePattern    "?SUBJ aba:entrezgeneid ?x";
   r2r:targetPattern    "?SUBJ smwprop:EntrezGeneId ?'newX'^^xsd:int";  ###MER: actually we must translate from int to string here
   .

mp:GenenameABA
   a r2r:PropertyMapping;
   r2r:mappingRef       mp:GeneABA;
   r2r:sourcePattern    "?SUBJ aba:genename ?x";
   r2r:targetPattern    "?SUBJ smwprop:Label ?'x'^^xsd:string";
   .

mp:GenesymbolABA
   a r2r:PropertyMapping;
   r2r:mappingRef       mp:GeneABA;
   r2r:sourcePattern    "?SUBJ aba:genesymbol ?x";
   r2r:targetPattern    "?SUBJ smwprop:GeneSymbol ?'x'^^xsd:string";
   .

mp:MgimarkeraccessionidABA
   a r2r:PropertyMapping;
   r2r:mappingRef       mp:GeneABA;
   r2r:transformation "?newX = [strlen(?x) > 2 ? ?x : list()]" ; # only values of len > 2 are mapped (because of empty strings)
   r2r:sourcePattern    "?SUBJ aba:mgimarkeraccessionid ?x";
   r2r:targetPattern    "?SUBJ smwprop:MgiMarkerAccessionId ?'newX'^^xsd:string";
   .

###
# GeneAlias
###
mp:GenealiasABA
   a r2r:PropertyMapping;
   r2r:mappingRef       mp:GeneABA;
   r2r:sourcePattern    "?SUBJ aba:gene-aliases ?x . ?x aba:aliassymbol ?s";
   r2r:targetPattern    "?SUBJ smwprop:AlternativeLabel ?'s'^^xsd:string";
   .

#####################################################################################################
# UNIPROT mappings
#####################################################################################################
  

# Uniprot:Gene => aba:Gene
mp:GeneUNIPROT
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
							 smwprop: <http://mywiki/resource/property/> .
							 uniprot: <http://purl.uniprot.org/core/> .
							 skos: <http://www.w3.org/2004/02/skos/core#> .
							 rdfs: <http://www.w3.org/2000/01/rdf-schema#> .""";
   r2r:sourcePattern 	"?SUBJ a uniprot:Gene";
   r2r:targetPattern	"?SUBJ a smwcat:Gene";
   .
   
mp:GeneNameUNIPROT
   a r2r:PropertyMapping;
   r2r:mappingRef    mp:GeneUNIPROT;
   r2r:sourcePattern      "?SUBJ skos:prefLabel ?o";
   r2r:targetPattern	"?SUBJ smwprop:GeneSymbol ?'o'^^xsd:string";
   .   

# Uniprot:Protein (encodedBy uniprot:Gene) -> rdfs:seeAlso  | database = GeneID: http://purl.uniprot.org/geneid/XXXXX => Gene -> entrezgeneid = XXXXX
mp:EntrezGeneIdUNIPROT
   a r2r:PropertyMapping;
   r2r:mappingRef	mp:GeneUNIPROT;
   r2r:sourcePattern	"?protein uniprot:encodedBy ?SUBJ . ?protein rdfs:seeAlso ?dbentry . ?dbentry uniprot:database 'GeneID'";
   r2r:transformation "?id = regexToList('http://purl.uniprot.org/geneid/(.+)', ?dbentry)";
   r2r:targetPattern 	"?SUBJ smwprop:EntrezGeneId ?'id'^^xsd:int";
   .

# Uniprot:Protein (encodedBy uniprot:Gene) -> rdfs:seeAlso  | database = MGI : http://purl.uniprot.org/mgi/XXXXX => Gene: mgimarkeraccessionid = MGI:XXXXX
mp:MGIMarkerAccessionIdUNIPROT
   a r2r:PropertyMapping;
   r2r:mappingRef	mp:GeneUNIPROT;
   r2r:sourcePattern	"?protein uniprot:encodedBy ?SUBJ . ?protein rdfs:seeAlso ?dbentry . ?dbentry uniprot:database 'MGI'";
   r2r:transformation "?id = regexToList('http://purl.uniprot.org/mgi/(.+)', ?dbentry)";
   r2r:targetPattern 	"?SUBJ smwprop:MgiMarkerAccessionId ?'id'^^xsd:string";
   .

mp:UniprotIdUNIPROT
   a r2r:PropertyMapping;
   r2r:mappingRef	mp:GeneUNIPROT;
   r2r:sourcePattern	"?protein uniprot:encodedBy ?SUBJ" ;
   r2r:transformation "?id = regexToList('http://purl.uniprot.org/uniprot/(.+)', ?protein)";
   r2r:targetPattern 	"?SUBJ smwprop:UniprotId ?'id'^^xsd:string";
   .
 
# Uniprot:Protein (encodedBy uniprot:Gene) -> rdfs:seeAlso  | database = KEGG: http://purl.uniprot.org/kegg/XXXXX => Gene -> smwprop:KeggGeneId = XXXXX
mp:KeggGeneIdUNIPROT
   a r2r:PropertyMapping;
   r2r:mappingRef	mp:GeneUNIPROT;
   r2r:sourcePattern	"?protein uniprot:encodedBy ?SUBJ . ?protein rdfs:seeAlso ?dbentry . ?dbentry uniprot:database 'KEGG'";
   r2r:transformation "?id = regexToList('http://purl.uniprot.org/kegg/(.+)', ?dbentry)";
   r2r:targetPattern 	"?SUBJ smwprop:KeggGeneId ?'id'^^xsd:string";
   .


#####################################################################################################
# PHARMGKB mappings
#####################################################################################################


###
# Pathway
###
mp:PathwayPHARMGKB
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pharmgkb: <http://chem2bio2rdf.org/pharmgkb/resource/> .
							 xsd:     <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pharmgkb:PharmGKB_Pathways";
   r2r:targetPattern	"?SUBJ a smwcat:Pathway";
   .
   
# Properties of Pathway
mp:PathwayIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:PharmGKB_Accession_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:PharmGKBId ?'x'^^xsd:string";
   .

mp:PathwayLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Name ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .
   
mp:PathwayHasDiseasePHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Pathways ?SUBJ .
   						?rel pharmgkb:c2b2r_Related_Diseases ?x""";
   r2r:targetPattern	"?SUBJ smwprop:IsDisruptedBy ?x";
   .
   
mp:PathwayHasDrugPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Pathways ?SUBJ .
   						?rel pharmgkb:Related_Drugs ?x""";
   r2r:targetPattern	"?SUBJ smwprop:IsTargetedBy ?x";
   .

mp:PathwayHasGenePHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Pathways ?SUBJ .
   						?rel pharmgkb:Related_Genes ?x""";
   r2r:targetPattern	"?SUBJ smwprop:Involves ?x";
   .

###
# Disease
###
mp:DiseasePHARMGKB
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pharmgkb: <http://chem2bio2rdf.org/pharmgkb/resource/> .
							 xsd:     <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pharmgkb:PharmGKB_Diseases";
   r2r:targetPattern	"?SUBJ a smwcat:Disease";
   .

# Properties of Disease
mp:DiseaseIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:PharmGKB_Accession_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:PharmGKBId ?'x'^^xsd:string";
   .
   
mp:DiseaseMeSHIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:MeSH_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:MeSHId ?'x'^^xsd:string";
   .

mp:DiseaseLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Name ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .
   
# FIXME doesn't work
mp:DiseaseAlternativeLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Alternate_Names ?x";
   r2r:transformation 	"""?labels = itRegexToList('"(.+?)"', ?x)""";
   r2r:targetPattern	"?SUBJ smwprop:AlternativeLabel ?'labels'^^xsd:string";
   .
   
mp:DiseaseHasPathwayPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:c2b2r_Related_Diseases ?SUBJ .
   						?rel pharmgkb:Related_Pathways ?x""";
   r2r:targetPattern	"?SUBJ smwprop:Disrupts ?x";
   .
   
mp:DiseaseHasDrugPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:c2b2r_Related_Diseases ?SUBJ .
   						?rel pharmgkb:Related_Drugs ?x""";
   r2r:targetPattern	"?SUBJ smwprop:IsTreatedBy ?x";
   .

mp:DiseaseHasGenePHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseasePHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:c2b2r_Related_Diseases ?SUBJ .
   						?rel pharmgkb:Related_Genes ?x""";
   r2r:targetPattern	"?SUBJ smwprop:IsCausedBy ?x";
   .

###
# Drug
###
mp:DrugPHARMGKB
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pharmgkb: <http://chem2bio2rdf.org/pharmgkb/resource/> .
							 xsd:     <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pharmgkb:pharmGKB_Drugs";
   r2r:targetPattern	"?SUBJ a smwcat:Drug";
   .

# Properties of Drug
mp:DrugIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:PharmGKB_Accession_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:PharmGKBId ?'x'^^xsd:string";
   .

# Properties of Drug
mp:DrugDrugbankIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:DrugBank_Id ?x";
   r2r:transformation "?id = regexToList('http://chem2bio2rdf.org/drugbank/resource/drugbank_drug/(.+?)', ?x)";
   r2r:targetPattern	"?SUBJ smwprop:DrugBankId ?'id'^^xsd:string";
   .

mp:DrugLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Name ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .

# FIXME doesn't work
mp:DrugAlternativeLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Alternate_Names ?x";
   r2r:transformation 	"""?labels = itRegexToList('"(.+?)"', ?x)""";
   r2r:targetPattern	"?SUBJ smwprop:AlternativeLabel ?'labels'^^xsd:string";
   .

mp:DrugHasPathwayPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Drugs ?SUBJ .
   						?rel pharmgkb:Related_Pathways ?x""";
   r2r:targetPattern	"?SUBJ smwprop:Targets ?x";
   .
   
mp:DrugHasDiseasePHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Drugs ?SUBJ .
   						?rel pharmgkb:c2b2r_Related_Diseases ?x""";
   r2r:targetPattern	"?SUBJ smwprop:Treats ?x";
   .

mp:DrugHasGenePHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugPHARMGKB;
   r2r:sourcePattern 	"""?rel rdf:type pharmgkb:PharmGKB_Relationships .
   						?rel pharmgkb:Related_Drugs ?SUBJ .
   						?rel pharmgkb:Related_Genes ?x""";
   r2r:targetPattern	"?SUBJ smwprop:Targets ?x";
   .

# skipped: SMILES, Type

###
# Gene
###
mp:GenePHARMGKB
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pharmgkb: <http://chem2bio2rdf.org/pharmgkb/resource/> .
							 xsd:     <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pharmgkb:PharmGKB_Genes";
   r2r:targetPattern	"?SUBJ a smwcat:Gene";
   .

# Properties of Gene
mp:GeneIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:PharmGKB_Accession_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:PharmGKBId ?'x'^^xsd:string";
   .

mp:GeneLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Name ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .

mp:GeneEntrezGeneIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Entrez_Id ?x";
   r2r:transformation "?id = regexToList('http://bio2rdf.org/geneid:(.+?)', ?x)";
   r2r:targetPattern	"?SUBJ smwprop:EntrezGeneId ?'id'^^xsd:int";
   .

mp:GeneSymbolPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Symbol ?x";
   r2r:transformation "?id = regexToList('http://chem2bio2rdf.org/uniprot/resource/gene/(.+?)', ?x)";
   r2r:targetPattern	"?SUBJ smwprop:GeneSymbol ?'id'^^xsd:string";
   .

# TBD
mp:GeneAlternativeSymbolsPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Alternate_Symbols ?x";
   r2r:transformation 	"""?labels = itRegexToList('"(.+?)"', ?x)""";
   r2r:targetPattern	"?SUBJ smwprop:AlternativeLabel ?'labels'^^xsd:string";
   .

# FIXME doesn't work
mp:GeneAlternativeLabelPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Alternate_Names ?x";
   r2r:transformation 	"""?labels = itRegexToList('"(.+?)"', ?x)""";
   r2r:targetPattern	"?SUBJ smwprop:AlternativeLabel ?'labels'^^xsd:string";
   .

mp:GeneUniProtIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:UniProt_Id ?x";
   r2r:transformation "?id = regexToList('http://chem2bio2rdf.org/uniprot/resource/uniprot/(.+?)', ?x)";
   r2r:targetPattern	"?SUBJ smwprop:UniprotId  ?'id'^^xsd:string";
   .

mp:GeneEnsemblIDPHARMGKB
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GenePHARMGKB;
   r2r:sourcePattern 	"?SUBJ pharmgkb:Ensembl_Id ?x";
   r2r:targetPattern	"?SUBJ smwprop:EnsemblId  ?'x'^^xsd:string";
   .





#####################################################################################################
# KEGGPATH mappings
#####################################################################################################

###
# Pathway
###
mp:PathwayKEGGPATH
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pathway:pathway";
   r2r:targetPattern	"?SUBJ a smwcat:Pathway";
   .
   
# Properties of Pathway
mp:PathwayIDKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggPathwayId ?x";
   .

mp:PathwayLabelKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ rdfs:label ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?x";
   .
   
mp:PathwayDescriptionKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:description ?x";
   r2r:targetPattern	"?SUBJ smwprop:Description ?'x'^^xsd:string";
   .

mp:PathwayHasDiseaseKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:hasDisease ?x";
   r2r:targetPattern	"?SUBJ smwprop:IsDisruptedBy ?x . ?x smwprop:Disrupts ?SUBJ";
   .
   
mp:PathwayHasDrugKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:hasDrug ?x";
   r2r:targetPattern	"?x smwprop:IsTargetedBy ?SUBJ . ?x smwprop:Targets ?SUBJ";
   .

mp:PathwayHasGeneKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:PathwayKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:hasGene ?x";
   r2r:targetPattern	"?SUBJ smwprop:Involves ?x . ?x smwprop:IsInvolvedIn ?SUBJ";
   .

###
# Disease
###
mp:DiseaseKEGGPATH
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pathway:disease";
   r2r:targetPattern	"?SUBJ a smwcat:Disease";
   .

# Properties of Disease
mp:DiseaseIDKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DiseaseKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggDiseaseId ?'x'^^xsd:string";
   .

mp:DiseaseLabelKEGGPATH
   a r2r:PropertyMappingKEGGPATH;
   r2r:mappingRef    	mp:Disease;
   r2r:sourcePattern 	"?SUBJ rdfs:label ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .
   

###
# Drug
###
mp:DrugKEGGPATH
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pathway:drug";
   r2r:targetPattern	"?SUBJ a smwcat:Drug";
   .

# Properties of Drug
mp:DrugIDKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggDrugId ?'x'^^xsd:string";
   .

mp:DrugLabelKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:DrugKEGGPATH;
   r2r:sourcePattern 	"?SUBJ rdfs:label ?x";
   r2r:targetPattern	"?SUBJ smwprop:Label ?'x'^^xsd:string";
   .
   
###
# Gene
###
mp:GeneKEGGPATH
   a r2r:ClassMapping;
   r2r:prefixDefinitions	"""smwcat: <http://mywiki/resource/category/> .
   							 smwprop: <http://mywiki/resource/property/> .
   							 pathway: <http://wiking.vulcan.com/neurobase/kegg_pathway/resource/vocab/> .
							 xsd: <http://www.w3.org/2001/XMLSchema#> .""";
   r2r:sourcePattern 	"?SUBJ a pathway:gene";
   r2r:targetPattern	"?SUBJ a smwcat:Gene";
   .
# Properties of Gene
mp:GeneIDKEGGPATH
   a r2r:PropertyMapping;
   r2r:mappingRef    	mp:GeneKEGGPATH;
   r2r:sourcePattern 	"?SUBJ pathway:id ?x";
   r2r:targetPattern	"?SUBJ smwprop:KeggGeneId ?'x'^^xsd:string";
   .