Daniel-Mietchen / ideas

A dumping ground for halfbaked ideas, some of which will hopefully be worked on soon
Other
26 stars 6 forks source link

Index the swallowing literature in Wikidata #1110

Open Daniel-Mietchen opened 5 years ago

Daniel-Mietchen commented 5 years ago

To consider:

Daniel-Mietchen commented 5 years ago

A query for "swallowing":

SELECT DISTINCT ?item #?title
WHERE {
  hint:Query hint:optimizer "None".

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "\"swallowing\" haswbstatement:P31=Q13442814".
    ?page_title wikibase:apiOutput mwapi:title.
  }

  BIND(IRI(CONCAT(STR(wd:), ?page_title)) AS ?item)
  FILTER NOT EXISTS { ?item wdt:P921 wd:Q211669. }

 ?item wdt:P1476 ?title.
  FILTER CONTAINS(LCASE(?title), "swallowing"). 
}
# LIMIT 10000
Daniel-Mietchen commented 5 years ago

A batch job is now running based on the above query: https://tools.wmflabs.org/quickstatements/#/batch/6751 .

Daniel-Mietchen commented 5 years ago

A query for dysphagia:

SELECT DISTINCT ?item #?title
WHERE {
  hint:Query hint:optimizer "None".

{  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "\"dysphagia\" haswbstatement:P31=Q13442814".
    ?page_title wikibase:apiOutput mwapi:title.
  }
  }
UNION
{  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "\"dysphagic\" haswbstatement:P31=Q13442814".
    ?page_title wikibase:apiOutput mwapi:title.
  }
  }
UNION
{  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "\"dysphagics\" haswbstatement:P31=Q13442814".
    ?page_title wikibase:apiOutput mwapi:title.
  }
  }

  BIND(IRI(CONCAT(STR(wd:), ?page_title)) AS ?item)
  FILTER NOT EXISTS { ?item wdt:P921 wd:Q623289. }

 ?item wdt:P1476 ?title.
  FILTER CONTAINS(LCASE(?title), "dysphag"). 
}
# LIMIT 10000
Daniel-Mietchen commented 5 years ago

A batch job for dysphagia is now up as well: https://tools.wmflabs.org/quickstatements/#/batch/6752 .

Daniel-Mietchen commented 5 years ago

A query for "swallowed":

SELECT DISTINCT ?item #?title
WHERE {
  hint:Query hint:optimizer "None".

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "\"swallowed\" haswbstatement:P31=Q13442814".
    ?page_title wikibase:apiOutput mwapi:title.
  }

  BIND(IRI(CONCAT(STR(wd:), ?page_title)) AS ?item)
  FILTER NOT EXISTS { ?item wdt:P921 wd:Q211669. }

 ?item wdt:P1476 ?title.
  FILTER CONTAINS(LCASE(?title), "swallowed"). 

}
# LIMIT 10000
Daniel-Mietchen commented 5 years ago

The job for "swallowed" sits at https://tools.wmflabs.org/quickstatements/#/batch/6753 .

Daniel-Mietchen commented 5 years ago

These batches have finished.

Scholia profiles: