Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all xrefs to self #752

Open
matentzn opened this issue Apr 6, 2020 · 1 comment · May be fixed by #1665
Open

Remove all xrefs to self #752

matentzn opened this issue Apr 6, 2020 · 1 comment · May be fixed by #1665
Assignees

Comments

@matentzn
Copy link
Contributor

matentzn commented Apr 6, 2020

Currently there are a few hasdbxref annotations to self. We should get rid of them.

@matentzn
Copy link
Contributor Author

These are the 265 cases we have in EFO:

?term_curie	?xref_curie
"RO:0002159"	"RO:0002159"
"FBbt:00004784"	"FBbt:00004784"
"RO:0002285"	"RO:0002285"
"PO:0003023"	"PO:0003023"
"FMA:3906"	"FMA:3906"
"FBbt:00000127"	"FBbt:00000127"
"RO:0002180"	"RO:0002180"
"GO:0009314"	"GO:0009314"
"PO:0002000"	"PO:0002000"
"FBbt:00005523"	"FBbt:00005523"
"FBbt:00017019"	"FBbt:00017019"
"ZFA:0001269"	"ZFA:0001269"
"EFO:0005128"	"EFO:0005128"
"PO:0025022"	"PO:0025022"
"FBbt:00005067"	"FBbt:00005067"
"PATO:0000047"	"PATO:0000047"
"FBbt:00005528"	"FBbt:00005528"
"ZFA:0000141"	"ZFA:0000141"
"FBbt:00005422"	"FBbt:00005422"
"RO:0002131"	"RO:0002131"
"FBbt:00004914"	"FBbt:00004914"
"GO:0008150"	"GO:0008150"
"FBbt:00005424"	"FBbt:00005424"
"RO:0002082"	"RO:0002082"
"FBbt:00005550"	"FBbt:00005550"
"FMA:3884"	"FMA:3884"
"FBbt:00005834"	"FBbt:00005834"
"FBbt:00005551"	"FBbt:00005551"
"DOID:7551"	"DOID:7551"
"FBbt:00001724"	"FBbt:00001724"
"ZFA:0000963"	"ZFA:0000963"
"FBbt:00005552"	"FBbt:00005552"
"FBbt:00005554"	"FBbt:00005554"
"RO:0002087"	"RO:0002087"
"FMA:3832"	"FMA:3832"
"FBbt:00005606"	"FBbt:00005606"
"FBbt:00000461"	"FBbt:00000461"
"BFO:0000020"	"BFO:0000020"
"RO:0003000"	"RO:0003000"
"ZFA:0001244"	"ZFA:0001244"
"FBbt:00005556"	"FBbt:00005556"
"UBPROP:0000100"	"UBPROP:0000100"
"RO:0003001"	"RO:0003001"
"ZFA:0001370"	"ZFA:0001370"
"FMA:24984"	"FMA:24984"
"FBbt:00005608"	"FBbt:00005608"
"UBPROP:0000101"	"UBPROP:0000101"
"FBbt:00005501"	"FBbt:00005501"
"FBbt:00005609"	"FBbt:00005609"
"FBbt:00004891"	"FBbt:00004891"
"RO:0002160"	"RO:0002160"
"RO:0002161"	"RO:0002161"
"FBbt:00005504"	"FBbt:00005504"
"FBbt:00000109"	"FBbt:00000109"
"RO:0002162"	"RO:0002162"
"FBbt:00005630"	"FBbt:00005630"
"FBbt:00005505"	"FBbt:00005505"
"BSPO:0001113"	"BSPO:0001113"
"FBbt:00005506"	"FBbt:00005506"
"PATO:0000383"	"PATO:0000383"
"ZFA:0000226"	"ZFA:0000226"
"RO:0002215"	"RO:0002215"
"EFO:0003503"	"EFO:0003503"
"BSPO:0001114"	"BSPO:0001114"
"RO:0002573"	"RO:0002573"
"RO:0001015"	"RO:0001015"
"UBREL:0000001"	"UBREL:0000001"
"PATO:0000384"	"PATO:0000384"
"RO:0002216"	"RO:0002216"
"FBbt:00017020"	"FBbt:00017020"
"BSPO:0001115"	"BSPO:0001115"
"BSPO:0000096"	"BSPO:0000096"
"UBREL:0000002"	"UBREL:0000002"
"FBbt:00005508"	"FBbt:00005508"
"UBPROP:0000001"	"UBPROP:0000001"
"BSPO:0000097"	"BSPO:0000097"
"UBPROP:0000002"	"UBPROP:0000002"
"BSPO:0000098"	"BSPO:0000098"
"FBbt:00004202"	"FBbt:00004202"
"RO:0002219"	"RO:0002219"
"UBPROP:0000003"	"UBPROP:0000003"
"GO:0007610"	"GO:0007610"
"BSPO:0000099"	"BSPO:0000099"
"RO:0001019"	"RO:0001019"
"ZFA:0001273"	"ZFA:0001273"
"BFO:0000050"	"BFO:0000050"
"CHEBI:5931"	"CHEBI:5931"
"FBbt:00004204"	"FBbt:00004204"
"BFO:0000051"	"BFO:0000051"
"HP:0010865"	"HP:0010865"
"FBbt:00005072"	"FBbt:00005072"
"FBbt:00001069"	"FBbt:00001069"
"BFO:0000053"	"BFO:0000053"
"UBPROP:0000007"	"UBPROP:0000007"
"PO:0004518"	"PO:0004518"
"UBPROP:0000008"	"UBPROP:0000008"
"FBbt:00005534"	"FBbt:00005534"
"BFO:0000056"	"BFO:0000056"
"http://semanticscience.org/resource/SIO_000008"	"http://semanticscience.org/resource/SIO_000008"
"PO:0009033"	"PO:0009033"
"ZFA:0001047"	"ZFA:0001047"
"FBbt:00005535"	"FBbt:00005535"
"FBbt:00000441"	"FBbt:00000441"
"ZFA:0000023"	"ZFA:0000023"
"FBbt:00005536"	"FBbt:00005536"
"FBbt:00000442"	"FBbt:00000442"
"GO:0072718"	"GO:0072718"
"FBbt:00000210"	"FBbt:00000210"
"FBbt:00015256"	"FBbt:00015256"
"ZFA:0000841"	"ZFA:0000841"
"FBbt:00005662"	"FBbt:00005662"
"RO:0002371"	"RO:0002371"
"ZFA:0000257"	"ZFA:0000257"
"BSPO:0000120"	"BSPO:0000120"
"DOID:10718"	"DOID:10718"
"FBbt:00005663"	"FBbt:00005663"
"FBbt:00000444"	"FBbt:00000444"
"RO:0002372"	"RO:0002372"
"BSPO:0000121"	"BSPO:0000121"
"PO:0004542"	"PO:0004542"
"FBbt:00005431"	"FBbt:00005431"
"FBbt:00005664"	"FBbt:00005664"
"PO:0000256"	"PO:0000256"
"RO:0002373"	"RO:0002373"
"BSPO:0000122"	"BSPO:0000122"
"FBbt:00005665"	"FBbt:00005665"
"RO:0002374"	"RO:0002374"
"BSPO:0000123"	"BSPO:0000123"
"FBbt:00000447"	"FBbt:00000447"
"BSPO:0000124"	"BSPO:0000124"
"FBbt:00005610"	"FBbt:00005610"
"FBbt:00005667"	"FBbt:00005667"
"ZFA:0000563"	"ZFA:0000563"
"BSPO:0000125"	"BSPO:0000125"
"FBbt:00005611"	"FBbt:00005611"
"ZFA:0000972"	"ZFA:0000972"
"FBbt:00005668"	"FBbt:00005668"
"BSPO:0000126"	"BSPO:0000126"
"FBbt:00005612"	"FBbt:00005612"
"GO:0008152"	"GO:0008152"
"ZFA:0000281"	"ZFA:0000281"
"ZFA:0000973"	"ZFA:0000973"
"FBbt:00017000"	"FBbt:00017000"
"FBbt:00005669"	"FBbt:00005669"
"FMA:85972"	"FMA:85972"
"RO:0002322"	"RO:0002322"
"FBbt:00005614"	"FBbt:00005614"
"ZFA:0001484"	"ZFA:0001484"
"GO:0050896"	"GO:0050896"
"FBbt:00017003"	"FBbt:00017003"
"FBbt:00005565"	"FBbt:00005565"
"FBbt:00005616"	"FBbt:00005616"
"ZFA:0009150"	"ZFA:0009150"
"GO:0042747"	"GO:0042747"
"ZFA:0005040"	"ZFA:0005040"
"FBbt:00005566"	"FBbt:00005566"
"GO:0042748"	"GO:0042748"
"FBbt:00005510"	"FBbt:00005510"
"FBbt:00005618"	"FBbt:00005618"
"GO:0008283"	"GO:0008283"
"RO:0002503"	"RO:0002503"
"UBPROP:0000111"	"UBPROP:0000111"
"FBbt:00005511"	"FBbt:00005511"
"RO:0002220"	"RO:0002220"
"FBbt:00005744"	"FBbt:00005744"
"FBbt:00005568"	"FBbt:00005568"
"FBbt:00005619"	"FBbt:00005619"
"FBbt:00005512"	"FBbt:00005512"
"RO:0000052"	"RO:0000052"
"RO:0002221"	"RO:0002221"
"FBbt:00005745"	"FBbt:00005745"
"BSPO:1000000"	"BSPO:1000000"
"FBbt:00017008"	"FBbt:00017008"
"FBbt:00005746"	"FBbt:00005746"
"PO:0020019"	"PO:0020019"
"FMA:86003"	"FMA:86003"
"FBbt:00017009"	"FBbt:00017009"
"ZFA:0001384"	"ZFA:0001384"
"PO:0009013"	"PO:0009013"
"RO:0002224"	"RO:0002224"
"BSPO:0005001"	"BSPO:0005001"
"ZFA:0001385"	"ZFA:0001385"
"FBbt:00007049"	"FBbt:00007049"
"ZFA:0000003"	"ZFA:0000003"
"FBbt:00005748"	"FBbt:00005748"
"FBbt:00005516"	"FBbt:00005516"
"RO:0002225"	"RO:0002225"
"FBbt:00005749"	"FBbt:00005749"
"PO:0020147"	"PO:0020147"
"ZFA:0000821"	"ZFA:0000821"
"RO:0001025"	"RO:0001025"
"PO:0009015"	"PO:0009015"
"FBbt:00005466"	"FBbt:00005466"
"RO:0002226"	"RO:0002226"
"BSPO:0000100"	"BSPO:0000100"
"HP:0000708"	"HP:0000708"
"PO:0020148"	"PO:0020148"
"FBbt:00005643"	"FBbt:00005643"
"MA:0002714"	"MA:0002714"
"FBbt:00005518"	"FBbt:00005518"
"FBbt:00000197"	"FBbt:00000197"
"FBbt:00005519"	"FBbt:00005519"
"BSPO:0000102"	"BSPO:0000102"
"ZFA:0001389"	"ZFA:0001389"
"http://www.w3.org/2000/01/rdf-schema#seeAlso"	"http://www.w3.org/2000/01/rdf-schema#seeAlso"
"ZFA:0000541"	"ZFA:0000541"
"RO:0002229"	"RO:0002229"
"GO:0042493"	"GO:0042493"
"GO:0010960"	"GO:0010960"
"FBbt:00005822"	"FBbt:00005822"
"FBbt:00005646"	"FBbt:00005646"
"FBbt:00005824"	"FBbt:00005824"
"BFO:0000062"	"BFO:0000062"
"ZFA:0001104"	"ZFA:0001104"
"ZFA:0000085"	"ZFA:0000085"
"BSPO:0000107"	"BSPO:0000107"
"FBbt:00005542"	"FBbt:00005542"
"ZFA:0000778"	"ZFA:0000778"
"PO:0020048"	"PO:0020048"
"BSPO:0000108"	"BSPO:0000108"
"http://semanticscience.org/resource/SIO_000657"	"http://semanticscience.org/resource/SIO_000657"
"FBbt:00001433"	"FBbt:00001433"
"ZFA:0000672"	"ZFA:0000672"
"http://semanticscience.org/resource/SIO_000658"	"http://semanticscience.org/resource/SIO_000658"
"FBbt:00005544"	"FBbt:00005544"
"RO:0004029"	"RO:0004029"
"FBbt:00016000"	"FBbt:00016000"
"FBbt:00005670"	"FBbt:00005670"
"FBbt:00005545"	"FBbt:00005545"
"ZFA:0000265"	"ZFA:0000265"
"RO:0002254"	"RO:0002254"
"FBbt:00016001"	"FBbt:00016001"
"FBbt:00005546"	"FBbt:00005546"
"RO:0002255"	"RO:0002255"
"BFO:0000068"	"BFO:0000068"
"RO:0002256"	"RO:0002256"
"BFO:0000069"	"BFO:0000069"
"PO:0009046"	"PO:0009046"
"FBbt:00005673"	"FBbt:00005673"
"FBbt:00005548"	"FBbt:00005548"
"DOID:13406"	"DOID:13406"
"FBbt:00005498"	"FBbt:00005498"
"BSPO:0001100"	"BSPO:0001100"
"FBbt:00005442"	"FBbt:00005442"
"RO:0002202"	"RO:0002202"
"ZFA:0000678"	"ZFA:0000678"
"FBbt:00005675"	"FBbt:00005675"
"BSPO:0001101"	"BSPO:0001101"
"DOID:1947"	"DOID:1947"
"RO:0002203"	"RO:0002203"
"PATO:0001340"	"PATO:0001340"
"FBbt:00004011"	"FBbt:00004011"
"FBbt:00005571"	"FBbt:00005571"
"MA:0000191"	"MA:0000191"
"http://purl.org/dc/elements/1.1/creator"	"http://purl.org/dc/elements/1.1/creator"
"RO:0002207"	"RO:0002207"
"FBbt:00017011"	"FBbt:00017011"
"BSPO:0001106"	"BSPO:0001106"
"ZFA:0001369"	"ZFA:0001369"
"DOID:10113"	"DOID:10113"
"BSPO:0001107"	"BSPO:0001107"
"RO:0002158"	"RO:0002158"
"GO:0007600"	"GO:0007600"
"BSPO:0001108"	"BSPO:0001108"
"PO:0009073"	"PO:0009073"

This is the query that can be used to fix it:

prefix owl: <http://www.w3.org/2002/07/owl#>
prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

#SELECT ?term_curie ?xref_curie
DELETE {
  ?term oboInOwl:hasDbXref ?xref .
}
WHERE 
{ 
    ?term oboInOwl:hasDbXref ?xref .
  	FILTER (isIRI(?term))
	BIND(
		IF(	
			regex(str(?xref), "http[:][/][/]www[.]ebi[.]ac[.]uk[/]efo[/]EFO[_]")
				|| regex(str(?xref), "http[:][/][/]purl[.]obolibrary[.]org[/]obo[/]")
				|| regex(str(?xref), "http[:][/][/]www[.]orpha.net[/]ORDO[/]"),
			REPLACE(
				REPLACE(STR(?xref), "http[:][/][/]purl[.]obolibrary[.]org[/]obo[/]|http[:][/][/]www[.]ebi[.]ac[.]uk[/]efo[/]|http[:][/][/]www[.]orpha.net[/]ORDO[/]", "", "i"),
			"[_]", ":", "i")
      ,str(?xref)) as ?xref_curie)
    BIND(
		IF(	
			regex(str(?term), "http[:][/][/]www[.]ebi[.]ac[.]uk[/]efo[/]EFO[_]")
				|| regex(str(?term), "http[:][/][/]purl[.]obolibrary[.]org[/]obo[/]")
				|| regex(str(?term), "http[:][/][/]www[.]orpha.net[/]ORDO[/]"),
			REPLACE(
				REPLACE(STR(?term), "http[:][/][/]purl[.]obolibrary[.]org[/]obo[/]|http[:][/][/]www[.]ebi[.]ac[.]uk[/]efo[/]|http[:][/][/]www[.]orpha.net[/]ORDO[/]", "", "i"),
			"[_]", ":", "i")
      , str(?term))  as ?term_curie)
  FILTER(str(?term_curie)=str(?xref_curie))
}

Unfortunately, the diff is just so enormous when running this query, that I don't feel confident to do this right now. Moving to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants