KG2c domain_range_exclusion property contains booleans in strings?
I noticed today that in the kg2c_lite.json file, the domain_range_exclusion property on edges appears to be a python boolean in a string - e.g., "False" rather than false:
ubuntu@ip-172-31-52-1:~/plater-plover$ tail --bytes 1000 kg2c_lite_2.8.4.json
"domain_range_exclusion": "False",
"object": "NCBITaxon:9606",
"qualified_object_direction": "",
"id": 45854429,
"primary_knowledge_source": "infores:kegg",
"subject": "KEGG:05416",
"qualified_predicate": ""
},
{
"qualified_object_aspect": "",
"predicate": "biolink:subclass_of",
"domain_range_exclusion": "False",
"object": "NCBITaxon:9606",
"qualified_object_direction": "",
"id": 45854430,
"primary_knowledge_source": "infores:kegg",
"subject": "KEGG:05417",
"qualified_predicate": ""
},
{
"qualified_object_aspect": "",
"predicate": "biolink:subclass_of",
"domain_range_exclusion": "False",
"object": "NCBITaxon:9606",
"qualified_object_direction": "",
"id": 45854431,
"primary_knowledge_source": "infores:kegg",
"subject": "KEGG:05418",
"qualified_predicate": ""
}
],
"kg2_version": "2.8.4",
"biolink_version": "3.1.2"
}
Would it make sense to store that value as an actual boolean, rather than a string?
(I'm not actually sure what this property is for - think I missed that over the summer - so I could be wrong, but just thought it's a bit odd while I was working with the kg2c_lite.json file today..)
@sundareswarpullela do you know what JSON type that edge property is supposed to be?
Its supposed to be a string as far as KG2c edge property is concerned. I consulted Erica about it when she implemented domain_range_exclusion for KG2pre. The current logic uses string comparison to filter the results from Plover at query time.
There is no issue in changing the domain_range_exclusion key to a json boolean in kg2c_lite.json but this has to be done before triggering the KG2.8.6c build and there are some Expand changes necessary that filter domain_range_exclusion nodes. IMO this can be slated for Winter before the next KG2c version build.
Thank you Sundar. Yes, we can include the change in the KG2.8.7c build.
assigning @bazarkua as this would make a great first KG2c issue! (we discussed on a call this afternoon)
Updated create_kg2c_files.py and now domain_range_exclusion now property on edges is boolean rather than string.
tail --bytes 1000 kg2c_lite.json_TEST
xon:1040912",
"primary_knowledge_source": "infores:ncbi-taxonomy",
"qualified_predicate": "",
"id": 281874,
"domain_range_exclusion": false,
"qualified_object_aspect": ""
},
{
"object": "UMLS:C3356611",
"predicate": "biolink:close_match",
"qualified_object_direction": "",
"subject": "NCBITaxon:1040913",
"primary_knowledge_source": "infores:ncbi-taxonomy",
"qualified_predicate": "",
"id": 281875,
"domain_range_exclusion": false,
"qualified_object_aspect": ""
},
{
"object": "UMLS:C3356612",
"predicate": "biolink:close_match",
"qualified_object_direction": "",
"subject": "NCBITaxon:1040914",
"primary_knowledge_source": "infores:ncbi-taxonomy",
"qualified_predicate": "",
"id": 281876,
"domain_range_exclusion": false,
"qualified_object_aspect": ""
}
],
"kg2_version": "2.10.2",
"sub_version": "v1.0",
"biolink_version": "4.2.5"
}```