Skip to content

Instantly share code, notes, and snippets.

@egonw
Created January 19, 2021 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonw/338d963c1904048dcfcd65c951670d5f to your computer and use it in GitHub Desktop.
Save egonw/338d963c1904048dcfcd65c951670d5f to your computer and use it in GitHub Desktop.
SELECT ?wpid ?pathway ?pathwayLabel ?cpx ?complex ?complexLabel ?part ?partLabel WITH {
SELECT DISTINCT ?complex ?cpx ?part WHERE {
?complex wdt:P7718 ?cpx ;
wdt:P527+ ?part .
{ ?part wdt:P31 wd:Q78782478 . }
UNION
{ ?part wdt:P31 wd:Q8054 . }
}
} AS %PARTS WHERE {
INCLUDE %PARTS
?pathway wdt:P2410 ?wpid ; wdt:P527 ?part .
MINUS { ?pathway wdt:P527 ?complex }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ASC(?wpid) ASC(?cpx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment