<jupyter_start><jupyter_text>Added to Wikidata via Quickstatements in [Batch 45262"human cell types"on Wikidataby TiagoLubiana](https://quickstatements.toolforge.org//batch/45262) There was a typo so I'll have to fix it.<jupyter_code>from wikidata2df import wikidata2df

# A SPARQL query to return all cats in Wikidata!

query = """
SELECT ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q18911.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
"""

dataframe_to_fix = wikidata2df(query) # Returns a Pandas DataFrame
dataframe_to_fix
with open("../quickstatements/typo_correction_08_11_2020.qs", "w+") as qs:


    for i, row in dataframe_to_fix.iterrows():
        s = row["item"]
        P31_old = s + "|P31|" + "Q18911" + "|S248|" + "Q99936939" +   "\n"
        P31_new = s + "|P31|" + "Q189118" + "|S248|" + "Q99936939" +   "\n" 

        qs.write("-" + P31_old)
        qs.write(P31_new)

df["P279"] = df["P361"]
df = df.drop("P361", axis=1)
df.to_csv("../data/human_cell_types_to_add_08_11_2020.csv", index=False )
from wikidata2df import wikidata2df

# A SPARQL query to return all cats in Wikidata!

query = """
SELECT ?item ?itemLabel ?superclass
WHERE
{
?item wdt:P31 wd:Q189118.
?item wdt:P361 ?superclass. 
?superclass  wdt:P31 wd:Q189118.
?item wdt:P703 wd:Q15978631.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
"""

dataframe_to_fix = wikidata2df(query) # Returns a Pandas DataFrame

with open("../quickstatements/P279_correction_08_11_2020.qs", "w+") as qs:


    for i, row in dataframe_to_fix.iterrows():
        s = row["item"]
        o = row["superclass"]
        P361 = s + "|P361|" + o +   "\n"
        P279 = s + "|P279|"  + o +   "\n"
        qs.write("-" + P361)
        qs.write(P279)
dataframe_to_fix<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14715536105032823, 'fraction_numerical': 0.0836980306345733, 'mean_word_length': 3.903485254691689, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '558117', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 852, 'n_tokens_neox': 742, 'n_words': 160, 'path': 'improvements/src/add_human_cell_types_to_wikidata_08_11_2020.ipynb', 'repo_name': 'jvfe/wikidata_panglaodb', 'size': '1828'}