├── prototypes
├── shiny_app
│ ├── abstract_display
│ │ ├── .Rprofile
│ │ ├── renv
│ │ │ ├── .gitignore
│ │ │ ├── settings.dcf
│ │ │ └── activate.R
│ │ ├── abstract_display.Rproj
│ │ ├── app.R
│ │ └── renv.lock
│ └── README.md
├── README.md
└── notebooks
│ ├── README.md
│ ├── scispacy_linking_via_umls.ipynb
│ └── scispacy_linking_via_mesh.ipynb
├── hypothesis_parsing
├── test.pdf
├── plot_counts.R
├── render_SPARQL_visualization.R
├── parsing_annotations.ipynb
└── .ipynb_checkpoints
│ └── parsing_annotations-checkpoint.ipynb
├── docs
└── brainstorm
│ ├── temp_logo.png
│ ├── prototype_v0.png
│ └── background_for_video.png
├── CONTRIBUTING.md
├── README.md
├── CODE_OF_CONDUCT.md
├── .gitignore
└── LICENSE
/prototypes/shiny_app/abstract_display/.Rprofile:
--------------------------------------------------------------------------------
1 | source("renv/activate.R")
2 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/renv/.gitignore:
--------------------------------------------------------------------------------
1 | library/
2 | python/
3 | staging/
4 |
--------------------------------------------------------------------------------
/hypothesis_parsing/test.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lubianat/ann/HEAD/hypothesis_parsing/test.pdf
--------------------------------------------------------------------------------
/docs/brainstorm/temp_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lubianat/ann/HEAD/docs/brainstorm/temp_logo.png
--------------------------------------------------------------------------------
/docs/brainstorm/prototype_v0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lubianat/ann/HEAD/docs/brainstorm/prototype_v0.png
--------------------------------------------------------------------------------
/docs/brainstorm/background_for_video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lubianat/ann/HEAD/docs/brainstorm/background_for_video.png
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/renv/settings.dcf:
--------------------------------------------------------------------------------
1 | external.libraries:
2 | ignored.packages:
3 | package.dependency.fields: Imports, Depends, LinkingTo
4 | snapshot.type: implicit
5 | use.cache: TRUE
6 | vcs.ignore.library: TRUE
7 |
--------------------------------------------------------------------------------
/prototypes/README.md:
--------------------------------------------------------------------------------
1 | # Prototypes
2 |
3 | * Prototypes developed during the sprint
4 |
5 | * notebooks: Google colab notebooks that try to link the entities recognized by SciSpacy models to Wikidata items.
6 | * shiny_app: R app to showcase displaying abstracts from EuropePMC.
7 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/abstract_display.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/README.md:
--------------------------------------------------------------------------------
1 | # Shiny Apps
2 |
3 | Shiny Apps are web apps which can be written in R, with support of the RStudio IDE.
4 |
5 | They are nice for prototyping, as they can be integrated with a great number of
6 |
7 | ## Display Abstracts
8 |
9 | A very simple interface that gets abstracts from Europe PMC using the PMID and displays to user.
--------------------------------------------------------------------------------
/prototypes/notebooks/README.md:
--------------------------------------------------------------------------------
1 | # SciSpacy + Wikidata Entity Linking
2 |
3 | Made to be ran inside of colab, because it takes a lot of RAM (>7GB).
4 |
5 | * Using UMLS (original prototype):
6 |
7 | * Using MeSH:
8 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/app.R:
--------------------------------------------------------------------------------
1 | # Simple application that displays abstracts from EuropePMC
2 |
3 | library(shiny)
4 | library(europepmc)
5 |
6 | get_abstract <- function(pmid) {
7 |
8 | api_result <- epmc_details(pmid)
9 | api_result[["basic"]][["abstractText"]]
10 |
11 | }
12 |
13 | ui <- fluidPage(
14 | textInput(inputId = "pmid", value = "32180547", "PMID"),
15 | h2("Abstract:"),
16 | textOutput("abstract"),
17 | )
18 |
19 | server <- function(input, output) {
20 | abstract_text <- eventReactive(input$pmid, {
21 | get_abstract(input$pmid)
22 | })
23 |
24 | output$abstract <- renderText(abstract_text())
25 | }
26 |
27 | shinyApp(ui = ui, server = server)
28 |
--------------------------------------------------------------------------------
/hypothesis_parsing/plot_counts.R:
--------------------------------------------------------------------------------
1 | library(readr)
2 | library(dplyr)
3 | library(urltools)
4 |
5 | annotations <- read.csv("hypothesis_annotations.csv")
6 |
7 |
8 | abstract_annotations <-
9 | annotations %>% dplyr::filter(url != "https://europepmc.org/article/MED/29206104")
10 |
11 |
12 | library(ggplot2)
13 |
14 |
15 |
16 |
17 | abstract_annotations %>%
18 | group_by(url) %>%
19 | count() %>%
20 | ggplot(aes(y = n, x = "abstracts")) +
21 | geom_boxplot()
22 |
23 |
24 | p <- abstract_annotations %>%
25 | group_by(typeLabel) %>%
26 | count() %>%
27 | filter(typeLabel != "") %>%
28 | filter(n > 10) %>%
29 | ggplot(aes(y = n, x = reorder(typeLabel, -n))) +
30 | geom_point() + theme(axis.text.x = element_text(angle = 60, hjust=1))
31 |
32 |
33 | ggsave("test.pdf")
34 | plot(p)
35 | dev.off()
36 |
37 |
38 |
39 |
40 | dev.off()
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # So you want to contribute? That is great!
2 |
3 | This is an open project, and we love contributions!
4 |
5 | A good start is contributing with ideas or questions via the [issues page](https://github.com/lubianat/annotate_them_all/issues).
6 |
7 | * Are you in the eLife Sprint 2020? Let me know at [issue #1](https://github.com/lubianat/annotate_them_all/issues/1) and I add you as a colaborator right away.
8 | * **Be bold** and contribute however you can.
9 | * Adding an issue? Please mark it with labels.
10 | * Making a commit? Take a quick look at [this post](https://chris.beams.io/posts/git-commit/) on how to write a good commit message :)
11 |
12 | For code in Python, let's try and follow [PEP8](https://pybit.es/pep8.html) standards.
13 | For code in R, let's try and follow the [tidyverse style guide](https://style.tidyverse.org/).
14 |
15 | At this stage, everything is a prototype, so feel free to make pull requests and commit directly to the master branch.
16 |
--------------------------------------------------------------------------------
/hypothesis_parsing/render_SPARQL_visualization.R:
--------------------------------------------------------------------------------
1 | library(readr)
2 | library(dplyr)
3 | library(urltools)
4 | annotations <- read.csv("hypothesis_annotations.csv")
5 |
6 | thymus_annotations <- annotations %>% filter(url == "https://europepmc.org/article/MED/32079746")
7 |
8 | qids = unique(c(thymus_annotations[,"type"], thymus_annotations[,"item"]))
9 |
10 | items <- "{ "
11 | for (i in qids)
12 | {
13 | items <- paste0(items, " wd:", i)
14 | }
15 | items <- paste0(items, " }")
16 | descriptions_query <- paste0(' #defaultView:Graph
17 | SELECT DISTINCT ?item_1 ?item_1Label ?item_2 ?item_2Label
18 | WHERE
19 | {
20 | VALUES ?item_1', items,' .
21 | VALUES ?item_2', items,' .
22 |
23 | {?item_1 ?p ?item_2 .}
24 |
25 |
26 | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
27 | }')
28 |
29 | url = paste0("https://query.wikidata.org/#",url_encode(descriptions_query))
30 | print(url)
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Annotate Them All eLife Sprint 2020
2 | A repository for brainstorming and prototyping ideas related to the eLifeSprint project [Annotate Them All](https://sprint.elifesciences.org/annotate-them-all/)
3 |
4 | Want to know more about it? Check our [preprint/report](https://zenodo.org/record/4279611#.X7VqBXVKgQY) !
5 |
6 | # So you want to contribute? That is great!
7 |
8 | This is an open project, and we love contributions!
9 |
10 | A good start is contributing with ideas or questions via the [issues page](https://github.com/lubianat/annotate_them_all/issues).
11 |
12 | * **Be bold** and contribute however you can.
13 | * Adding an issue? Please mark it with labels.
14 | * Making a commit? Take a quick look at [this post](https://chris.beams.io/posts/git-commit/) on how to write a good commit message :)
15 |
16 | For code in Python, let's try and follow [PEP8](https://pybit.es/pep8.html) standards.
17 | For code in R, let's try and follow the [tidyverse style guide](https://style.tidyverse.org/).
18 |
19 | At this stage, everything is a prototype, so feel free to make pull requests and commit directly to the master branch.
20 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at tiago.lubiana.alves@usp.br. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### Linux ###
2 | *~
3 |
4 | # temporary files which can be created if a process still has a handle open of a deleted file
5 | .fuse_hidden*
6 |
7 | # KDE directory preferences
8 | .directory
9 |
10 | # Linux trash folder which might appear on any partition or disk
11 | .Trash-*
12 |
13 | # .nfs files are created when an open file is removed but is still being accessed
14 | .nfs*
15 |
16 | ### Python ###
17 | # Byte-compiled / optimized / DLL files
18 | __pycache__/
19 | *.py[cod]
20 | *$py.class
21 |
22 | # C extensions
23 | *.so
24 |
25 | # Distribution / packaging
26 | .Python
27 | build/
28 | develop-eggs/
29 | dist/
30 | downloads/
31 | eggs/
32 | .eggs/
33 | lib/
34 | lib64/
35 | parts/
36 | sdist/
37 | var/
38 | wheels/
39 | pip-wheel-metadata/
40 | share/python-wheels/
41 | *.egg-info/
42 | .installed.cfg
43 | *.egg
44 | MANIFEST
45 |
46 | # PyInstaller
47 | # Usually these files are written by a python script from a template
48 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
49 | *.manifest
50 | *.spec
51 |
52 | # Installer logs
53 | pip-log.txt
54 | pip-delete-this-directory.txt
55 |
56 | # Unit test / coverage reports
57 | htmlcov/
58 | .tox/
59 | .nox/
60 | .coverage
61 | .coverage.*
62 | .cache
63 | nosetests.xml
64 | coverage.xml
65 | *.cover
66 | *.py,cover
67 | .hypothesis/
68 | .pytest_cache/
69 | pytestdebug.log
70 |
71 | # Translations
72 | *.mo
73 | *.pot
74 |
75 | # Django stuff:
76 | *.log
77 | local_settings.py
78 | db.sqlite3
79 | db.sqlite3-journal
80 |
81 | # Flask stuff:
82 | instance/
83 | .webassets-cache
84 |
85 | # Scrapy stuff:
86 | .scrapy
87 |
88 | # Sphinx documentation
89 | docs/_build/
90 | doc/_build/
91 |
92 | # PyBuilder
93 | target/
94 |
95 | # Jupyter Notebook
96 | .ipynb_checkpoints
97 |
98 | # IPython
99 | profile_default/
100 | ipython_config.py
101 |
102 | # pyenv
103 | .python-version
104 |
105 | # pipenv
106 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
107 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
108 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
109 | # install all needed dependencies.
110 | #Pipfile.lock
111 |
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
113 | __pypackages__/
114 |
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 |
119 | # SageMath parsed files
120 | *.sage.py
121 |
122 | # Environments
123 | .env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 | pythonenv*
131 |
132 | # Spyder project settings
133 | .spyderproject
134 | .spyproject
135 |
136 | # Rope project settings
137 | .ropeproject
138 |
139 | # mkdocs documentation
140 | /site
141 |
142 | # mypy
143 | .mypy_cache/
144 | .dmypy.json
145 | dmypy.json
146 |
147 | # Pyre type checker
148 | .pyre/
149 |
150 | # pytype static type analyzer
151 | .pytype/
152 |
153 | # profiling data
154 | .prof
155 |
156 | ### R ###
157 | # History files
158 | .Rhistory
159 | .Rapp.history
160 |
161 | # Session Data files
162 | .RData
163 |
164 | # User-specific files
165 | .Ruserdata
166 |
167 | # Example code in package build process
168 | *-Ex.R
169 |
170 | # Output files from R CMD build
171 | /*.tar.gz
172 |
173 | # Output files from R CMD check
174 | /*.Rcheck/
175 |
176 | # RStudio files
177 | .Rproj.user/
178 |
179 | # produced vignettes
180 | vignettes/*.html
181 | vignettes/*.pdf
182 |
183 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
184 | .httr-oauth
185 |
186 | # knitr and R markdown default cache directories
187 | *_cache/
188 | /cache/
189 |
190 | # Temporary files created by R markdown
191 | *.utf8.md
192 | *.knit.md
193 |
194 | # R Environment Variables
195 | .Renviron
196 |
197 | ### R.Bookdown Stack ###
198 | # R package: bookdown caching files
199 | /*_files/
200 |
201 | ### VisualStudioCode ###
202 | .vscode/*
203 | !.vscode/settings.json
204 | !.vscode/tasks.json
205 | !.vscode/launch.json
206 | !.vscode/extensions.json
207 | *.code-workspace
208 |
209 | ### VisualStudioCode Patch ###
210 | # Ignore all local history of files
211 | .history
212 | .ionide
213 |
214 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/renv.lock:
--------------------------------------------------------------------------------
1 | {
2 | "R": {
3 | "Version": "4.0.0",
4 | "Repositories": [
5 | {
6 | "Name": "CRAN",
7 | "URL": "https://cloud.r-project.org"
8 | }
9 | ]
10 | },
11 | "Packages": {
12 | "BH": {
13 | "Package": "BH",
14 | "Version": "1.72.0-3",
15 | "Source": "Repository",
16 | "Repository": "CRAN",
17 | "Hash": "8f9ce74c6417d61f0782cbae5fd2b7b0"
18 | },
19 | "R6": {
20 | "Package": "R6",
21 | "Version": "2.4.1",
22 | "Source": "Repository",
23 | "Repository": "CRAN",
24 | "Hash": "292b54f8f4b94669b08f94e5acce6be2"
25 | },
26 | "Rcpp": {
27 | "Package": "Rcpp",
28 | "Version": "1.0.4.6",
29 | "Source": "Repository",
30 | "Repository": "CRAN",
31 | "Hash": "e652f23d8b1807cc975c51410d05b72f"
32 | },
33 | "askpass": {
34 | "Package": "askpass",
35 | "Version": "1.1",
36 | "Source": "Repository",
37 | "Repository": "CRAN",
38 | "Hash": "e8a22846fff485f0be3770c2da758713"
39 | },
40 | "assertthat": {
41 | "Package": "assertthat",
42 | "Version": "0.2.1",
43 | "Source": "Repository",
44 | "Repository": "CRAN",
45 | "Hash": "50c838a310445e954bc13f26f26a6ecf"
46 | },
47 | "base64enc": {
48 | "Package": "base64enc",
49 | "Version": "0.1-3",
50 | "Source": "Repository",
51 | "Repository": "CRAN",
52 | "Hash": "543776ae6848fde2f48ff3816d0628bc"
53 | },
54 | "cli": {
55 | "Package": "cli",
56 | "Version": "2.0.2",
57 | "Source": "Repository",
58 | "Repository": "CRAN",
59 | "Hash": "ff0becff7bfdfe3f75d29aff8f3172dd"
60 | },
61 | "crayon": {
62 | "Package": "crayon",
63 | "Version": "1.3.4",
64 | "Source": "Repository",
65 | "Repository": "CRAN",
66 | "Hash": "0d57bc8e27b7ba9e45dba825ebc0de6b"
67 | },
68 | "curl": {
69 | "Package": "curl",
70 | "Version": "4.3",
71 | "Source": "Repository",
72 | "Repository": "CRAN",
73 | "Hash": "2b7d10581cc730804e9ed178c8374bd6"
74 | },
75 | "digest": {
76 | "Package": "digest",
77 | "Version": "0.6.25",
78 | "Source": "Repository",
79 | "Repository": "CRAN",
80 | "Hash": "f697db7d92b7028c4b3436e9603fb636"
81 | },
82 | "dplyr": {
83 | "Package": "dplyr",
84 | "Version": "1.0.0",
85 | "Source": "Repository",
86 | "Repository": "CRAN",
87 | "Hash": "4011f62581a34080e44105d4aa05a97f"
88 | },
89 | "ellipsis": {
90 | "Package": "ellipsis",
91 | "Version": "0.3.1",
92 | "Source": "Repository",
93 | "Repository": "CRAN",
94 | "Hash": "fd2844b3a43ae2d27e70ece2df1b4e2a"
95 | },
96 | "europepmc": {
97 | "Package": "europepmc",
98 | "Version": "0.4",
99 | "Source": "Repository",
100 | "Repository": "CRAN",
101 | "Hash": "69b8843c951bab927f80e101fa268002"
102 | },
103 | "fansi": {
104 | "Package": "fansi",
105 | "Version": "0.4.1",
106 | "Source": "Repository",
107 | "Repository": "CRAN",
108 | "Hash": "7fce217eaaf8016e72065e85c73027b5"
109 | },
110 | "fastmap": {
111 | "Package": "fastmap",
112 | "Version": "1.0.1",
113 | "Source": "Repository",
114 | "Repository": "CRAN",
115 | "Hash": "83ab58a0518afe3d17e41da01af13b60"
116 | },
117 | "generics": {
118 | "Package": "generics",
119 | "Version": "0.0.2",
120 | "Source": "Repository",
121 | "Repository": "CRAN",
122 | "Hash": "b8cff1d1391fd1ad8b65877f4c7f2e53"
123 | },
124 | "glue": {
125 | "Package": "glue",
126 | "Version": "1.4.1",
127 | "Source": "Repository",
128 | "Repository": "CRAN",
129 | "Hash": "f43e0d5e85ccb0a4045670c0607ee504"
130 | },
131 | "hms": {
132 | "Package": "hms",
133 | "Version": "0.5.3",
134 | "Source": "Repository",
135 | "Repository": "CRAN",
136 | "Hash": "726671f634529d470545f9fd1a9d1869"
137 | },
138 | "htmltools": {
139 | "Package": "htmltools",
140 | "Version": "0.5.0",
141 | "Source": "Repository",
142 | "Repository": "CRAN",
143 | "Hash": "7d651b7131794fe007b1ad6f21aaa401"
144 | },
145 | "httpuv": {
146 | "Package": "httpuv",
147 | "Version": "1.5.4",
148 | "Source": "Repository",
149 | "Repository": "CRAN",
150 | "Hash": "4e6dabb220b006ccdc3b3b5ff993b205"
151 | },
152 | "httr": {
153 | "Package": "httr",
154 | "Version": "1.4.1",
155 | "Source": "Repository",
156 | "Repository": "CRAN",
157 | "Hash": "7146fea4685b4252ebf478978c75f597"
158 | },
159 | "jsonlite": {
160 | "Package": "jsonlite",
161 | "Version": "1.6.1",
162 | "Source": "Repository",
163 | "Repository": "CRAN",
164 | "Hash": "84b0ee361e2f78d6b7d670db9471c0c5"
165 | },
166 | "later": {
167 | "Package": "later",
168 | "Version": "1.1.0.1",
169 | "Source": "Repository",
170 | "Repository": "CRAN",
171 | "Hash": "d0a62b247165aabf397fded504660d8a"
172 | },
173 | "lifecycle": {
174 | "Package": "lifecycle",
175 | "Version": "0.2.0",
176 | "Source": "Repository",
177 | "Repository": "CRAN",
178 | "Hash": "361811f31f71f8a617a9a68bf63f1f42"
179 | },
180 | "magrittr": {
181 | "Package": "magrittr",
182 | "Version": "1.5",
183 | "Source": "Repository",
184 | "Repository": "CRAN",
185 | "Hash": "1bb58822a20301cee84a41678e25d9b7"
186 | },
187 | "mime": {
188 | "Package": "mime",
189 | "Version": "0.9",
190 | "Source": "Repository",
191 | "Repository": "CRAN",
192 | "Hash": "e87a35ec73b157552814869f45a63aa3"
193 | },
194 | "openssl": {
195 | "Package": "openssl",
196 | "Version": "1.4.1",
197 | "Source": "Repository",
198 | "Repository": "CRAN",
199 | "Hash": "49f7258fd86ebeaea1df24d9ded00478"
200 | },
201 | "pillar": {
202 | "Package": "pillar",
203 | "Version": "1.4.6",
204 | "Source": "Repository",
205 | "Repository": "CRAN",
206 | "Hash": "bdf26e55ccb7df3e49a490150277f002"
207 | },
208 | "pkgconfig": {
209 | "Package": "pkgconfig",
210 | "Version": "2.0.3",
211 | "Source": "Repository",
212 | "Repository": "CRAN",
213 | "Hash": "01f28d4278f15c76cddbea05899c5d6f"
214 | },
215 | "plyr": {
216 | "Package": "plyr",
217 | "Version": "1.8.6",
218 | "Source": "Repository",
219 | "Repository": "CRAN",
220 | "Hash": "ec0e5ab4e5f851f6ef32cd1d1984957f"
221 | },
222 | "prettyunits": {
223 | "Package": "prettyunits",
224 | "Version": "1.1.1",
225 | "Source": "Repository",
226 | "Repository": "CRAN",
227 | "Hash": "95ef9167b75dde9d2ccc3c7528393e7e"
228 | },
229 | "progress": {
230 | "Package": "progress",
231 | "Version": "1.2.2",
232 | "Source": "Repository",
233 | "Repository": "CRAN",
234 | "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061"
235 | },
236 | "promises": {
237 | "Package": "promises",
238 | "Version": "1.1.1",
239 | "Source": "Repository",
240 | "Repository": "CRAN",
241 | "Hash": "a8730dcbdd19f9047774909f0ec214a4"
242 | },
243 | "purrr": {
244 | "Package": "purrr",
245 | "Version": "0.3.4",
246 | "Source": "Repository",
247 | "Repository": "CRAN",
248 | "Hash": "97def703420c8ab10d8f0e6c72101e02"
249 | },
250 | "renv": {
251 | "Package": "renv",
252 | "Version": "0.10.0-28",
253 | "Source": "GitHub",
254 | "RemoteType": "github",
255 | "RemoteHost": "api.github.com",
256 | "RemoteRepo": "renv",
257 | "RemoteUsername": "rstudio",
258 | "RemoteRef": "master",
259 | "RemoteSha": "2359f9356dfe3295c3a347504523de74207f1696",
260 | "Hash": "4128b3662ea1ea51644e3b2cd7d29f0c"
261 | },
262 | "rlang": {
263 | "Package": "rlang",
264 | "Version": "0.4.7",
265 | "Source": "Repository",
266 | "Repository": "CRAN",
267 | "Hash": "c06d2a6887f4b414f8e927afd9ee976a"
268 | },
269 | "shiny": {
270 | "Package": "shiny",
271 | "Version": "1.4.0.2",
272 | "Source": "Repository",
273 | "Repository": "CRAN",
274 | "Hash": "a56d058adfc9df30bdd45dbb01cec39f"
275 | },
276 | "sourcetools": {
277 | "Package": "sourcetools",
278 | "Version": "0.1.7",
279 | "Source": "Repository",
280 | "Repository": "CRAN",
281 | "Hash": "947e4e02a79effa5d512473e10f41797"
282 | },
283 | "stringi": {
284 | "Package": "stringi",
285 | "Version": "1.4.6",
286 | "Source": "Repository",
287 | "Repository": "CRAN",
288 | "Hash": "e99d8d656980d2dd416a962ae55aec90"
289 | },
290 | "sys": {
291 | "Package": "sys",
292 | "Version": "3.3",
293 | "Source": "Repository",
294 | "Repository": "CRAN",
295 | "Hash": "507f3116a38d37ad330a038b3be07b66"
296 | },
297 | "tibble": {
298 | "Package": "tibble",
299 | "Version": "3.0.3",
300 | "Source": "Repository",
301 | "Repository": "CRAN",
302 | "Hash": "08bd36bd34b20d4f7971d49e81deaab0"
303 | },
304 | "tidyr": {
305 | "Package": "tidyr",
306 | "Version": "1.1.0",
307 | "Source": "Repository",
308 | "Repository": "CRAN",
309 | "Hash": "7395a05640bf91502dd475a84008d87e"
310 | },
311 | "tidyselect": {
312 | "Package": "tidyselect",
313 | "Version": "1.1.0",
314 | "Source": "Repository",
315 | "Repository": "CRAN",
316 | "Hash": "6ea435c354e8448819627cf686f66e0a"
317 | },
318 | "triebeard": {
319 | "Package": "triebeard",
320 | "Version": "0.3.0",
321 | "Source": "Repository",
322 | "Repository": "CRAN",
323 | "Hash": "847a9d113b78baca4a9a8639609ea228"
324 | },
325 | "urltools": {
326 | "Package": "urltools",
327 | "Version": "1.7.3",
328 | "Source": "Repository",
329 | "Repository": "CRAN",
330 | "Hash": "e86a704261a105f4703f653e05defa3e"
331 | },
332 | "utf8": {
333 | "Package": "utf8",
334 | "Version": "1.1.4",
335 | "Source": "Repository",
336 | "Repository": "CRAN",
337 | "Hash": "4a5081acfb7b81a572e4384a7aaf2af1"
338 | },
339 | "vctrs": {
340 | "Package": "vctrs",
341 | "Version": "0.3.1",
342 | "Source": "Repository",
343 | "Repository": "CRAN",
344 | "Hash": "1739235995f08583db4095a28c357207"
345 | },
346 | "xml2": {
347 | "Package": "xml2",
348 | "Version": "1.3.2",
349 | "Source": "Repository",
350 | "Repository": "CRAN",
351 | "Hash": "d4d71a75dd3ea9eb5fa28cc21f9585e2"
352 | },
353 | "xtable": {
354 | "Package": "xtable",
355 | "Version": "1.8-4",
356 | "Source": "Repository",
357 | "Repository": "CRAN",
358 | "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2"
359 | }
360 | }
361 | }
362 |
--------------------------------------------------------------------------------
/prototypes/shiny_app/abstract_display/renv/activate.R:
--------------------------------------------------------------------------------
1 |
2 | local({
3 |
4 | # the requested version of renv
5 | version <- "0.10.0-28"
6 |
7 | # the project directory
8 | project <- getwd()
9 |
10 | # avoid recursion
11 | if (!is.na(Sys.getenv("RENV_R_INITIALIZING", unset = NA)))
12 | return(invisible(TRUE))
13 |
14 | # signal that we're loading renv during R startup
15 | Sys.setenv("RENV_R_INITIALIZING" = "true")
16 | on.exit(Sys.unsetenv("RENV_R_INITIALIZING"), add = TRUE)
17 |
18 | # signal that we've consented to use renv
19 | options(renv.consent = TRUE)
20 |
21 | # load the 'utils' package eagerly -- this ensures that renv shims, which
22 | # mask 'utils' packages, will come first on the search path
23 | library(utils, lib.loc = .Library)
24 |
25 | # check to see if renv has already been loaded
26 | if ("renv" %in% loadedNamespaces()) {
27 |
28 | # if renv has already been loaded, and it's the requested version of renv,
29 | # nothing to do
30 | spec <- .getNamespaceInfo(.getNamespace("renv"), "spec")
31 | if (identical(spec[["version"]], version))
32 | return(invisible(TRUE))
33 |
34 | # otherwise, unload and attempt to load the correct version of renv
35 | unloadNamespace("renv")
36 |
37 | }
38 |
39 | # load bootstrap tools
40 | bootstrap <- function(version, library) {
41 |
42 | # read repos (respecting override if set)
43 | repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA)
44 | if (is.na(repos))
45 | repos <- getOption("repos")
46 |
47 | # fix up repos
48 | on.exit(options(repos = repos), add = TRUE)
49 | repos[repos == "@CRAN@"] <- "https://cloud.r-project.org"
50 | options(repos = repos)
51 |
52 | # attempt to download renv
53 | tarball <- tryCatch(renv_bootstrap_download(version), error = identity)
54 | if (inherits(tarball, "error"))
55 | stop("failed to download renv ", version)
56 |
57 | # now attempt to install
58 | status <- tryCatch(renv_bootstrap_install(version, tarball, library), error = identity)
59 | if (inherits(status, "error"))
60 | stop("failed to install renv ", version)
61 |
62 | }
63 |
64 | renv_bootstrap_download_impl <- function(url, destfile) {
65 |
66 | mode <- "wb"
67 |
68 | # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715
69 | fixup <-
70 | Sys.info()[["sysname"]] == "Windows" &&
71 | substring(url, 1L, 5L) == "file:"
72 |
73 | if (fixup)
74 | mode <- "w+b"
75 |
76 | download.file(
77 | url = url,
78 | destfile = destfile,
79 | mode = mode,
80 | quiet = TRUE
81 | )
82 |
83 | }
84 |
85 | renv_bootstrap_download <- function(version) {
86 |
87 | methods <- list(
88 | renv_bootstrap_download_cran_latest,
89 | renv_bootstrap_download_cran_archive,
90 | renv_bootstrap_download_github
91 | )
92 |
93 | for (method in methods) {
94 | path <- tryCatch(method(version), error = identity)
95 | if (is.character(path) && file.exists(path))
96 | return(path)
97 | }
98 |
99 | stop("failed to download renv ", version)
100 |
101 | }
102 |
103 | renv_bootstrap_download_cran_latest <- function(version) {
104 |
105 | # check for renv on CRAN matching this version
106 | db <- as.data.frame(available.packages(), stringsAsFactors = FALSE)
107 |
108 | entry <- db[db$Package %in% "renv" & db$Version %in% version, ]
109 | if (nrow(entry) == 0) {
110 | fmt <- "renv %s is not available from your declared package repositories"
111 | stop(sprintf(fmt, version))
112 | }
113 |
114 | message("* Downloading renv ", version, " from CRAN ... ", appendLF = FALSE)
115 |
116 | info <- tryCatch(
117 | download.packages("renv", destdir = tempdir()),
118 | condition = identity
119 | )
120 |
121 | if (inherits(info, "condition")) {
122 | message("FAILED")
123 | return(FALSE)
124 | }
125 |
126 | message("OK")
127 | info[1, 2]
128 |
129 | }
130 |
131 | renv_bootstrap_download_cran_archive <- function(version) {
132 |
133 | name <- sprintf("renv_%s.tar.gz", version)
134 | repos <- getOption("repos")
135 | urls <- file.path(repos, "src/contrib/Archive/renv", name)
136 | destfile <- file.path(tempdir(), name)
137 |
138 | message("* Downloading renv ", version, " from CRAN archive ... ", appendLF = FALSE)
139 |
140 | for (url in urls) {
141 |
142 | status <- tryCatch(
143 | renv_bootstrap_download_impl(url, destfile),
144 | condition = identity
145 | )
146 |
147 | if (identical(status, 0L)) {
148 | message("OK")
149 | return(destfile)
150 | }
151 |
152 | }
153 |
154 | message("FAILED")
155 | return(FALSE)
156 |
157 | }
158 |
159 | renv_bootstrap_download_github <- function(version) {
160 |
161 | enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE")
162 | if (!identical(enabled, "TRUE"))
163 | return(FALSE)
164 |
165 | # prepare download options
166 | pat <- Sys.getenv("GITHUB_PAT")
167 | if (nzchar(Sys.which("curl")) && nzchar(pat)) {
168 | fmt <- "--location --fail --header \"Authorization: token %s\""
169 | extra <- sprintf(fmt, pat)
170 | saved <- options("download.file.method", "download.file.extra")
171 | options(download.file.method = "curl", download.file.extra = extra)
172 | on.exit(do.call(base::options, saved), add = TRUE)
173 | } else if (nzchar(Sys.which("wget")) && nzchar(pat)) {
174 | fmt <- "--header=\"Authorization: token %s\""
175 | extra <- sprintf(fmt, pat)
176 | saved <- options("download.file.method", "download.file.extra")
177 | options(download.file.method = "wget", download.file.extra = extra)
178 | on.exit(do.call(base::options, saved), add = TRUE)
179 | }
180 |
181 | message("* Downloading renv ", version, " from GitHub ... ", appendLF = FALSE)
182 |
183 | url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version)
184 | name <- sprintf("renv_%s.tar.gz", version)
185 | destfile <- file.path(tempdir(), name)
186 |
187 | status <- tryCatch(
188 | renv_bootstrap_download_impl(url, destfile),
189 | condition = identity
190 | )
191 |
192 | if (!identical(status, 0L)) {
193 | message("FAILED")
194 | return(FALSE)
195 | }
196 |
197 | message("Done!")
198 | return(destfile)
199 |
200 | }
201 |
202 | renv_bootstrap_install <- function(version, tarball, library) {
203 |
204 | # attempt to install it into project library
205 | message("* Installing renv ", version, " ... ", appendLF = FALSE)
206 | dir.create(library, showWarnings = FALSE, recursive = TRUE)
207 |
208 | # invoke using system2 so we can capture and report output
209 | bin <- R.home("bin")
210 | exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R"
211 | r <- file.path(bin, exe)
212 | args <- c("--vanilla", "CMD", "INSTALL", "-l", shQuote(library), shQuote(tarball))
213 | output <- system2(r, args, stdout = TRUE, stderr = TRUE)
214 | message("Done!")
215 |
216 | # check for successful install
217 | status <- attr(output, "status")
218 | if (is.numeric(status) && !identical(status, 0L)) {
219 | header <- "Error installing renv:"
220 | lines <- paste(rep.int("=", nchar(header)), collapse = "")
221 | text <- c(header, lines, output)
222 | writeLines(text, con = stderr())
223 | }
224 |
225 | status
226 |
227 | }
228 |
229 | renv_bootstrap_prefix <- function() {
230 |
231 | # construct version prefix
232 | version <- paste(R.version$major, R.version$minor, sep = ".")
233 | prefix <- paste("R", numeric_version(version)[1, 1:2], sep = "-")
234 |
235 | # include SVN revision for development versions of R
236 | # (to avoid sharing platform-specific artefacts with released versions of R)
237 | devel <-
238 | identical(R.version[["status"]], "Under development (unstable)") ||
239 | identical(R.version[["nickname"]], "Unsuffered Consequences")
240 |
241 | if (devel)
242 | prefix <- paste(prefix, R.version[["svn rev"]], sep = "-r")
243 |
244 | # build list of path components
245 | components <- c(prefix, R.version$platform)
246 |
247 | # include prefix if provided by user
248 | prefix <- Sys.getenv("RENV_PATHS_PREFIX")
249 | if (nzchar(prefix))
250 | components <- c(prefix, components)
251 |
252 | # build prefix
253 | paste(components, collapse = "/")
254 |
255 | }
256 |
257 | renv_bootstrap_library_root <- function(project) {
258 |
259 | path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA)
260 | if (!is.na(path))
261 | return(path)
262 |
263 | path <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA)
264 | if (!is.na(path))
265 | return(file.path(path, basename(project)))
266 |
267 | file.path(project, "renv/library")
268 |
269 | }
270 |
271 | renv_bootstrap_validate_version <- function(version) {
272 |
273 | loadedversion <- utils::packageDescription("renv", fields = "Version")
274 | if (version == loadedversion)
275 | return(TRUE)
276 |
277 | # assume four-component versions are from GitHub; three-component
278 | # versions are from CRAN
279 | components <- strsplit(loadedversion, "[.-]")[[1]]
280 | remote <- if (length(components) == 4L)
281 | paste("rstudio/renv", loadedversion, sep = "@")
282 | else
283 | paste("renv", loadedversion, sep = "@")
284 |
285 | fmt <- paste(
286 | "renv %1$s was loaded from project library, but renv %2$s is recorded in lockfile.",
287 | "Use `renv::record(\"%3$s\")` to record this version in the lockfile.",
288 | "Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.",
289 | sep = "\n"
290 | )
291 |
292 | msg <- sprintf(fmt, loadedversion, version, remote)
293 | warning(msg, call. = FALSE)
294 |
295 | FALSE
296 |
297 | }
298 |
299 | renv_bootstrap_load <- function(project, libpath, version) {
300 |
301 | # try to load renv from the project library
302 | if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE))
303 | return(FALSE)
304 |
305 | # warn if the version of renv loaded does not match
306 | renv_bootstrap_validate_version(version)
307 |
308 | # load the project
309 | renv::load(project)
310 |
311 | TRUE
312 |
313 | }
314 |
315 | # construct path to library root
316 | root <- renv_bootstrap_library_root(project)
317 |
318 | # construct library prefix for platform
319 | prefix <- renv_bootstrap_prefix()
320 |
321 | # construct full libpath
322 | libpath <- file.path(root, prefix)
323 |
324 | # attempt to load
325 | if (renv_bootstrap_load(project, libpath, version))
326 | return(TRUE)
327 |
328 | # load failed; attempt to bootstrap
329 | bootstrap(version, libpath)
330 |
331 | # exit early if we're just testing bootstrap
332 | if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA)))
333 | return(TRUE)
334 |
335 | # try again to load
336 | if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) {
337 | message("Successfully installed and loaded renv ", version, ".")
338 | return(renv::load())
339 | }
340 |
341 | # failed to download or load renv; warn the user
342 | msg <- c(
343 | "Failed to find an renv installation: the project will not be loaded.",
344 | "Use `renv::activate()` to re-initialize the project."
345 | )
346 |
347 | warning(paste(msg, collapse = "\n"), call. = FALSE)
348 |
349 | })
350 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/prototypes/notebooks/scispacy_linking_via_umls.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "name": "scispacy_linking_via_umls.ipynb",
7 | "provenance": [],
8 | "collapsed_sections": []
9 | },
10 | "kernelspec": {
11 | "name": "python3",
12 | "display_name": "Python 3"
13 | }
14 | },
15 | "cells": [
16 | {
17 | "cell_type": "markdown",
18 | "metadata": {
19 | "id": "v0hVqAJ-nKzF"
20 | },
21 | "source": [
22 | "#### Enviroment setup\n",
23 | "\n",
24 | "Downloading models and defining functions, this takes a while."
25 | ]
26 | },
27 | {
28 | "cell_type": "code",
29 | "metadata": {
30 | "id": "G_no39qRZzRi"
31 | },
32 | "source": [
33 | "!pip install scispacy\n",
34 | "!pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.2.5/en_core_sci_md-0.2.5.tar.gz # Medium sized language model\n",
35 | "!pip install wikidataintegrator"
36 | ],
37 | "execution_count": null,
38 | "outputs": []
39 | },
40 | {
41 | "cell_type": "code",
42 | "metadata": {
43 | "id": "3xR9dKnWZBAO"
44 | },
45 | "source": [
46 | "import scispacy\n",
47 | "import spacy\n",
48 | "import pandas as pd\n",
49 | "from wikidataintegrator import wdi_core\n",
50 | "from scispacy.abbreviation import AbbreviationDetector\n",
51 | "from scispacy.linking import EntityLinker\n",
52 | "from functools import lru_cache"
53 | ],
54 | "execution_count": null,
55 | "outputs": []
56 | },
57 | {
58 | "cell_type": "code",
59 | "metadata": {
60 | "id": "5yG2Qz05ZuTj"
61 | },
62 | "source": [
63 | "import en_core_sci_md\n",
64 | "nlp = en_core_sci_md.load()"
65 | ],
66 | "execution_count": null,
67 | "outputs": []
68 | },
69 | {
70 | "cell_type": "code",
71 | "metadata": {
72 | "id": "RS_YKN4vetXI",
73 | "outputId": "61e705d3-934d-474d-acb1-2880cc96aab6",
74 | "colab": {
75 | "base_uri": "https://localhost:8080/",
76 | "height": 106
77 | }
78 | },
79 | "source": [
80 | "abbreviation_pipe = AbbreviationDetector(nlp)\n",
81 | "nlp.add_pipe(abbreviation_pipe)\n",
82 | "linker = EntityLinker(resolve_abbreviations=True, name=\"umls\")\n",
83 | "nlp.add_pipe(linker)"
84 | ],
85 | "execution_count": null,
86 | "outputs": [
87 | {
88 | "output_type": "stream",
89 | "text": [
90 | "/usr/local/lib/python3.6/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator TfidfTransformer from version 0.20.3 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.\n",
91 | " UserWarning)\n",
92 | "/usr/local/lib/python3.6/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator TfidfVectorizer from version 0.20.3 when using version 0.22.2.post1. This might lead to breaking code or invalid results. Use at your own risk.\n",
93 | " UserWarning)\n"
94 | ],
95 | "name": "stderr"
96 | }
97 | ]
98 | },
99 | {
100 | "cell_type": "code",
101 | "metadata": {
102 | "id": "7oFnYiRygZNo"
103 | },
104 | "source": [
105 | "# Function by github.com/lubianat with some slight alterations by github.com/jvfe\n",
106 | "@lru_cache(maxsize=None)\n",
107 | "def get_wikidata_item(wikidata_property, value):\n",
108 | " \"\"\"Gets a Wikidata item for a determined property-value pair\n",
109 | "\n",
110 | "\n",
111 | " Args:\n",
112 | " property (str): The property to search\n",
113 | " value (str): The value of said property\n",
114 | " \n",
115 | " Returns:\n",
116 | " str: A Wikidata item or a \"None\" value if no item found.\n",
117 | " \"\"\"\n",
118 | " query_result = wdi_core.WDItemEngine.execute_sparql_query(\n",
119 | " f'SELECT distinct ?item WHERE {{ ?item wdt:{wikidata_property} \"{value}\" }}'\n",
120 | " )\n",
121 | " try:\n",
122 | " match = query_result[\"results\"][\"bindings\"][0]\n",
123 | " except:\n",
124 | " return None\n",
125 | " qid = match[\"item\"][\"value\"]\n",
126 | "\n",
127 | " qid = qid.split(\"/\")[4]\n",
128 | " return qid"
129 | ],
130 | "execution_count": null,
131 | "outputs": []
132 | },
133 | {
134 | "cell_type": "code",
135 | "metadata": {
136 | "id": "SXzHNaoOnajc"
137 | },
138 | "source": [
139 | "def get_wdt_items_from_umls_entities(doc):\n",
140 | " \"\"\"Create a table from the UMLS entities and link them to WDT\n",
141 | " \"\"\"\n",
142 | " identified = []\n",
143 | " for ent in doc.ents:\n",
144 | " try:\n",
145 | " best_id = ent._.kb_ents[0][0]\n",
146 | " except IndexError:\n",
147 | " best_id = None\n",
148 | " identified.append([ent.text, ent.start_char, ent.end_char, best_id])\n",
149 | "\n",
150 | " entity_df = pd.DataFrame.from_records(identified, \n",
151 | " columns=['label', 'start_pos', 'end_pos', 'umls_id'])\n",
152 | " \n",
153 | " entity_df['qid'] = entity_df['umls_id'].apply(lambda x: get_wikidata_item(\"P2892\", x))\n",
154 | "\n",
155 | " return entity_df"
156 | ],
157 | "execution_count": null,
158 | "outputs": []
159 | },
160 | {
161 | "cell_type": "markdown",
162 | "metadata": {
163 | "id": "yrZ4EdWuoCq3"
164 | },
165 | "source": [
166 | "### Testing out"
167 | ]
168 | },
169 | {
170 | "cell_type": "code",
171 | "metadata": {
172 | "id": "MHXGNR-UeRHf"
173 | },
174 | "source": [
175 | "text = \"\"\"\n",
176 | "Spinal and bulbar muscular atrophy (SBMA) is an\n",
177 | "inherited motor neuron disease caused by the expansion\n",
178 | "of a polyglutamine tract within the androgen receptor (AR).\n",
179 | "SBMA can be caused by this easily.\n",
180 | "\"\"\"\n",
181 | "\n",
182 | "doc = nlp(text)"
183 | ],
184 | "execution_count": null,
185 | "outputs": []
186 | },
187 | {
188 | "cell_type": "code",
189 | "metadata": {
190 | "id": "CQx9w-Q-mZNc",
191 | "outputId": "28e61d93-8d31-47ee-f3d3-b9adf8ef78ea",
192 | "colab": {
193 | "base_uri": "https://localhost:8080/",
194 | "height": 363
195 | }
196 | },
197 | "source": [
198 | "get_wdt_items_from_umls_entities(doc)"
199 | ],
200 | "execution_count": null,
201 | "outputs": [
202 | {
203 | "output_type": "execute_result",
204 | "data": {
205 | "text/html": [
206 | "
\n",
207 | "\n",
220 | "
\n",
221 | " \n",
222 | " \n",
223 | " | \n",
224 | " label | \n",
225 | " start_pos | \n",
226 | " end_pos | \n",
227 | " umls_id | \n",
228 | " qid | \n",
229 | "
\n",
230 | " \n",
231 | " \n",
232 | " \n",
233 | " | 0 | \n",
234 | " Spinal | \n",
235 | " 1 | \n",
236 | " 7 | \n",
237 | " C0521329 | \n",
238 | " None | \n",
239 | "
\n",
240 | " \n",
241 | " | 1 | \n",
242 | " bulbar muscular atrophy | \n",
243 | " 12 | \n",
244 | " 35 | \n",
245 | " C1839259 | \n",
246 | " Q1995327 | \n",
247 | "
\n",
248 | " \n",
249 | " | 2 | \n",
250 | " SBMA | \n",
251 | " 37 | \n",
252 | " 41 | \n",
253 | " C1839259 | \n",
254 | " Q1995327 | \n",
255 | "
\n",
256 | " \n",
257 | " | 3 | \n",
258 | " inherited | \n",
259 | " 49 | \n",
260 | " 58 | \n",
261 | " C0439660 | \n",
262 | " None | \n",
263 | "
\n",
264 | " \n",
265 | " | 4 | \n",
266 | " motor neuron disease | \n",
267 | " 59 | \n",
268 | " 79 | \n",
269 | " C0085084 | \n",
270 | " Q3221083 | \n",
271 | "
\n",
272 | " \n",
273 | " | 5 | \n",
274 | " expansion | \n",
275 | " 94 | \n",
276 | " 103 | \n",
277 | " C0007595 | \n",
278 | " None | \n",
279 | "
\n",
280 | " \n",
281 | " | 6 | \n",
282 | " polyglutamine tract | \n",
283 | " 109 | \n",
284 | " 128 | \n",
285 | " C0032500 | \n",
286 | " None | \n",
287 | "
\n",
288 | " \n",
289 | " | 7 | \n",
290 | " androgen receptor | \n",
291 | " 140 | \n",
292 | " 157 | \n",
293 | " C0034786 | \n",
294 | " None | \n",
295 | "
\n",
296 | " \n",
297 | " | 8 | \n",
298 | " AR | \n",
299 | " 159 | \n",
300 | " 161 | \n",
301 | " C0034786 | \n",
302 | " None | \n",
303 | "
\n",
304 | " \n",
305 | " | 9 | \n",
306 | " SBMA | \n",
307 | " 164 | \n",
308 | " 168 | \n",
309 | " C1839259 | \n",
310 | " Q1995327 | \n",
311 | "
\n",
312 | " \n",
313 | "
\n",
314 | "
"
315 | ],
316 | "text/plain": [
317 | " label start_pos end_pos umls_id qid\n",
318 | "0 Spinal 1 7 C0521329 None\n",
319 | "1 bulbar muscular atrophy 12 35 C1839259 Q1995327\n",
320 | "2 SBMA 37 41 C1839259 Q1995327\n",
321 | "3 inherited 49 58 C0439660 None\n",
322 | "4 motor neuron disease 59 79 C0085084 Q3221083\n",
323 | "5 expansion 94 103 C0007595 None\n",
324 | "6 polyglutamine tract 109 128 C0032500 None\n",
325 | "7 androgen receptor 140 157 C0034786 None\n",
326 | "8 AR 159 161 C0034786 None\n",
327 | "9 SBMA 164 168 C1839259 Q1995327"
328 | ]
329 | },
330 | "metadata": {
331 | "tags": []
332 | },
333 | "execution_count": 8
334 | }
335 | ]
336 | }
337 | ]
338 | }
--------------------------------------------------------------------------------
/prototypes/notebooks/scispacy_linking_via_mesh.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "name": "scispacy_linking_via_mesh.ipynb",
7 | "provenance": [],
8 | "collapsed_sections": []
9 | },
10 | "kernelspec": {
11 | "display_name": "Python 3",
12 | "language": "python",
13 | "name": "python3"
14 | },
15 | "language_info": {
16 | "codemirror_mode": {
17 | "name": "ipython",
18 | "version": 3
19 | },
20 | "file_extension": ".py",
21 | "mimetype": "text/x-python",
22 | "name": "python",
23 | "nbconvert_exporter": "python",
24 | "pygments_lexer": "ipython3",
25 | "version": "3.7.6"
26 | }
27 | },
28 | "cells": [
29 | {
30 | "cell_type": "markdown",
31 | "metadata": {
32 | "id": "v0hVqAJ-nKzF"
33 | },
34 | "source": [
35 | "#### Entity identification and Wikidata linking with MeSH terms\n",
36 | "\n",
37 | "Based on scispacy_linking_via_umls.ipynb\n"
38 | ]
39 | },
40 | {
41 | "cell_type": "code",
42 | "metadata": {
43 | "id": "G_no39qRZzRi"
44 | },
45 | "source": [
46 | "## Install required dependencies\n",
47 | "!pip install scispacy\n",
48 | "!pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.2.5/en_core_sci_md-0.2.5.tar.gz # Medium language model\n",
49 | "!pip install wikidataintegrator\n",
50 | "!pip install Wikidata "
51 | ],
52 | "execution_count": null,
53 | "outputs": []
54 | },
55 | {
56 | "cell_type": "code",
57 | "metadata": {
58 | "id": "3xR9dKnWZBAO"
59 | },
60 | "source": [
61 | "# Load libraries\n",
62 | "import scispacy\n",
63 | "import spacy\n",
64 | "import en_core_sci_md\n",
65 | "import urllib.parse\n",
66 | "import pandas as pd\n",
67 | "from wikidataintegrator import wdi_core\n",
68 | "from scispacy.abbreviation import AbbreviationDetector\n",
69 | "from scispacy.linking import EntityLinker\n",
70 | "from functools import lru_cache\n",
71 | "import requests\n",
72 | "import json\n",
73 | "import os\n",
74 | "import sys\n",
75 | "import stat\n",
76 | "import re\n",
77 | "import numpy as np\n",
78 | "import requests"
79 | ],
80 | "execution_count": null,
81 | "outputs": []
82 | },
83 | {
84 | "cell_type": "code",
85 | "metadata": {
86 | "id": "aNmFyqp3GOdz"
87 | },
88 | "source": [
89 | "#fetch article abstracts from EuroPMC articles api\n",
90 | "def get_pmc_meta(pid):\n",
91 | " pmeta = {} #pmc metadata (mesh terms, title, abstract\n",
92 | " try:\n",
93 | " if re.search('PMC',pid) is None:\n",
94 | " pq = 'ext_id%3A'+pid+'%20src%3Amed'\n",
95 | " else:\n",
96 | " pq = pid \n",
97 | " url = 'https://www.ebi.ac.uk/europepmc/webservices/rest/search?query='+pq+'&resultType=core&synonym=TRUE&cursorMark=*&pageSize=1000&format=json'\n",
98 | " response = requests.get(url)\n",
99 | " rjson = response.json() \n",
100 | " for rslt in rjson['resultList']['result']:\n",
101 | " pmeta['pmid'] = rslt['pmid'] if 'pmid' in rslt.keys() else ''\n",
102 | " pmeta['pmcid'] = rslt['pmcid'] if 'pmcid' in rslt.keys() else ''\n",
103 | " pmeta['mesh'] = [] # pmc mesh terms\n",
104 | " if 'meshHeadingList' in rslt.keys():\n",
105 | " for m in rslt['meshHeadingList']['meshHeading']:\n",
106 | " if 'meshQualifierList' in m.keys():\n",
107 | " for q in m['meshQualifierList']['meshQualifier']:\n",
108 | " pmeta['mesh'].append(m['descriptorName'])\n",
109 | " pmeta['mesh'].append(q['qualifierName'])\n",
110 | " else:\n",
111 | " pmeta['mesh'].append(m['descriptorName'])\n",
112 | " pmeta['pmc_title'] = rslt['title'] #pmc title\n",
113 | " pmeta['pmc_abstract'] = rslt['abstractText'] if 'abstractText' in rslt.keys() else '' #\n",
114 | " except:\n",
115 | " print('ERROR IN PMC ID:'+pid)\n",
116 | " return pmeta['pmc_abstract']\n"
117 | ],
118 | "execution_count": null,
119 | "outputs": []
120 | },
121 | {
122 | "cell_type": "code",
123 | "metadata": {
124 | "id": "5yG2Qz05ZuTj"
125 | },
126 | "source": [
127 | "nlp = en_core_sci_md.load()"
128 | ],
129 | "execution_count": null,
130 | "outputs": []
131 | },
132 | {
133 | "cell_type": "code",
134 | "metadata": {
135 | "id": "8tks6g9FLtQw",
136 | "outputId": "717dede2-2f6a-42c3-d038-dfd2afb2d98d",
137 | "colab": {
138 | "base_uri": "https://localhost:8080/",
139 | "height": 207
140 | }
141 | },
142 | "source": [
143 | "#Add mesh terms\n",
144 | "abbreviation_pipe = AbbreviationDetector(nlp)\n",
145 | "nlp.add_pipe(abbreviation_pipe)\n",
146 | "linker = EntityLinker(resolve_abbreviations=True, name=\"mesh\")\n",
147 | "nlp.add_pipe(linker)"
148 | ],
149 | "execution_count": null,
150 | "outputs": [
151 | {
152 | "output_type": "stream",
153 | "text": [
154 | "https://ai2-s2-scispacy.s3-us-west-2.amazonaws.com/data/mesh_linking_model/tfidf_vectors_sparse.npz not found in cache, downloading to /tmp/tmp2c4mogq1\n",
155 | "Finished download, copying /tmp/tmp2c4mogq1 to cache at /root/.scispacy/datasets/b28c5ae2b3052b66e3df4d9e8082fd6138060d0369555a603bf103facbc8a175.cdcb8550ec06b33ef35938f3ffb30ca58f6082bc649ce9c8069d041eb33c22b6.tfidf_vectors_sparse.npz\n",
156 | "https://ai2-s2-scispacy.s3-us-west-2.amazonaws.com/data/mesh_linking_model/nmslib_index.bin not found in cache, downloading to /tmp/tmpwxqnuuam\n",
157 | "Finished download, copying /tmp/tmpwxqnuuam to cache at /root/.scispacy/datasets/6812e57b9f4b0e14d6f9974a745e136fb47b5c2a2d955635a4d13675f6add07d.62b9b370bfb8c9433ba8fb69c1fb83405116079c4f741698b8159319d01833c0.nmslib_index.bin\n",
158 | "https://ai2-s2-scispacy.s3-us-west-2.amazonaws.com/data/mesh_linking_model/tfidf_vectorizer.joblib not found in cache, downloading to /tmp/tmp7io73io8\n",
159 | "Finished download, copying /tmp/tmp7io73io8 to cache at /root/.scispacy/datasets/418d053aba7875dd273cbad2b63ccebdd7ceeb923355172d1dc581ec780c8b13.5473393740d5e23a46590babbdd7a98603d6a22476c1ecbca3faf50b07e1fa71.tfidf_vectorizer.joblib\n",
160 | "https://ai2-s2-scispacy.s3-us-west-2.amazonaws.com/data/mesh_linking_model/concept_aliases.json not found in cache, downloading to /tmp/tmp4_w02vum\n",
161 | "Finished download, copying /tmp/tmp4_w02vum to cache at /root/.scispacy/datasets/ee3f06eff5008dc3a2f9e52df6128f32ac832c0026a9a677bbe7a2d8f253ca43.1b70562d4cd41b4b8657534ae5abd2a8ee5641e9a11e92b9c172165a3ae6a5c2.concept_aliases.json\n",
162 | "https://ai2-s2-scispacy.s3-us-west-2.amazonaws.com/data/mesh_2020.jsonl not found in cache, downloading to /tmp/tmpz1bn0u7z\n",
163 | "Finished download, copying /tmp/tmpz1bn0u7z to cache at /root/.scispacy/datasets/e3d47cc15aee0d5dfbaff226e071e35bcb731ad8a752f91bbda8b8dd4b2acc67.aa95b0492040d1386799638de559a625798ede06bc23e9b77166500fab9903d0.mesh_2020.jsonl\n"
164 | ],
165 | "name": "stdout"
166 | }
167 | ]
168 | },
169 | {
170 | "cell_type": "code",
171 | "metadata": {
172 | "id": "7oFnYiRygZNo"
173 | },
174 | "source": [
175 | "# Function by github.com/lubianat with some slight alterations by me\n",
176 | "@lru_cache(maxsize=None)\n",
177 | "def get_wikidata_item(wikidata_property, value):\n",
178 | " query_result = wdi_core.WDItemEngine.execute_sparql_query(\n",
179 | " f'SELECT distinct ?item WHERE {{ ?item wdt:{wikidata_property} \"{value}\" }}'\n",
180 | " )\n",
181 | " try:\n",
182 | " match = query_result[\"results\"][\"bindings\"][0]\n",
183 | " except:\n",
184 | " return None\n",
185 | " qid = match[\"item\"][\"value\"]\n",
186 | "\n",
187 | " qid = qid.split(\"/\")[4]\n",
188 | " return qid"
189 | ],
190 | "execution_count": null,
191 | "outputs": []
192 | },
193 | {
194 | "cell_type": "code",
195 | "metadata": {
196 | "id": "AFlbjxfGaSZn"
197 | },
198 | "source": [
199 | "# Function to fetch first serach result of wikidata entry\n",
200 | "# source https://stackoverflow.com/questions/51419785/extract-data-from-wikidata-in-python\n",
201 | "API_ENDPOINT = \"https://www.wikidata.org/w/api.php\"\n",
202 | "def get_arbitrary_wdataids(term):\n",
203 | " term = urllib.parse.quote(term)\n",
204 | " params = {\n",
205 | " 'action': 'wbsearchentities',\n",
206 | " 'format': 'json',\n",
207 | " 'language': 'en',\n",
208 | " 'search': term\n",
209 | " }\n",
210 | " r = requests.get(API_ENDPOINT, params = params) #make the request\n",
211 | " try:\n",
212 | " wdataid = r.json()['search'][0]['id']\n",
213 | " except IndexError:\n",
214 | " wdataid = None\n",
215 | " return wdataid"
216 | ],
217 | "execution_count": null,
218 | "outputs": []
219 | },
220 | {
221 | "cell_type": "code",
222 | "metadata": {
223 | "id": "PpJAWvEBLb4k"
224 | },
225 | "source": [
226 | "#mesh term to wikidata\n",
227 | "def get_wdt_items_from_mesh_entities(doc):\n",
228 | "\n",
229 | " identified = []\n",
230 | " for ent in doc.ents:\n",
231 | " arbitrary_wdata_id = get_arbitrary_wdataids(str(ent))\n",
232 | " try:\n",
233 | " best_id = ent._.kb_ents[0][0]\n",
234 | " match_score = ent._.kb_ents[1][1]\n",
235 | " except IndexError:\n",
236 | " best_id = None\n",
237 | " match_score = \"NA\"\n",
238 | " identified.append([ent.text, ent.start_char, ent.end_char, best_id, match_score, arbitrary_wdata_id])\n",
239 | "\n",
240 | " entity_df = pd.DataFrame.from_records(identified, \n",
241 | " columns=['label', 'start_pos', 'end_pos', 'mesh_id', 'meshid_match_score', 'arbitrary_wdata_id'])\n",
242 | " \n",
243 | " entity_df['wdata_id'] = entity_df['mesh_id'].apply(lambda x: get_wikidata_item(\"P486\", x))\n",
244 | "\n",
245 | " return entity_df"
246 | ],
247 | "execution_count": null,
248 | "outputs": []
249 | },
250 | {
251 | "cell_type": "code",
252 | "metadata": {
253 | "id": "Z1n61iHbU0X9"
254 | },
255 | "source": [
256 | "#Wrapper function for EuroPMC\n",
257 | "def get_pmcid_annotations(pmcid):\n",
258 | " text = get_pmc_meta(pmcid)\n",
259 | " doc = nlp(text)\n",
260 | " data = get_wdt_items_from_mesh_entities(doc)\n",
261 | " return data\n"
262 | ],
263 | "execution_count": null,
264 | "outputs": []
265 | },
266 | {
267 | "cell_type": "markdown",
268 | "metadata": {
269 | "id": "yrZ4EdWuoCq3"
270 | },
271 | "source": [
272 | "### Testing\n"
273 | ]
274 | },
275 | {
276 | "cell_type": "code",
277 | "metadata": {
278 | "id": "m_COlEVJsCA2",
279 | "outputId": "e6839595-2d70-4d21-e636-a6562cc96583",
280 | "colab": {
281 | "base_uri": "https://localhost:8080/",
282 | "height": 419
283 | }
284 | },
285 | "source": [
286 | "get_pmcid_annotations(\"PMC7448226\")"
287 | ],
288 | "execution_count": null,
289 | "outputs": [
290 | {
291 | "output_type": "execute_result",
292 | "data": {
293 | "text/html": [
294 | "\n",
295 | "\n",
308 | "
\n",
309 | " \n",
310 | " \n",
311 | " | \n",
312 | " label | \n",
313 | " start_pos | \n",
314 | " end_pos | \n",
315 | " mesh_id | \n",
316 | " meshid_match_score | \n",
317 | " arbitary_wdata_id | \n",
318 | " wdata_id | \n",
319 | "
\n",
320 | " \n",
321 | " \n",
322 | " \n",
323 | " | 0 | \n",
324 | " Exosomes | \n",
325 | " 12 | \n",
326 | " 20 | \n",
327 | " D055354 | \n",
328 | " 0.721988 | \n",
329 | " Q903634 | \n",
330 | " Q903634 | \n",
331 | "
\n",
332 | " \n",
333 | " | 1 | \n",
334 | " membranous vesicles | \n",
335 | " 42 | \n",
336 | " 61 | \n",
337 | " None | \n",
338 | " NA | \n",
339 | " None | \n",
340 | " None | \n",
341 | "
\n",
342 | " \n",
343 | " | 2 | \n",
344 | " RNA | \n",
345 | " 69 | \n",
346 | " 72 | \n",
347 | " D012313 | \n",
348 | " 0.760737 | \n",
349 | " Q11053 | \n",
350 | " Q11053 | \n",
351 | "
\n",
352 | " \n",
353 | " | 3 | \n",
354 | " content | \n",
355 | " 73 | \n",
356 | " 80 | \n",
357 | " None | \n",
358 | " NA | \n",
359 | " Q1260632 | \n",
360 | " None | \n",
361 | "
\n",
362 | " \n",
363 | " | 4 | \n",
364 | " exosomes | \n",
365 | " 99 | \n",
366 | " 107 | \n",
367 | " D055354 | \n",
368 | " 0.721988 | \n",
369 | " Q903634 | \n",
370 | " Q903634 | \n",
371 | "
\n",
372 | " \n",
373 | " | ... | \n",
374 | " ... | \n",
375 | " ... | \n",
376 | " ... | \n",
377 | " ... | \n",
378 | " ... | \n",
379 | " ... | \n",
380 | " ... | \n",
381 | "
\n",
382 | " \n",
383 | " | 84 | \n",
384 | " bioindicator | \n",
385 | " 1910 | \n",
386 | " 1922 | \n",
387 | " D000074062 | \n",
388 | " 0.790585 | \n",
389 | " Q864438 | \n",
390 | " None | \n",
391 | "
\n",
392 | " \n",
393 | " | 85 | \n",
394 | " diagnosis | \n",
395 | " 1931 | \n",
396 | " 1940 | \n",
397 | " D003933 | \n",
398 | " 0.87343 | \n",
399 | " Q177719 | \n",
400 | " Q16644043 | \n",
401 | "
\n",
402 | " \n",
403 | " | 86 | \n",
404 | " prognosis | \n",
405 | " 1945 | \n",
406 | " 1954 | \n",
407 | " None | \n",
408 | " NA | \n",
409 | " Q592442 | \n",
410 | " None | \n",
411 | "
\n",
412 | " \n",
413 | " | 87 | \n",
414 | " solid tumors | \n",
415 | " 1958 | \n",
416 | " 1970 | \n",
417 | " None | \n",
418 | " NA | \n",
419 | " None | \n",
420 | " None | \n",
421 | "
\n",
422 | " \n",
423 | " | 88 | \n",
424 | " INPLASY Registration Number | \n",
425 | " 1972 | \n",
426 | " 1999 | \n",
427 | " None | \n",
428 | " NA | \n",
429 | " None | \n",
430 | " None | \n",
431 | "
\n",
432 | " \n",
433 | "
\n",
434 | "
89 rows × 7 columns
\n",
435 | "
"
436 | ],
437 | "text/plain": [
438 | " label start_pos ... arbitary_wdata_id wdata_id\n",
439 | "0 Exosomes 12 ... Q903634 Q903634\n",
440 | "1 membranous vesicles 42 ... None None\n",
441 | "2 RNA 69 ... Q11053 Q11053\n",
442 | "3 content 73 ... Q1260632 None\n",
443 | "4 exosomes 99 ... Q903634 Q903634\n",
444 | ".. ... ... ... ... ...\n",
445 | "84 bioindicator 1910 ... Q864438 None\n",
446 | "85 diagnosis 1931 ... Q177719 Q16644043\n",
447 | "86 prognosis 1945 ... Q592442 None\n",
448 | "87 solid tumors 1958 ... None None\n",
449 | "88 INPLASY Registration Number 1972 ... None None\n",
450 | "\n",
451 | "[89 rows x 7 columns]"
452 | ]
453 | },
454 | "metadata": {
455 | "tags": []
456 | },
457 | "execution_count": 26
458 | }
459 | ]
460 | }
461 | ]
462 | }
--------------------------------------------------------------------------------
/hypothesis_parsing/parsing_annotations.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 15,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": []
9 | },
10 | {
11 | "cell_type": "code",
12 | "execution_count": 16,
13 | "metadata": {},
14 | "outputs": [
15 | {
16 | "name": "stdout",
17 | "output_type": "stream",
18 | "text": [
19 | "offset: 200\n",
20 | "offset: 400\n",
21 | "offset: 600\n",
22 | "offset: 800\n",
23 | "offset: 1000\n",
24 | "offset: 1200\n",
25 | "offset: 1400\n",
26 | "offset: 1600\n",
27 | "offset: 1800\n",
28 | "offset: 2000\n",
29 | "offset: 2200\n"
30 | ]
31 | }
32 | ],
33 | "source": []
34 | },
35 | {
36 | "cell_type": "code",
37 | "execution_count": 62,
38 | "metadata": {},
39 | "outputs": [],
40 | "source": [
41 | "wikidata_ids = df[\"text\"]\n",
42 | "\n",
43 | "wikidata_ids = wikidata_ids[[\"entity/Q\" in value for value in wikidata_ids]]\n",
44 | "wikidata_ids = [value.replace(\"\\n\", \"\") for value in wikidata_ids]\n"
45 | ]
46 | },
47 | {
48 | "cell_type": "code",
49 | "execution_count": 63,
50 | "metadata": {},
51 | "outputs": [
52 | {
53 | "data": {
54 | "text/plain": [
55 | "1132"
56 | ]
57 | },
58 | "execution_count": 63,
59 | "metadata": {},
60 | "output_type": "execute_result"
61 | }
62 | ],
63 | "source": [
64 | "len(set(wikidata_ids))"
65 | ]
66 | },
67 | {
68 | "cell_type": "code",
69 | "execution_count": 64,
70 | "metadata": {},
71 | "outputs": [],
72 | "source": []
73 | },
74 | {
75 | "cell_type": "code",
76 | "execution_count": 25,
77 | "metadata": {},
78 | "outputs": [
79 | {
80 | "data": {
81 | "text/plain": [
82 | ""
83 | ]
84 | },
85 | "execution_count": 25,
86 | "metadata": {},
87 | "output_type": "execute_result"
88 | }
89 | ],
90 | "source": [
91 | "qid_values_list"
92 | ]
93 | },
94 | {
95 | "cell_type": "code",
96 | "execution_count": 68,
97 | "metadata": {},
98 | "outputs": [
99 | {
100 | "data": {
101 | "text/plain": [
102 | "332"
103 | ]
104 | },
105 | "execution_count": 68,
106 | "metadata": {},
107 | "output_type": "execute_result"
108 | }
109 | ],
110 | "source": [
111 | "len(qid_values)"
112 | ]
113 | },
114 | {
115 | "cell_type": "code",
116 | "execution_count": 76,
117 | "metadata": {},
118 | "outputs": [
119 | {
120 | "name": "stdout",
121 | "output_type": "stream",
122 | "text": [
123 | "457\n",
124 | "905\n",
125 | "1288\n"
126 | ]
127 | }
128 | ],
129 | "source": [
130 | "\n",
131 | "qid_values = [re.sub(\".*Q\",\"wd:Q\", qid) for qid in wikidata_unique_ids]\n",
132 | "\n",
133 | " \n",
134 | "qid_values_list = get_chunks(qid_values, 400)\n",
135 | "\n",
136 | "\n",
137 | "list_of = []\n",
138 | "i = 0\n",
139 | "for qid_values in qid_values_list:\n",
140 | " i+=1\n",
141 | " query = \"\"\"\n",
142 | "\n",
143 | " SELECT ?item ?itemLabel ?superclass ?superclassLabel ?type ?typeLabel\n",
144 | " WHERE{\n",
145 | " VALUES ?item {\"\"\" + \" \".join(qid_values) +\"\"\"}\n",
146 | " OPTIONAL{?item wdt:P31 ?type.}\n",
147 | " SERVICE wikibase:label { bd:serviceParam wikibase:language \"[AUTO_LANGUAGE],en\". }\n",
148 | "\n",
149 | " }\n",
150 | " \"\"\"\n",
151 | " if i == 1:\n",
152 | " expanded_qid_type_table = wikidata2df.wikidata2df(query)\n",
153 | " else:\n",
154 | " result_now = wikidata2df.wikidata2df(query)\n",
155 | " expanded_qid_type_table = expanded_qid_type_table.append(result_now)\n",
156 | " \n",
157 | " print(len(expanded_qid_type_table))"
158 | ]
159 | },
160 | {
161 | "cell_type": "code",
162 | "execution_count": 78,
163 | "metadata": {},
164 | "outputs": [],
165 | "source": [
166 | "expanded_qid_type_table[\"article_url\"] = \"https://europepmc.org/article/MED/29206104\" "
167 | ]
168 | },
169 | {
170 | "cell_type": "code",
171 | "execution_count": 79,
172 | "metadata": {},
173 | "outputs": [
174 | {
175 | "data": {
176 | "text/html": [
177 | "\n",
178 | "\n",
191 | "
\n",
192 | " \n",
193 | " \n",
194 | " | \n",
195 | " item | \n",
196 | " typeLabel | \n",
197 | " type | \n",
198 | " itemLabel | \n",
199 | " article_url | \n",
200 | "
\n",
201 | " \n",
202 | " \n",
203 | " \n",
204 | " | 0 | \n",
205 | " Q3 | \n",
206 | " property | \n",
207 | " Q937228 | \n",
208 | " life | \n",
209 | " https://europepmc.org/article/MED/29206104 | \n",
210 | "
\n",
211 | " \n",
212 | " | 1 | \n",
213 | " Q4 | \n",
214 | " biological process | \n",
215 | " Q2996394 | \n",
216 | " death | \n",
217 | " https://europepmc.org/article/MED/29206104 | \n",
218 | "
\n",
219 | " \n",
220 | " | 2 | \n",
221 | " Q60 | \n",
222 | " city | \n",
223 | " Q515 | \n",
224 | " New York City | \n",
225 | " https://europepmc.org/article/MED/29206104 | \n",
226 | "
\n",
227 | " \n",
228 | " | 3 | \n",
229 | " Q60 | \n",
230 | " global city | \n",
231 | " Q208511 | \n",
232 | " New York City | \n",
233 | " https://europepmc.org/article/MED/29206104 | \n",
234 | "
\n",
235 | " \n",
236 | " | 4 | \n",
237 | " Q60 | \n",
238 | " city of the United States | \n",
239 | " Q1093829 | \n",
240 | " New York City | \n",
241 | " https://europepmc.org/article/MED/29206104 | \n",
242 | "
\n",
243 | " \n",
244 | " | ... | \n",
245 | " ... | \n",
246 | " ... | \n",
247 | " ... | \n",
248 | " ... | \n",
249 | " ... | \n",
250 | "
\n",
251 | " \n",
252 | " | 378 | \n",
253 | " Q106439843 | \n",
254 | " None | \n",
255 | " None | \n",
256 | " adult tissue | \n",
257 | " https://europepmc.org/article/MED/29206104 | \n",
258 | "
\n",
259 | " \n",
260 | " | 379 | \n",
261 | " Q106466573 | \n",
262 | " None | \n",
263 | " None | \n",
264 | " automated DNA sequencing machine | \n",
265 | " https://europepmc.org/article/MED/29206104 | \n",
266 | "
\n",
267 | " \n",
268 | " | 380 | \n",
269 | " Q106466587 | \n",
270 | " None | \n",
271 | " None | \n",
272 | " large-insert DNA cloning | \n",
273 | " https://europepmc.org/article/MED/29206104 | \n",
274 | "
\n",
275 | " \n",
276 | " | 381 | \n",
277 | " Q106501661 | \n",
278 | " None | \n",
279 | " None | \n",
280 | " intermediate milestone | \n",
281 | " https://europepmc.org/article/MED/29206104 | \n",
282 | "
\n",
283 | " \n",
284 | " | 382 | \n",
285 | " Q106501997 | \n",
286 | " None | \n",
287 | " None | \n",
288 | " biological organization | \n",
289 | " https://europepmc.org/article/MED/29206104 | \n",
290 | "
\n",
291 | " \n",
292 | "
\n",
293 | "
1288 rows × 5 columns
\n",
294 | "
"
295 | ],
296 | "text/plain": [
297 | " item typeLabel type \\\n",
298 | "0 Q3 property Q937228 \n",
299 | "1 Q4 biological process Q2996394 \n",
300 | "2 Q60 city Q515 \n",
301 | "3 Q60 global city Q208511 \n",
302 | "4 Q60 city of the United States Q1093829 \n",
303 | ".. ... ... ... \n",
304 | "378 Q106439843 None None \n",
305 | "379 Q106466573 None None \n",
306 | "380 Q106466587 None None \n",
307 | "381 Q106501661 None None \n",
308 | "382 Q106501997 None None \n",
309 | "\n",
310 | " itemLabel \\\n",
311 | "0 life \n",
312 | "1 death \n",
313 | "2 New York City \n",
314 | "3 New York City \n",
315 | "4 New York City \n",
316 | ".. ... \n",
317 | "378 adult tissue \n",
318 | "379 automated DNA sequencing machine \n",
319 | "380 large-insert DNA cloning \n",
320 | "381 intermediate milestone \n",
321 | "382 biological organization \n",
322 | "\n",
323 | " article_url \n",
324 | "0 https://europepmc.org/article/MED/29206104 \n",
325 | "1 https://europepmc.org/article/MED/29206104 \n",
326 | "2 https://europepmc.org/article/MED/29206104 \n",
327 | "3 https://europepmc.org/article/MED/29206104 \n",
328 | "4 https://europepmc.org/article/MED/29206104 \n",
329 | ".. ... \n",
330 | "378 https://europepmc.org/article/MED/29206104 \n",
331 | "379 https://europepmc.org/article/MED/29206104 \n",
332 | "380 https://europepmc.org/article/MED/29206104 \n",
333 | "381 https://europepmc.org/article/MED/29206104 \n",
334 | "382 https://europepmc.org/article/MED/29206104 \n",
335 | "\n",
336 | "[1288 rows x 5 columns]"
337 | ]
338 | },
339 | "execution_count": 79,
340 | "metadata": {},
341 | "output_type": "execute_result"
342 | }
343 | ],
344 | "source": [
345 | "expanded_qid_type_table"
346 | ]
347 | },
348 | {
349 | "cell_type": "code",
350 | "execution_count": 83,
351 | "metadata": {},
352 | "outputs": [
353 | {
354 | "name": "stdout",
355 | "output_type": "stream",
356 | "text": [
357 | "Defaulting to user installation because normal site-packages is not writeable\n",
358 | "Collecting google.colab\n",
359 | " Using cached google_colab-1.0.0-py2.py3-none-any.whl\n",
360 | "Collecting google-auth~=1.4.0\n",
361 | " Using cached google_auth-1.4.2-py2.py3-none-any.whl (64 kB)\n",
362 | "Collecting ipykernel~=4.6.0\n",
363 | " Using cached ipykernel-4.6.1-py3-none-any.whl (104 kB)\n",
364 | "Collecting pandas~=0.24.0\n",
365 | " Using cached pandas-0.24.2-cp36-cp36m-manylinux1_x86_64.whl (10.1 MB)\n",
366 | "Requirement already satisfied: tornado~=4.5.0 in /home/lubianat/.local/lib/python3.6/site-packages (from google.colab) (4.5.3)\n",
367 | "Collecting notebook~=5.2.0\n",
368 | " Using cached notebook-5.2.2-py2.py3-none-any.whl (8.0 MB)\n",
369 | "Collecting six~=1.12.0\n",
370 | " Using cached six-1.12.0-py2.py3-none-any.whl (10 kB)\n",
371 | "Collecting portpicker~=1.2.0\n",
372 | " Using cached portpicker-1.2.0-py3-none-any.whl\n",
373 | "Collecting requests~=2.21.0\n",
374 | " Using cached requests-2.21.0-py2.py3-none-any.whl (57 kB)\n",
375 | "Requirement already satisfied: ipython~=5.5.0 in /home/lubianat/.local/lib/python3.6/site-packages (from google.colab) (5.5.0)\n",
376 | "Requirement already satisfied: cachetools>=2.0.0 in /home/lubianat/.local/lib/python3.6/site-packages (from google-auth~=1.4.0->google.colab) (4.0.0)\n",
377 | "Requirement already satisfied: rsa>=3.1.4 in /home/lubianat/.local/lib/python3.6/site-packages (from google-auth~=1.4.0->google.colab) (4.0)\n",
378 | "Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/lubianat/.local/lib/python3.6/site-packages (from google-auth~=1.4.0->google.colab) (0.2.8)\n",
379 | "Requirement already satisfied: traitlets>=4.1.0 in /home/lubianat/.local/lib/python3.6/site-packages (from ipykernel~=4.6.0->google.colab) (4.3.3)\n",
380 | "Requirement already satisfied: jupyter-client in /home/lubianat/.local/lib/python3.6/site-packages (from ipykernel~=4.6.0->google.colab) (6.1.13)\n",
381 | "Requirement already satisfied: decorator in /home/lubianat/.local/lib/python3.6/site-packages (from ipython~=5.5.0->google.colab) (4.4.2)\n",
382 | "Requirement already satisfied: pickleshare in /home/lubianat/.local/lib/python3.6/site-packages (from ipython~=5.5.0->google.colab) (0.7.5)\n",
383 | "Requirement already satisfied: pygments in /home/lubianat/.local/lib/python3.6/site-packages (from ipython~=5.5.0->google.colab) (2.6.1)\n",
384 | "Collecting prompt-toolkit<2.0.0,>=1.0.4\n",
385 | " Using cached prompt_toolkit-1.0.18-py3-none-any.whl (245 kB)\n",
386 | "Requirement already satisfied: simplegeneric>0.8 in /usr/lib/python3/dist-packages (from ipython~=5.5.0->google.colab) (0.8.1)\n",
387 | "Requirement already satisfied: pexpect in /home/lubianat/.local/lib/python3.6/site-packages (from ipython~=5.5.0->google.colab) (4.8.0)\n",
388 | "Requirement already satisfied: setuptools>=18.5 in /home/lubianat/.local/lib/python3.6/site-packages (from ipython~=5.5.0->google.colab) (46.1.3)\n",
389 | "Requirement already satisfied: jupyter-core in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (4.6.3)\n",
390 | "Requirement already satisfied: nbconvert in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (6.0.7)\n",
391 | "Requirement already satisfied: nbformat in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (5.0.6)\n",
392 | "Requirement already satisfied: ipython-genutils in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (0.2.0)\n",
393 | "Requirement already satisfied: terminado>=0.3.3 in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (0.8.3)\n",
394 | "Requirement already satisfied: jinja2 in /home/lubianat/.local/lib/python3.6/site-packages (from notebook~=5.2.0->google.colab) (3.0.1)\n",
395 | "Requirement already satisfied: python-dateutil>=2.5.0 in /home/lubianat/.local/lib/python3.6/site-packages (from pandas~=0.24.0->google.colab) (2.8.1)\n",
396 | "Requirement already satisfied: pytz>=2011k in /home/lubianat/.local/lib/python3.6/site-packages (from pandas~=0.24.0->google.colab) (2021.1)\n",
397 | "Requirement already satisfied: numpy>=1.12.0 in /home/lubianat/.local/lib/python3.6/site-packages (from pandas~=0.24.0->google.colab) (1.19.5)\n",
398 | "Requirement already satisfied: wcwidth in /home/lubianat/.local/lib/python3.6/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython~=5.5.0->google.colab) (0.2.5)\n",
399 | "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/lubianat/.local/lib/python3.6/site-packages (from pyasn1-modules>=0.2.1->google-auth~=1.4.0->google.colab) (0.4.8)\n",
400 | "Collecting chardet<3.1.0,>=3.0.2\n",
401 | " Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)\n",
402 | "Requirement already satisfied: certifi>=2017.4.17 in /home/lubianat/.local/lib/python3.6/site-packages (from requests~=2.21.0->google.colab) (2020.12.5)\n",
403 | "Collecting urllib3<1.25,>=1.21.1\n",
404 | " Using cached urllib3-1.24.3-py2.py3-none-any.whl (118 kB)\n",
405 | "Collecting idna<2.9,>=2.5\n",
406 | " Using cached idna-2.8-py2.py3-none-any.whl (58 kB)\n",
407 | "Requirement already satisfied: ptyprocess in /home/lubianat/.local/lib/python3.6/site-packages (from terminado>=0.3.3->notebook~=5.2.0->google.colab) (0.6.0)\n",
408 | "Requirement already satisfied: MarkupSafe>=2.0 in /home/lubianat/.local/lib/python3.6/site-packages (from jinja2->notebook~=5.2.0->google.colab) (2.0.1)\n",
409 | "Requirement already satisfied: pyzmq>=13 in /home/lubianat/.local/lib/python3.6/site-packages (from jupyter-client->ipykernel~=4.6.0->google.colab) (19.0.0)\n",
410 | "Requirement already satisfied: nest-asyncio>=1.5 in /home/lubianat/.local/lib/python3.6/site-packages (from jupyter-client->ipykernel~=4.6.0->google.colab) (1.5.1)\n",
411 | "Requirement already satisfied: jupyterlab-pygments in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.1.2)\n",
412 | "Requirement already satisfied: pandocfilters>=1.4.1 in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (1.4.2)\n",
413 | "Requirement already satisfied: bleach in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (3.1.5)\n",
414 | "Requirement already satisfied: testpath in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.4.4)\n",
415 | "Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.5.3)\n",
416 | "Requirement already satisfied: entrypoints>=0.2.2 in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.3)\n",
417 | "Requirement already satisfied: defusedxml in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.6.0)\n",
418 | "Requirement already satisfied: mistune<2,>=0.8.1 in /home/lubianat/.local/lib/python3.6/site-packages (from nbconvert->notebook~=5.2.0->google.colab) (0.8.4)\n",
419 | "Requirement already satisfied: async-generator in /home/lubianat/.local/lib/python3.6/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook~=5.2.0->google.colab) (1.10)\n",
420 | "Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /home/lubianat/.local/lib/python3.6/site-packages (from nbformat->notebook~=5.2.0->google.colab) (3.2.0)\n",
421 | "Requirement already satisfied: attrs>=17.4.0 in /home/lubianat/.local/lib/python3.6/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook~=5.2.0->google.colab) (19.3.0)\n",
422 | "Requirement already satisfied: pyrsistent>=0.14.0 in /home/lubianat/.local/lib/python3.6/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook~=5.2.0->google.colab) (0.16.0)\n",
423 | "Requirement already satisfied: importlib-metadata in /home/lubianat/.local/lib/python3.6/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook~=5.2.0->google.colab) (1.5.0)\n",
424 | "Requirement already satisfied: webencodings in /home/lubianat/.local/lib/python3.6/site-packages (from bleach->nbconvert->notebook~=5.2.0->google.colab) (0.5.1)\n",
425 | "Requirement already satisfied: packaging in /home/lubianat/.local/lib/python3.6/site-packages (from bleach->nbconvert->notebook~=5.2.0->google.colab) (20.4)\n",
426 | "Requirement already satisfied: zipp>=0.5 in /home/lubianat/.local/lib/python3.6/site-packages (from importlib-metadata->jsonschema!=2.5.0,>=2.4->nbformat->notebook~=5.2.0->google.colab) (3.1.0)\n",
427 | "Requirement already satisfied: pyparsing>=2.0.2 in /home/lubianat/.local/lib/python3.6/site-packages (from packaging->bleach->nbconvert->notebook~=5.2.0->google.colab) (2.4.7)\n",
428 | "Installing collected packages: six, prompt-toolkit, urllib3, ipykernel, idna, chardet, requests, portpicker, pandas, notebook, google-auth, google.colab\n",
429 | " Attempting uninstall: six\n",
430 | " Found existing installation: six 1.14.0\n",
431 | " Uninstalling six-1.14.0:\n",
432 | " Successfully uninstalled six-1.14.0\n",
433 | " Attempting uninstall: prompt-toolkit\n",
434 | " Found existing installation: prompt-toolkit 3.0.4\n",
435 | " Uninstalling prompt-toolkit-3.0.4:\n",
436 | " Successfully uninstalled prompt-toolkit-3.0.4\n",
437 | " Attempting uninstall: urllib3\n",
438 | " Found existing installation: urllib3 1.25.8\n",
439 | " Uninstalling urllib3-1.25.8:\n",
440 | " Successfully uninstalled urllib3-1.25.8\n",
441 | " Attempting uninstall: ipykernel\n",
442 | " Found existing installation: ipykernel 5.1.4\n",
443 | " Uninstalling ipykernel-5.1.4:\n",
444 | " Successfully uninstalled ipykernel-5.1.4\n",
445 | " Attempting uninstall: idna\n",
446 | " Found existing installation: idna 2.9\n",
447 | " Uninstalling idna-2.9:\n",
448 | " Successfully uninstalled idna-2.9\n",
449 | " Attempting uninstall: chardet\n",
450 | " Found existing installation: chardet 4.0.0\n",
451 | " Uninstalling chardet-4.0.0:\n",
452 | " Successfully uninstalled chardet-4.0.0\n",
453 | " Attempting uninstall: requests\n",
454 | " Found existing installation: requests 2.25.1\n",
455 | " Uninstalling requests-2.25.1:\n",
456 | " Successfully uninstalled requests-2.25.1\n",
457 | " Attempting uninstall: portpicker\n",
458 | " Found existing installation: portpicker 1.3.1\n",
459 | " Uninstalling portpicker-1.3.1:\n",
460 | " Successfully uninstalled portpicker-1.3.1\n",
461 | " Attempting uninstall: pandas\n",
462 | " Found existing installation: pandas 1.1.5\n",
463 | " Uninstalling pandas-1.1.5:\n",
464 | " Successfully uninstalled pandas-1.1.5\n",
465 | " Attempting uninstall: notebook\n",
466 | " Found existing installation: notebook 6.0.3\n",
467 | " Uninstalling notebook-6.0.3:\n",
468 | " Successfully uninstalled notebook-6.0.3\n",
469 | " Attempting uninstall: google-auth\n",
470 | " Found existing installation: google-auth 1.21.1\n",
471 | " Uninstalling google-auth-1.21.1:\n",
472 | " Successfully uninstalled google-auth-1.21.1\n",
473 | "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
474 | "tox 3.14.0 requires importlib-metadata<1,>=0.12; python_version < \"3.8\", but you have importlib-metadata 1.5.0 which is incompatible.\n",
475 | "tabula-py 2.1.0 requires pandas>=0.25.3, but you have pandas 0.24.2 which is incompatible.\n",
476 | "pydrive2 1.6.1 requires six>=1.13.0, but you have six 1.12.0 which is incompatible.\n",
477 | "plotnine 0.7.0 requires pandas>=1.0.3, but you have pandas 0.24.2 which is incompatible.\n",
478 | "ontobio 1.17.2 requires click==7.0, but you have click 7.1.2 which is incompatible.\n",
479 | "ontobio 1.17.2 requires networkx==2.2, but you have networkx 2.4 which is incompatible.\n",
480 | "mordecai 2.0.3 requires spacy<2.1.0,>=2.0.3, but you have spacy 2.3.2 which is incompatible.\n",
481 | "mizani 0.7.1 requires pandas>=1.0.0, but you have pandas 0.24.2 which is incompatible.\n",
482 | "jupyterlab 3.0.12 requires tornado>=6.1.0, but you have tornado 4.5.3 which is incompatible.\n",
483 | "jupyterhub 1.3.0 requires tornado>=5.1, but you have tornado 4.5.3 which is incompatible.\n",
484 | "jupyter-server 1.5.1 requires tornado>=6.1.0, but you have tornado 4.5.3 which is incompatible.\n",
485 | "jupyter-console 6.1.0 requires prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0, but you have prompt-toolkit 1.0.18 which is incompatible.\n",
486 | "google-cloud-storage 1.26.0 requires google-auth<2.0dev,>=1.11.0, but you have google-auth 1.4.2 which is incompatible.\n",
487 | "google-api-python-client 2.0.2 requires google-auth<2dev,>=1.16.0, but you have google-auth 1.4.2 which is incompatible.\n",
488 | "google-api-python-client 2.0.2 requires six<2dev,>=1.13.0, but you have six 1.12.0 which is incompatible.\n",
489 | "google-api-core 1.22.2 requires google-auth<2.0dev,>=1.21.1, but you have google-auth 1.4.2 which is incompatible.\n",
490 | "gooey 1.0.7 requires pygtrie>=2.3.3, but you have pygtrie 2.3.2 which is incompatible.\n",
491 | "dvc 1.11.16 requires requests>=2.22.0, but you have requests 2.21.0 which is incompatible.\n",
492 | "cookiecutter 1.7.2 requires Jinja2<3.0.0, but you have jinja2 3.0.1 which is incompatible.\n",
493 | "cookiecutter 1.7.2 requires MarkupSafe<2.0.0, but you have markupsafe 2.0.1 which is incompatible.\n",
494 | "cookiecutter 1.7.2 requires requests>=2.23.0, but you have requests 2.21.0 which is incompatible.\n",
495 | "botocore 1.15.31 requires docutils<0.16,>=0.10, but you have docutils 0.16 which is incompatible.\n",
496 | "anndata 0.7.4 requires pandas>=1.0, but you have pandas 0.24.2 which is incompatible.\u001b[0m\n",
497 | "Successfully installed chardet-3.0.4 google-auth-1.4.2 google.colab idna-2.8 ipykernel-4.6.1 notebook-5.2.2 pandas-1.0.3 portpicker-1.2.0 prompt-toolkit-1.0.18 requests-2.23.0 six-1.12.0 urllib3-1.24.3\n",
498 | "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.\n",
499 | "You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.\u001b[0m\n"
500 | ]
501 | },
502 | {
503 | "name": "stderr",
504 | "output_type": "stream",
505 | "text": [
506 | "/home/lubianat/.local/lib/python3.6/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.\n",
507 | " warn(\"IPython.utils.traitlets has moved to a top-level traitlets package.\")\n"
508 | ]
509 | },
510 | {
511 | "data": {},
512 | "metadata": {
513 | "outputarea": {
514 | "add_tags": [
515 | "8a99adf8-8786-4ee0-956c-5aba8987cae0"
516 | ],
517 | "nodisplay": true,
518 | "remove_tags": []
519 | }
520 | },
521 | "output_type": "display_data"
522 | },
523 | {
524 | "data": {},
525 | "metadata": {
526 | "outputarea": {
527 | "add_tags": [],
528 | "nodisplay": true,
529 | "remove_tags": [
530 | "8a99adf8-8786-4ee0-956c-5aba8987cae0"
531 | ]
532 | }
533 | },
534 | "output_type": "display_data"
535 | },
536 | {
537 | "ename": "FileNotFoundError",
538 | "evalue": "[Errno 2] No such file or directory: 'gcloud': 'gcloud'",
539 | "output_type": "error",
540 | "traceback": [
541 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
542 | "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
543 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mget_ipython\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msystem\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'pip3 install google.colab'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mgoogle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolab\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mauth\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mauth\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mauthenticate_user\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mgspread\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
544 | "\u001b[0;32m~/.local/lib/python3.6/site-packages/google/colab/auth.py\u001b[0m in \u001b[0;36mauthenticate_user\u001b[0;34m(clear_output)\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[0mcontext_manager\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_output\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtemporary\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mclear_output\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0m_noop\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 146\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mcontext_manager\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 147\u001b[0;31m \u001b[0m_gcloud_login\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 148\u001b[0m \u001b[0m_install_adc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[0mcolab_tpu_addr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0menviron\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'COLAB_TPU_ADDR'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m''\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
545 | "\u001b[0;32m~/.local/lib/python3.6/site-packages/google/colab/auth.py\u001b[0m in \u001b[0;36m_gcloud_login\u001b[0;34m()\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0mstdout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0mstderr\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0m_subprocess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSTDOUT\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 79\u001b[0;31m universal_newlines=True)\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
546 | "\u001b[0;32m/usr/lib/python3.6/subprocess.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)\u001b[0m\n\u001b[1;32m 727\u001b[0m \u001b[0mc2pread\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc2pwrite\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0merrread\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merrwrite\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 729\u001b[0;31m restore_signals, start_new_session)\n\u001b[0m\u001b[1;32m 730\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 731\u001b[0m \u001b[0;31m# Cleanup if the child failed starting.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
547 | "\u001b[0;32m/usr/lib/python3.6/subprocess.py\u001b[0m in \u001b[0;36m_execute_child\u001b[0;34m(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)\u001b[0m\n\u001b[1;32m 1362\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0merrno_num\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0merrno\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mENOENT\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1363\u001b[0m \u001b[0merr_msg\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;34m': '\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mrepr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merr_filename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1364\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mchild_exception_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merrno_num\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merr_msg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merr_filename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1365\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mchild_exception_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merr_msg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1366\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
548 | "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'gcloud': 'gcloud'"
549 | ]
550 | }
551 | ],
552 | "source": [
553 | "# The next steps envolves manual curation of the Wikidata items for each \n",
554 | "# person in Wikidata\n",
555 | "!pip3 install google.colab\n",
556 | "from google.colab import auth\n",
557 | "auth.authenticate_user()\n",
558 | "\n",
559 | "import gspread\n",
560 | "from oauth2client.client import GoogleCredentials\n",
561 | "\n",
562 | "gc = gspread.authorize(GoogleCredentials.get_application_default())"
563 | ]
564 | },
565 | {
566 | "cell_type": "code",
567 | "execution_count": null,
568 | "metadata": {},
569 | "outputs": [],
570 | "source": []
571 | }
572 | ],
573 | "metadata": {
574 | "kernelspec": {
575 | "display_name": "Python 3",
576 | "language": "python",
577 | "name": "python3"
578 | },
579 | "language_info": {
580 | "codemirror_mode": {
581 | "name": "ipython",
582 | "version": 3
583 | },
584 | "file_extension": ".py",
585 | "mimetype": "text/x-python",
586 | "name": "python",
587 | "nbconvert_exporter": "python",
588 | "pygments_lexer": "ipython3",
589 | "version": "3.6.9"
590 | }
591 | },
592 | "nbformat": 4,
593 | "nbformat_minor": 4
594 | }
595 |
--------------------------------------------------------------------------------
/hypothesis_parsing/.ipynb_checkpoints/parsing_annotations-checkpoint.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 15,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "import requests\n",
10 | "import pandas as pd\n",
11 | "import wikidata2df\n",
12 | "import time\n",
13 | "import re\n",
14 | "\n",
15 | "def get_chunks(lst, n):\n",
16 | " \"\"\"Yield successive n-sized chunks from lst.\"\"\"\n",
17 | " for i in range(0, len(lst), n):\n",
18 | " yield lst[i:i + n]"
19 | ]
20 | },
21 | {
22 | "cell_type": "code",
23 | "execution_count": 16,
24 | "metadata": {},
25 | "outputs": [
26 | {
27 | "name": "stdout",
28 | "output_type": "stream",
29 | "text": [
30 | "offset: 200\n",
31 | "offset: 400\n",
32 | "offset: 600\n",
33 | "offset: 800\n",
34 | "offset: 1000\n",
35 | "offset: 1200\n",
36 | "offset: 1400\n",
37 | "offset: 1600\n",
38 | "offset: 1800\n",
39 | "offset: 2000\n",
40 | "offset: 2200\n"
41 | ]
42 | }
43 | ],
44 | "source": [
45 | "offset = 0\n",
46 | "query_params = {\"url\":\"https://europepmc.org/article/MED/29206104\",\n",
47 | " \"offset\":str(offset),\n",
48 | " \"limit\":\"200\"}\n",
49 | "\n",
50 | "\n",
51 | "result = requests.get(\"https://api.hypothes.is/api/search\", params = query_params)\n",
52 | "\n",
53 | "df = pd.json_normalize(result.json()['rows'])\n",
54 | "\n",
55 | "df.head(4)\n",
56 | "df_now = df\n",
57 | "while len(df_now) == 200:\n",
58 | " time.sleep(1)\n",
59 | " offset += 200\n",
60 | " print(\"offset: \" + str(offset))\n",
61 | " query_params = {\"url\":\"https://europepmc.org/article/MED/29206104\",\n",
62 | " \"offset\":str(offset),\n",
63 | " \"limit\":\"200\"}\n",
64 | " result = requests.get(\"https://api.hypothes.is/api/search\", params = query_params)\n",
65 | " df_now = pd.json_normalize(result.json()['rows'])\n",
66 | " df = df.append(df_now)\n",
67 | " "
68 | ]
69 | },
70 | {
71 | "cell_type": "code",
72 | "execution_count": 62,
73 | "metadata": {},
74 | "outputs": [],
75 | "source": [
76 | "wikidata_ids = df[\"text\"]\n",
77 | "\n",
78 | "wikidata_ids = wikidata_ids[[\"entity/Q\" in value for value in wikidata_ids]]\n",
79 | "wikidata_ids = [value.replace(\"\\n\", \"\") for value in wikidata_ids]\n"
80 | ]
81 | },
82 | {
83 | "cell_type": "code",
84 | "execution_count": 63,
85 | "metadata": {},
86 | "outputs": [
87 | {
88 | "data": {
89 | "text/plain": [
90 | "1132"
91 | ]
92 | },
93 | "execution_count": 63,
94 | "metadata": {},
95 | "output_type": "execute_result"
96 | }
97 | ],
98 | "source": [
99 | "len(set(wikidata_ids))"
100 | ]
101 | },
102 | {
103 | "cell_type": "code",
104 | "execution_count": 64,
105 | "metadata": {},
106 | "outputs": [],
107 | "source": [
108 | "wikidata_unique_ids = list(set(wikidata_ids))\n",
109 | "qid_values = [re.sub(\".*Q\",\"wd:Q\", qid) for qid in wikidata_unique_ids]"
110 | ]
111 | },
112 | {
113 | "cell_type": "code",
114 | "execution_count": 25,
115 | "metadata": {},
116 | "outputs": [
117 | {
118 | "data": {
119 | "text/plain": [
120 | ""
121 | ]
122 | },
123 | "execution_count": 25,
124 | "metadata": {},
125 | "output_type": "execute_result"
126 | }
127 | ],
128 | "source": [
129 | "qid_values_list"
130 | ]
131 | },
132 | {
133 | "cell_type": "code",
134 | "execution_count": 68,
135 | "metadata": {},
136 | "outputs": [
137 | {
138 | "data": {
139 | "text/plain": [
140 | "332"
141 | ]
142 | },
143 | "execution_count": 68,
144 | "metadata": {},
145 | "output_type": "execute_result"
146 | }
147 | ],
148 | "source": [
149 | "len(qid_values)"
150 | ]
151 | },
152 | {
153 | "cell_type": "code",
154 | "execution_count": 66,
155 | "metadata": {},
156 | "outputs": [],
157 | "source": [
158 | "\n",
159 | "qid_values = [re.sub(\".*Q\",\"wd:Q\", qid) for qid in wikidata_unique_ids]\n",
160 | "\n",
161 | " \n",
162 | "qid_values_list = get_chunks(qid_values, 400)\n",
163 | "\n",
164 | "\n",
165 | "list_of = []\n",
166 | "i = 0\n",
167 | "for qid_values in qid_values_list:\n",
168 | " i+=1\n",
169 | " query = \"\"\"\n",
170 | "\n",
171 | " SELECT ?item ?itemLabel ?superclass ?superclassLabel ?type ?typeLabel\n",
172 | " WHERE{\n",
173 | " VALUES ?item {\"\"\" + \" \".join(qid_values) +\"\"\"}\n",
174 | " OPTIONAL{?item wdt:P31 ?type.}\n",
175 | " SERVICE wikibase:label { bd:serviceParam wikibase:language \"[AUTO_LANGUAGE],en\". }\n",
176 | "\n",
177 | " }\n",
178 | " \"\"\"\n",
179 | " if i == 1:\n",
180 | " expanded_qid_type_table = wikidata2df.wikidata2df(query)\n",
181 | " else:\n",
182 | " result_now = wikidata2df.wikidata2df(query)\n",
183 | " expanded_qid_type_table = expanded_qid_table.append(result_now)\n",
184 | " \n",
185 | " print(len(expanded_qid_type_table))"
186 | ]
187 | },
188 | {
189 | "cell_type": "code",
190 | "execution_count": 74,
191 | "metadata": {},
192 | "outputs": [
193 | {
194 | "data": {
195 | "text/plain": [
196 | ""
197 | ]
198 | },
199 | "execution_count": 74,
200 | "metadata": {},
201 | "output_type": "execute_result"
202 | }
203 | ],
204 | "source": [
205 | "qid_values_list"
206 | ]
207 | },
208 | {
209 | "cell_type": "code",
210 | "execution_count": 72,
211 | "metadata": {},
212 | "outputs": [],
213 | "source": [
214 | "wikidata_ids.sort()"
215 | ]
216 | },
217 | {
218 | "cell_type": "code",
219 | "execution_count": 73,
220 | "metadata": {},
221 | "outputs": [
222 | {
223 | "data": {
224 | "text/plain": [
225 | "['http://www.wikidata.org/entity/Q1003030',\n",
226 | " 'http://www.wikidata.org/entity/Q1003030',\n",
227 | " 'http://www.wikidata.org/entity/Q1003030',\n",
228 | " 'http://www.wikidata.org/entity/Q100762146',\n",
229 | " 'http://www.wikidata.org/entity/Q101068098',\n",
230 | " 'http://www.wikidata.org/entity/Q101068098',\n",
231 | " 'http://www.wikidata.org/entity/Q101068098',\n",
232 | " 'http://www.wikidata.org/entity/Q101068098',\n",
233 | " 'http://www.wikidata.org/entity/Q101068098',\n",
234 | " 'http://www.wikidata.org/entity/Q101068098',\n",
235 | " 'http://www.wikidata.org/entity/Q101072',\n",
236 | " 'http://www.wikidata.org/entity/Q10145',\n",
237 | " 'http://www.wikidata.org/entity/Q101813351',\n",
238 | " 'http://www.wikidata.org/entity/Q102539784',\n",
239 | " 'http://www.wikidata.org/entity/Q102539784',\n",
240 | " 'http://www.wikidata.org/entity/Q102539784',\n",
241 | " 'http://www.wikidata.org/entity/Q102539784',\n",
242 | " 'http://www.wikidata.org/entity/Q102539784',\n",
243 | " 'http://www.wikidata.org/entity/Q102539784',\n",
244 | " 'http://www.wikidata.org/entity/Q103191',\n",
245 | " 'http://www.wikidata.org/entity/Q103191',\n",
246 | " 'http://www.wikidata.org/entity/Q103424036',\n",
247 | " 'http://www.wikidata.org/entity/Q1034411',\n",
248 | " 'http://www.wikidata.org/entity/Q104053',\n",
249 | " 'http://www.wikidata.org/entity/Q104053',\n",
250 | " 'http://www.wikidata.org/entity/Q104416146',\n",
251 | " 'http://www.wikidata.org/entity/Q104450645',\n",
252 | " 'http://www.wikidata.org/entity/Q104450645',\n",
253 | " 'http://www.wikidata.org/entity/Q104450645',\n",
254 | " 'http://www.wikidata.org/entity/Q104450645',\n",
255 | " 'http://www.wikidata.org/entity/Q104450703',\n",
256 | " 'http://www.wikidata.org/entity/Q104450703',\n",
257 | " 'http://www.wikidata.org/entity/Q104450703',\n",
258 | " 'http://www.wikidata.org/entity/Q104450703',\n",
259 | " 'http://www.wikidata.org/entity/Q104450703',\n",
260 | " 'http://www.wikidata.org/entity/Q104450703',\n",
261 | " 'http://www.wikidata.org/entity/Q104450703',\n",
262 | " 'http://www.wikidata.org/entity/Q104450703',\n",
263 | " 'http://www.wikidata.org/entity/Q104450703',\n",
264 | " 'http://www.wikidata.org/entity/Q104450703',\n",
265 | " 'http://www.wikidata.org/entity/Q104450703',\n",
266 | " 'http://www.wikidata.org/entity/Q104450703',\n",
267 | " 'http://www.wikidata.org/entity/Q104450703',\n",
268 | " 'http://www.wikidata.org/entity/Q104450703',\n",
269 | " 'http://www.wikidata.org/entity/Q104450703',\n",
270 | " 'http://www.wikidata.org/entity/Q104450703',\n",
271 | " 'http://www.wikidata.org/entity/Q104450703',\n",
272 | " 'http://www.wikidata.org/entity/Q104476965',\n",
273 | " 'http://www.wikidata.org/entity/Q104477106',\n",
274 | " 'http://www.wikidata.org/entity/Q104477362',\n",
275 | " 'http://www.wikidata.org/entity/Q104477483',\n",
276 | " 'http://www.wikidata.org/entity/Q104477483',\n",
277 | " 'http://www.wikidata.org/entity/Q104493',\n",
278 | " 'http://www.wikidata.org/entity/Q104514053',\n",
279 | " 'http://www.wikidata.org/entity/Q104514053',\n",
280 | " 'http://www.wikidata.org/entity/Q104514053',\n",
281 | " 'http://www.wikidata.org/entity/Q104514053',\n",
282 | " 'http://www.wikidata.org/entity/Q104514053',\n",
283 | " 'http://www.wikidata.org/entity/Q104514053',\n",
284 | " 'http://www.wikidata.org/entity/Q104514053',\n",
285 | " 'http://www.wikidata.org/entity/Q104514053',\n",
286 | " 'http://www.wikidata.org/entity/Q104514053',\n",
287 | " 'http://www.wikidata.org/entity/Q104514053',\n",
288 | " 'http://www.wikidata.org/entity/Q104514053',\n",
289 | " 'http://www.wikidata.org/entity/Q104519408',\n",
290 | " 'http://www.wikidata.org/entity/Q104519408',\n",
291 | " 'http://www.wikidata.org/entity/Q104524156',\n",
292 | " 'http://www.wikidata.org/entity/Q104524156',\n",
293 | " 'http://www.wikidata.org/entity/Q104524156',\n",
294 | " 'http://www.wikidata.org/entity/Q104524156',\n",
295 | " 'http://www.wikidata.org/entity/Q104524156',\n",
296 | " 'http://www.wikidata.org/entity/Q104524156',\n",
297 | " 'http://www.wikidata.org/entity/Q104524156',\n",
298 | " 'http://www.wikidata.org/entity/Q104524156',\n",
299 | " 'http://www.wikidata.org/entity/Q104524156',\n",
300 | " 'http://www.wikidata.org/entity/Q104529381',\n",
301 | " 'http://www.wikidata.org/entity/Q104539563',\n",
302 | " 'http://www.wikidata.org/entity/Q104539563',\n",
303 | " 'http://www.wikidata.org/entity/Q104539563',\n",
304 | " 'http://www.wikidata.org/entity/Q104539563',\n",
305 | " 'http://www.wikidata.org/entity/Q104539563',\n",
306 | " 'http://www.wikidata.org/entity/Q104539563',\n",
307 | " 'http://www.wikidata.org/entity/Q104539563',\n",
308 | " 'http://www.wikidata.org/entity/Q104539563',\n",
309 | " 'http://www.wikidata.org/entity/Q104539563',\n",
310 | " 'http://www.wikidata.org/entity/Q104539563',\n",
311 | " 'http://www.wikidata.org/entity/Q104539563',\n",
312 | " 'http://www.wikidata.org/entity/Q104539563',\n",
313 | " 'http://www.wikidata.org/entity/Q104539569',\n",
314 | " 'http://www.wikidata.org/entity/Q104539573',\n",
315 | " 'http://www.wikidata.org/entity/Q104591448',\n",
316 | " 'http://www.wikidata.org/entity/Q104591448',\n",
317 | " 'http://www.wikidata.org/entity/Q104591448',\n",
318 | " 'http://www.wikidata.org/entity/Q104591448',\n",
319 | " 'http://www.wikidata.org/entity/Q104591448',\n",
320 | " 'http://www.wikidata.org/entity/Q104591448',\n",
321 | " 'http://www.wikidata.org/entity/Q104591448',\n",
322 | " 'http://www.wikidata.org/entity/Q104591448',\n",
323 | " 'http://www.wikidata.org/entity/Q104591448',\n",
324 | " 'http://www.wikidata.org/entity/Q104595152',\n",
325 | " 'http://www.wikidata.org/entity/Q104595152',\n",
326 | " 'http://www.wikidata.org/entity/Q104595152',\n",
327 | " 'http://www.wikidata.org/entity/Q104595152',\n",
328 | " 'http://www.wikidata.org/entity/Q104595152',\n",
329 | " 'http://www.wikidata.org/entity/Q104595152',\n",
330 | " 'http://www.wikidata.org/entity/Q104595152',\n",
331 | " 'http://www.wikidata.org/entity/Q104595152',\n",
332 | " 'http://www.wikidata.org/entity/Q104595152',\n",
333 | " 'http://www.wikidata.org/entity/Q104595231',\n",
334 | " 'http://www.wikidata.org/entity/Q104595271',\n",
335 | " 'http://www.wikidata.org/entity/Q104667117',\n",
336 | " 'http://www.wikidata.org/entity/Q104667117',\n",
337 | " 'http://www.wikidata.org/entity/Q104667117',\n",
338 | " 'http://www.wikidata.org/entity/Q104667117',\n",
339 | " 'http://www.wikidata.org/entity/Q1047113',\n",
340 | " 'http://www.wikidata.org/entity/Q104713710',\n",
341 | " 'http://www.wikidata.org/entity/Q104713710',\n",
342 | " 'http://www.wikidata.org/entity/Q104713710',\n",
343 | " 'http://www.wikidata.org/entity/Q104713710',\n",
344 | " 'http://www.wikidata.org/entity/Q104717214',\n",
345 | " 'http://www.wikidata.org/entity/Q104717214',\n",
346 | " 'http://www.wikidata.org/entity/Q104745744',\n",
347 | " 'http://www.wikidata.org/entity/Q104745744',\n",
348 | " 'http://www.wikidata.org/entity/Q104767501',\n",
349 | " 'http://www.wikidata.org/entity/Q104772003',\n",
350 | " 'http://www.wikidata.org/entity/Q104772003',\n",
351 | " 'http://www.wikidata.org/entity/Q104772003',\n",
352 | " 'http://www.wikidata.org/entity/Q104819290',\n",
353 | " 'http://www.wikidata.org/entity/Q104819290',\n",
354 | " 'http://www.wikidata.org/entity/Q104819407',\n",
355 | " 'http://www.wikidata.org/entity/Q104819407',\n",
356 | " 'http://www.wikidata.org/entity/Q104819407',\n",
357 | " 'http://www.wikidata.org/entity/Q104819423',\n",
358 | " 'http://www.wikidata.org/entity/Q104819426',\n",
359 | " 'http://www.wikidata.org/entity/Q104819426',\n",
360 | " 'http://www.wikidata.org/entity/Q104852675',\n",
361 | " 'http://www.wikidata.org/entity/Q104878258',\n",
362 | " 'http://www.wikidata.org/entity/Q104878258',\n",
363 | " 'http://www.wikidata.org/entity/Q104907516',\n",
364 | " 'http://www.wikidata.org/entity/Q104925563',\n",
365 | " 'http://www.wikidata.org/entity/Q104925870',\n",
366 | " 'http://www.wikidata.org/entity/Q105047826',\n",
367 | " 'http://www.wikidata.org/entity/Q105047828',\n",
368 | " 'http://www.wikidata.org/entity/Q105047832',\n",
369 | " 'http://www.wikidata.org/entity/Q105081244',\n",
370 | " 'http://www.wikidata.org/entity/Q105100083',\n",
371 | " 'http://www.wikidata.org/entity/Q105106879',\n",
372 | " 'http://www.wikidata.org/entity/Q105196',\n",
373 | " 'http://www.wikidata.org/entity/Q105198208',\n",
374 | " 'http://www.wikidata.org/entity/Q105376582',\n",
375 | " 'http://www.wikidata.org/entity/Q105376582',\n",
376 | " 'http://www.wikidata.org/entity/Q105376582',\n",
377 | " 'http://www.wikidata.org/entity/Q105376582',\n",
378 | " 'http://www.wikidata.org/entity/Q105376582',\n",
379 | " 'http://www.wikidata.org/entity/Q105376582',\n",
380 | " 'http://www.wikidata.org/entity/Q105393870',\n",
381 | " 'http://www.wikidata.org/entity/Q105393870',\n",
382 | " 'http://www.wikidata.org/entity/Q105393908',\n",
383 | " 'http://www.wikidata.org/entity/Q105393918',\n",
384 | " 'http://www.wikidata.org/entity/Q105393948',\n",
385 | " 'http://www.wikidata.org/entity/Q105394060',\n",
386 | " 'http://www.wikidata.org/entity/Q105394060',\n",
387 | " 'http://www.wikidata.org/entity/Q105406038',\n",
388 | " 'http://www.wikidata.org/entity/Q105406038',\n",
389 | " 'http://www.wikidata.org/entity/Q105426851',\n",
390 | " 'http://www.wikidata.org/entity/Q105426864',\n",
391 | " 'http://www.wikidata.org/entity/Q105426874',\n",
392 | " 'http://www.wikidata.org/entity/Q105426874',\n",
393 | " 'http://www.wikidata.org/entity/Q105426874',\n",
394 | " 'http://www.wikidata.org/entity/Q105426874',\n",
395 | " 'http://www.wikidata.org/entity/Q105426911',\n",
396 | " 'http://www.wikidata.org/entity/Q105426911',\n",
397 | " 'http://www.wikidata.org/entity/Q105426942',\n",
398 | " 'http://www.wikidata.org/entity/Q105426942',\n",
399 | " 'http://www.wikidata.org/entity/Q105426942',\n",
400 | " 'http://www.wikidata.org/entity/Q105426946',\n",
401 | " 'http://www.wikidata.org/entity/Q105426946',\n",
402 | " 'http://www.wikidata.org/entity/Q105426946',\n",
403 | " 'http://www.wikidata.org/entity/Q105426956',\n",
404 | " 'http://www.wikidata.org/entity/Q105445664',\n",
405 | " 'http://www.wikidata.org/entity/Q105445694',\n",
406 | " 'http://www.wikidata.org/entity/Q105445744',\n",
407 | " 'http://www.wikidata.org/entity/Q105445761',\n",
408 | " 'http://www.wikidata.org/entity/Q105459661',\n",
409 | " 'http://www.wikidata.org/entity/Q105459664',\n",
410 | " 'http://www.wikidata.org/entity/Q105459971',\n",
411 | " 'http://www.wikidata.org/entity/Q105459971',\n",
412 | " 'http://www.wikidata.org/entity/Q105459971',\n",
413 | " 'http://www.wikidata.org/entity/Q105460056',\n",
414 | " 'http://www.wikidata.org/entity/Q105460056',\n",
415 | " 'http://www.wikidata.org/entity/Q105460363',\n",
416 | " 'http://www.wikidata.org/entity/Q105494979',\n",
417 | " 'http://www.wikidata.org/entity/Q105494994',\n",
418 | " 'http://www.wikidata.org/entity/Q105495043',\n",
419 | " 'http://www.wikidata.org/entity/Q105495234',\n",
420 | " 'http://www.wikidata.org/entity/Q105495272',\n",
421 | " 'http://www.wikidata.org/entity/Q105495413',\n",
422 | " 'http://www.wikidata.org/entity/Q105495440',\n",
423 | " 'http://www.wikidata.org/entity/Q105495461',\n",
424 | " 'http://www.wikidata.org/entity/Q105495483',\n",
425 | " 'http://www.wikidata.org/entity/Q105495534',\n",
426 | " 'http://www.wikidata.org/entity/Q105495561',\n",
427 | " 'http://www.wikidata.org/entity/Q105495578',\n",
428 | " 'http://www.wikidata.org/entity/Q105495583',\n",
429 | " 'http://www.wikidata.org/entity/Q105495583',\n",
430 | " 'http://www.wikidata.org/entity/Q105495598',\n",
431 | " 'http://www.wikidata.org/entity/Q105495598',\n",
432 | " 'http://www.wikidata.org/entity/Q105495598',\n",
433 | " 'http://www.wikidata.org/entity/Q105495613',\n",
434 | " 'http://www.wikidata.org/entity/Q105495613',\n",
435 | " 'http://www.wikidata.org/entity/Q105495647',\n",
436 | " 'http://www.wikidata.org/entity/Q105495656',\n",
437 | " 'http://www.wikidata.org/entity/Q105495662',\n",
438 | " 'http://www.wikidata.org/entity/Q105517034',\n",
439 | " 'http://www.wikidata.org/entity/Q105517113',\n",
440 | " 'http://www.wikidata.org/entity/Q105517214',\n",
441 | " 'http://www.wikidata.org/entity/Q105517238',\n",
442 | " 'http://www.wikidata.org/entity/Q105517238',\n",
443 | " 'http://www.wikidata.org/entity/Q105517300',\n",
444 | " 'http://www.wikidata.org/entity/Q105517373',\n",
445 | " 'http://www.wikidata.org/entity/Q105517421',\n",
446 | " 'http://www.wikidata.org/entity/Q105517421',\n",
447 | " 'http://www.wikidata.org/entity/Q105517602',\n",
448 | " 'http://www.wikidata.org/entity/Q105517636',\n",
449 | " 'http://www.wikidata.org/entity/Q105517636',\n",
450 | " 'http://www.wikidata.org/entity/Q105517636',\n",
451 | " 'http://www.wikidata.org/entity/Q105517660',\n",
452 | " 'http://www.wikidata.org/entity/Q105517743',\n",
453 | " 'http://www.wikidata.org/entity/Q105517947',\n",
454 | " 'http://www.wikidata.org/entity/Q105517985',\n",
455 | " 'http://www.wikidata.org/entity/Q105518021',\n",
456 | " 'http://www.wikidata.org/entity/Q105518050',\n",
457 | " 'http://www.wikidata.org/entity/Q105518050',\n",
458 | " 'http://www.wikidata.org/entity/Q105530525',\n",
459 | " 'http://www.wikidata.org/entity/Q105530525',\n",
460 | " 'http://www.wikidata.org/entity/Q105530577',\n",
461 | " 'http://www.wikidata.org/entity/Q105530602',\n",
462 | " 'http://www.wikidata.org/entity/Q105530602',\n",
463 | " 'http://www.wikidata.org/entity/Q105530602',\n",
464 | " 'http://www.wikidata.org/entity/Q105530602',\n",
465 | " 'http://www.wikidata.org/entity/Q105530684',\n",
466 | " 'http://www.wikidata.org/entity/Q105530735',\n",
467 | " 'http://www.wikidata.org/entity/Q105530752',\n",
468 | " 'http://www.wikidata.org/entity/Q105530794',\n",
469 | " 'http://www.wikidata.org/entity/Q105530813',\n",
470 | " 'http://www.wikidata.org/entity/Q105530820',\n",
471 | " 'http://www.wikidata.org/entity/Q105530836',\n",
472 | " 'http://www.wikidata.org/entity/Q105546851',\n",
473 | " 'http://www.wikidata.org/entity/Q105546909',\n",
474 | " 'http://www.wikidata.org/entity/Q105546992',\n",
475 | " 'http://www.wikidata.org/entity/Q105546992',\n",
476 | " 'http://www.wikidata.org/entity/Q105547061',\n",
477 | " 'http://www.wikidata.org/entity/Q105547529',\n",
478 | " 'http://www.wikidata.org/entity/Q105547536',\n",
479 | " 'http://www.wikidata.org/entity/Q105547536',\n",
480 | " 'http://www.wikidata.org/entity/Q105547563',\n",
481 | " 'http://www.wikidata.org/entity/Q105547566',\n",
482 | " 'http://www.wikidata.org/entity/Q105547592',\n",
483 | " 'http://www.wikidata.org/entity/Q105575934',\n",
484 | " 'http://www.wikidata.org/entity/Q105575937',\n",
485 | " 'http://www.wikidata.org/entity/Q105575941',\n",
486 | " 'http://www.wikidata.org/entity/Q105575943',\n",
487 | " 'http://www.wikidata.org/entity/Q105575949',\n",
488 | " 'http://www.wikidata.org/entity/Q105575954',\n",
489 | " 'http://www.wikidata.org/entity/Q105575964',\n",
490 | " 'http://www.wikidata.org/entity/Q105575977',\n",
491 | " 'http://www.wikidata.org/entity/Q105575981',\n",
492 | " 'http://www.wikidata.org/entity/Q105575985',\n",
493 | " 'http://www.wikidata.org/entity/Q105592175',\n",
494 | " 'http://www.wikidata.org/entity/Q105592175',\n",
495 | " 'http://www.wikidata.org/entity/Q105592301',\n",
496 | " 'http://www.wikidata.org/entity/Q105592301',\n",
497 | " 'http://www.wikidata.org/entity/Q105592357',\n",
498 | " 'http://www.wikidata.org/entity/Q105592357',\n",
499 | " 'http://www.wikidata.org/entity/Q105592357',\n",
500 | " 'http://www.wikidata.org/entity/Q105592411',\n",
501 | " 'http://www.wikidata.org/entity/Q105592440',\n",
502 | " 'http://www.wikidata.org/entity/Q105606485',\n",
503 | " 'http://www.wikidata.org/entity/Q105606599',\n",
504 | " 'http://www.wikidata.org/entity/Q105606599',\n",
505 | " 'http://www.wikidata.org/entity/Q105606599',\n",
506 | " 'http://www.wikidata.org/entity/Q105606599',\n",
507 | " 'http://www.wikidata.org/entity/Q105606641',\n",
508 | " 'http://www.wikidata.org/entity/Q105606690',\n",
509 | " 'http://www.wikidata.org/entity/Q105606690',\n",
510 | " 'http://www.wikidata.org/entity/Q105606690',\n",
511 | " 'http://www.wikidata.org/entity/Q105606805',\n",
512 | " 'http://www.wikidata.org/entity/Q105606821',\n",
513 | " 'http://www.wikidata.org/entity/Q105606887',\n",
514 | " 'http://www.wikidata.org/entity/Q105623728',\n",
515 | " 'http://www.wikidata.org/entity/Q105623731',\n",
516 | " 'http://www.wikidata.org/entity/Q105627787',\n",
517 | " 'http://www.wikidata.org/entity/Q105627787',\n",
518 | " 'http://www.wikidata.org/entity/Q105627787',\n",
519 | " 'http://www.wikidata.org/entity/Q105627797',\n",
520 | " 'http://www.wikidata.org/entity/Q105627797',\n",
521 | " 'http://www.wikidata.org/entity/Q105627812',\n",
522 | " 'http://www.wikidata.org/entity/Q105627816',\n",
523 | " 'http://www.wikidata.org/entity/Q105627832',\n",
524 | " 'http://www.wikidata.org/entity/Q105627832',\n",
525 | " 'http://www.wikidata.org/entity/Q105627834',\n",
526 | " 'http://www.wikidata.org/entity/Q105642115',\n",
527 | " 'http://www.wikidata.org/entity/Q105642198',\n",
528 | " 'http://www.wikidata.org/entity/Q105642442',\n",
529 | " 'http://www.wikidata.org/entity/Q105660672',\n",
530 | " 'http://www.wikidata.org/entity/Q105660672',\n",
531 | " 'http://www.wikidata.org/entity/Q105660693',\n",
532 | " 'http://www.wikidata.org/entity/Q105673509',\n",
533 | " 'http://www.wikidata.org/entity/Q105674405',\n",
534 | " 'http://www.wikidata.org/entity/Q105688746',\n",
535 | " 'http://www.wikidata.org/entity/Q105688746',\n",
536 | " 'http://www.wikidata.org/entity/Q105688756',\n",
537 | " 'http://www.wikidata.org/entity/Q105688756',\n",
538 | " 'http://www.wikidata.org/entity/Q105688765',\n",
539 | " 'http://www.wikidata.org/entity/Q105688768',\n",
540 | " 'http://www.wikidata.org/entity/Q105688846',\n",
541 | " 'http://www.wikidata.org/entity/Q105688846',\n",
542 | " 'http://www.wikidata.org/entity/Q105688852',\n",
543 | " 'http://www.wikidata.org/entity/Q105688857',\n",
544 | " 'http://www.wikidata.org/entity/Q105702164',\n",
545 | " 'http://www.wikidata.org/entity/Q105702226',\n",
546 | " 'http://www.wikidata.org/entity/Q105702300',\n",
547 | " 'http://www.wikidata.org/entity/Q105702300',\n",
548 | " 'http://www.wikidata.org/entity/Q105702311',\n",
549 | " 'http://www.wikidata.org/entity/Q105702318',\n",
550 | " 'http://www.wikidata.org/entity/Q105702371',\n",
551 | " 'http://www.wikidata.org/entity/Q105702404',\n",
552 | " 'http://www.wikidata.org/entity/Q105702411',\n",
553 | " 'http://www.wikidata.org/entity/Q105702434',\n",
554 | " 'http://www.wikidata.org/entity/Q105702435',\n",
555 | " 'http://www.wikidata.org/entity/Q105702435',\n",
556 | " 'http://www.wikidata.org/entity/Q105702435',\n",
557 | " 'http://www.wikidata.org/entity/Q105702436',\n",
558 | " 'http://www.wikidata.org/entity/Q105713631',\n",
559 | " 'http://www.wikidata.org/entity/Q105713637',\n",
560 | " 'http://www.wikidata.org/entity/Q105713653',\n",
561 | " 'http://www.wikidata.org/entity/Q105713653',\n",
562 | " 'http://www.wikidata.org/entity/Q105713655',\n",
563 | " 'http://www.wikidata.org/entity/Q105713657',\n",
564 | " 'http://www.wikidata.org/entity/Q105713662',\n",
565 | " 'http://www.wikidata.org/entity/Q105713662',\n",
566 | " 'http://www.wikidata.org/entity/Q105713669',\n",
567 | " 'http://www.wikidata.org/entity/Q105713673',\n",
568 | " 'http://www.wikidata.org/entity/Q105713679',\n",
569 | " 'http://www.wikidata.org/entity/Q105713679',\n",
570 | " 'http://www.wikidata.org/entity/Q105713679',\n",
571 | " 'http://www.wikidata.org/entity/Q105713679',\n",
572 | " 'http://www.wikidata.org/entity/Q105713679',\n",
573 | " 'http://www.wikidata.org/entity/Q105713679',\n",
574 | " 'http://www.wikidata.org/entity/Q105713679',\n",
575 | " 'http://www.wikidata.org/entity/Q105713679',\n",
576 | " 'http://www.wikidata.org/entity/Q105713683',\n",
577 | " 'http://www.wikidata.org/entity/Q105713694',\n",
578 | " 'http://www.wikidata.org/entity/Q105713700',\n",
579 | " 'http://www.wikidata.org/entity/Q105713700',\n",
580 | " 'http://www.wikidata.org/entity/Q105713706',\n",
581 | " 'http://www.wikidata.org/entity/Q105713716',\n",
582 | " 'http://www.wikidata.org/entity/Q105713716',\n",
583 | " 'http://www.wikidata.org/entity/Q105713716',\n",
584 | " 'http://www.wikidata.org/entity/Q105713725',\n",
585 | " 'http://www.wikidata.org/entity/Q105713725',\n",
586 | " 'http://www.wikidata.org/entity/Q105713725',\n",
587 | " 'http://www.wikidata.org/entity/Q105713753',\n",
588 | " 'http://www.wikidata.org/entity/Q105713753',\n",
589 | " 'http://www.wikidata.org/entity/Q105713769',\n",
590 | " 'http://www.wikidata.org/entity/Q105713777',\n",
591 | " 'http://www.wikidata.org/entity/Q105713777',\n",
592 | " 'http://www.wikidata.org/entity/Q1057179',\n",
593 | " 'http://www.wikidata.org/entity/Q105723129',\n",
594 | " 'http://www.wikidata.org/entity/Q105723152',\n",
595 | " 'http://www.wikidata.org/entity/Q105723226',\n",
596 | " 'http://www.wikidata.org/entity/Q105723226',\n",
597 | " 'http://www.wikidata.org/entity/Q105723226',\n",
598 | " 'http://www.wikidata.org/entity/Q105723226',\n",
599 | " 'http://www.wikidata.org/entity/Q105723255',\n",
600 | " 'http://www.wikidata.org/entity/Q105723266',\n",
601 | " 'http://www.wikidata.org/entity/Q105723271',\n",
602 | " 'http://www.wikidata.org/entity/Q105734541',\n",
603 | " 'http://www.wikidata.org/entity/Q105734635',\n",
604 | " 'http://www.wikidata.org/entity/Q105734635',\n",
605 | " 'http://www.wikidata.org/entity/Q105734699',\n",
606 | " 'http://www.wikidata.org/entity/Q105734812',\n",
607 | " 'http://www.wikidata.org/entity/Q105734886',\n",
608 | " 'http://www.wikidata.org/entity/Q105734886',\n",
609 | " 'http://www.wikidata.org/entity/Q105734945',\n",
610 | " 'http://www.wikidata.org/entity/Q105734998',\n",
611 | " 'http://www.wikidata.org/entity/Q105735093',\n",
612 | " 'http://www.wikidata.org/entity/Q105735132',\n",
613 | " 'http://www.wikidata.org/entity/Q105745859',\n",
614 | " 'http://www.wikidata.org/entity/Q105745859',\n",
615 | " 'http://www.wikidata.org/entity/Q105745859',\n",
616 | " 'http://www.wikidata.org/entity/Q105745873',\n",
617 | " 'http://www.wikidata.org/entity/Q105747009',\n",
618 | " 'http://www.wikidata.org/entity/Q105747009',\n",
619 | " 'http://www.wikidata.org/entity/Q105747009',\n",
620 | " 'http://www.wikidata.org/entity/Q105747024',\n",
621 | " 'http://www.wikidata.org/entity/Q105770785',\n",
622 | " 'http://www.wikidata.org/entity/Q105770885',\n",
623 | " 'http://www.wikidata.org/entity/Q105771061',\n",
624 | " 'http://www.wikidata.org/entity/Q105771078',\n",
625 | " 'http://www.wikidata.org/entity/Q105771103',\n",
626 | " 'http://www.wikidata.org/entity/Q105771114',\n",
627 | " 'http://www.wikidata.org/entity/Q105771114',\n",
628 | " 'http://www.wikidata.org/entity/Q105771115',\n",
629 | " 'http://www.wikidata.org/entity/Q105771115',\n",
630 | " 'http://www.wikidata.org/entity/Q105789',\n",
631 | " 'http://www.wikidata.org/entity/Q105789',\n",
632 | " 'http://www.wikidata.org/entity/Q105789',\n",
633 | " 'http://www.wikidata.org/entity/Q105810922',\n",
634 | " 'http://www.wikidata.org/entity/Q105810937',\n",
635 | " 'http://www.wikidata.org/entity/Q105810946',\n",
636 | " 'http://www.wikidata.org/entity/Q105810946',\n",
637 | " 'http://www.wikidata.org/entity/Q105810946',\n",
638 | " 'http://www.wikidata.org/entity/Q105810966',\n",
639 | " 'http://www.wikidata.org/entity/Q105810994',\n",
640 | " 'http://www.wikidata.org/entity/Q105811011',\n",
641 | " 'http://www.wikidata.org/entity/Q105811153',\n",
642 | " 'http://www.wikidata.org/entity/Q105811227',\n",
643 | " 'http://www.wikidata.org/entity/Q105811240',\n",
644 | " 'http://www.wikidata.org/entity/Q105811317',\n",
645 | " 'http://www.wikidata.org/entity/Q105825932',\n",
646 | " 'http://www.wikidata.org/entity/Q105825951',\n",
647 | " 'http://www.wikidata.org/entity/Q105825965',\n",
648 | " 'http://www.wikidata.org/entity/Q105825980',\n",
649 | " 'http://www.wikidata.org/entity/Q105826005',\n",
650 | " 'http://www.wikidata.org/entity/Q105826046',\n",
651 | " 'http://www.wikidata.org/entity/Q105826046',\n",
652 | " 'http://www.wikidata.org/entity/Q105826069',\n",
653 | " 'http://www.wikidata.org/entity/Q105837596',\n",
654 | " 'http://www.wikidata.org/entity/Q105837692',\n",
655 | " 'http://www.wikidata.org/entity/Q105837777',\n",
656 | " 'http://www.wikidata.org/entity/Q105837777',\n",
657 | " 'http://www.wikidata.org/entity/Q105837802',\n",
658 | " 'http://www.wikidata.org/entity/Q105837818',\n",
659 | " 'http://www.wikidata.org/entity/Q105837877',\n",
660 | " 'http://www.wikidata.org/entity/Q105837877',\n",
661 | " 'http://www.wikidata.org/entity/Q105871126',\n",
662 | " 'http://www.wikidata.org/entity/Q105871182',\n",
663 | " 'http://www.wikidata.org/entity/Q105871195',\n",
664 | " 'http://www.wikidata.org/entity/Q105871195',\n",
665 | " 'http://www.wikidata.org/entity/Q105871195',\n",
666 | " 'http://www.wikidata.org/entity/Q105871195',\n",
667 | " 'http://www.wikidata.org/entity/Q105871195',\n",
668 | " 'http://www.wikidata.org/entity/Q105871358',\n",
669 | " 'http://www.wikidata.org/entity/Q105871358',\n",
670 | " 'http://www.wikidata.org/entity/Q105871374',\n",
671 | " 'http://www.wikidata.org/entity/Q105871406',\n",
672 | " 'http://www.wikidata.org/entity/Q105871406',\n",
673 | " 'http://www.wikidata.org/entity/Q105871442',\n",
674 | " 'http://www.wikidata.org/entity/Q105871521',\n",
675 | " 'http://www.wikidata.org/entity/Q105871527',\n",
676 | " 'http://www.wikidata.org/entity/Q105871530',\n",
677 | " 'http://www.wikidata.org/entity/Q1058791',\n",
678 | " 'http://www.wikidata.org/entity/Q105886127',\n",
679 | " 'http://www.wikidata.org/entity/Q105886149',\n",
680 | " 'http://www.wikidata.org/entity/Q105886156',\n",
681 | " 'http://www.wikidata.org/entity/Q1059',\n",
682 | " 'http://www.wikidata.org/entity/Q1059',\n",
683 | " 'http://www.wikidata.org/entity/Q1059',\n",
684 | " 'http://www.wikidata.org/entity/Q1059',\n",
685 | " 'http://www.wikidata.org/entity/Q1059',\n",
686 | " 'http://www.wikidata.org/entity/Q1059',\n",
687 | " 'http://www.wikidata.org/entity/Q105946066',\n",
688 | " 'http://www.wikidata.org/entity/Q105946066',\n",
689 | " 'http://www.wikidata.org/entity/Q105946076',\n",
690 | " 'http://www.wikidata.org/entity/Q105946155',\n",
691 | " 'http://www.wikidata.org/entity/Q105946161',\n",
692 | " 'http://www.wikidata.org/entity/Q105946161',\n",
693 | " 'http://www.wikidata.org/entity/Q105946161',\n",
694 | " 'http://www.wikidata.org/entity/Q105946167',\n",
695 | " 'http://www.wikidata.org/entity/Q105946167',\n",
696 | " 'http://www.wikidata.org/entity/Q105946175',\n",
697 | " 'http://www.wikidata.org/entity/Q105946175',\n",
698 | " 'http://www.wikidata.org/entity/Q105946210',\n",
699 | " 'http://www.wikidata.org/entity/Q105946210',\n",
700 | " 'http://www.wikidata.org/entity/Q105965298',\n",
701 | " 'http://www.wikidata.org/entity/Q105965298',\n",
702 | " 'http://www.wikidata.org/entity/Q105965298',\n",
703 | " 'http://www.wikidata.org/entity/Q105965298',\n",
704 | " 'http://www.wikidata.org/entity/Q105965314',\n",
705 | " 'http://www.wikidata.org/entity/Q105965372',\n",
706 | " 'http://www.wikidata.org/entity/Q105965407',\n",
707 | " 'http://www.wikidata.org/entity/Q105965407',\n",
708 | " 'http://www.wikidata.org/entity/Q105965407',\n",
709 | " 'http://www.wikidata.org/entity/Q105965434',\n",
710 | " 'http://www.wikidata.org/entity/Q105975960',\n",
711 | " 'http://www.wikidata.org/entity/Q105975986',\n",
712 | " 'http://www.wikidata.org/entity/Q105975986',\n",
713 | " 'http://www.wikidata.org/entity/Q105976091',\n",
714 | " 'http://www.wikidata.org/entity/Q105976121',\n",
715 | " 'http://www.wikidata.org/entity/Q105976233',\n",
716 | " 'http://www.wikidata.org/entity/Q105976347',\n",
717 | " 'http://www.wikidata.org/entity/Q105989583',\n",
718 | " 'http://www.wikidata.org/entity/Q105989583',\n",
719 | " 'http://www.wikidata.org/entity/Q105989583',\n",
720 | " 'http://www.wikidata.org/entity/Q105989595',\n",
721 | " 'http://www.wikidata.org/entity/Q105989595',\n",
722 | " 'http://www.wikidata.org/entity/Q105989683',\n",
723 | " 'http://www.wikidata.org/entity/Q105989724',\n",
724 | " 'http://www.wikidata.org/entity/Q105989936',\n",
725 | " 'http://www.wikidata.org/entity/Q105989936',\n",
726 | " 'http://www.wikidata.org/entity/Q105989936',\n",
727 | " 'http://www.wikidata.org/entity/Q105989936',\n",
728 | " 'http://www.wikidata.org/entity/Q105989936',\n",
729 | " 'http://www.wikidata.org/entity/Q105989936',\n",
730 | " 'http://www.wikidata.org/entity/Q105989936',\n",
731 | " 'http://www.wikidata.org/entity/Q105989956',\n",
732 | " 'http://www.wikidata.org/entity/Q105989962',\n",
733 | " 'http://www.wikidata.org/entity/Q105989983',\n",
734 | " 'http://www.wikidata.org/entity/Q106016',\n",
735 | " 'http://www.wikidata.org/entity/Q106016',\n",
736 | " 'http://www.wikidata.org/entity/Q106016',\n",
737 | " 'http://www.wikidata.org/entity/Q106016',\n",
738 | " 'http://www.wikidata.org/entity/Q106016',\n",
739 | " 'http://www.wikidata.org/entity/Q106016',\n",
740 | " 'http://www.wikidata.org/entity/Q106110995',\n",
741 | " 'http://www.wikidata.org/entity/Q106111103',\n",
742 | " 'http://www.wikidata.org/entity/Q106111160',\n",
743 | " 'http://www.wikidata.org/entity/Q106111226',\n",
744 | " 'http://www.wikidata.org/entity/Q106111350',\n",
745 | " 'http://www.wikidata.org/entity/Q106111545',\n",
746 | " 'http://www.wikidata.org/entity/Q106111670',\n",
747 | " 'http://www.wikidata.org/entity/Q106161345',\n",
748 | " 'http://www.wikidata.org/entity/Q106161446',\n",
749 | " 'http://www.wikidata.org/entity/Q106161473',\n",
750 | " 'http://www.wikidata.org/entity/Q106161481',\n",
751 | " 'http://www.wikidata.org/entity/Q106161481',\n",
752 | " 'http://www.wikidata.org/entity/Q106161481',\n",
753 | " 'http://www.wikidata.org/entity/Q106161481',\n",
754 | " 'http://www.wikidata.org/entity/Q106161556',\n",
755 | " 'http://www.wikidata.org/entity/Q106161654',\n",
756 | " 'http://www.wikidata.org/entity/Q106161715',\n",
757 | " 'http://www.wikidata.org/entity/Q106190269',\n",
758 | " 'http://www.wikidata.org/entity/Q106190319',\n",
759 | " 'http://www.wikidata.org/entity/Q106190573',\n",
760 | " 'http://www.wikidata.org/entity/Q106205918',\n",
761 | " 'http://www.wikidata.org/entity/Q106205918',\n",
762 | " 'http://www.wikidata.org/entity/Q106205929',\n",
763 | " 'http://www.wikidata.org/entity/Q106205963',\n",
764 | " 'http://www.wikidata.org/entity/Q106205990',\n",
765 | " 'http://www.wikidata.org/entity/Q106206051',\n",
766 | " 'http://www.wikidata.org/entity/Q106206069',\n",
767 | " 'http://www.wikidata.org/entity/Q106206069',\n",
768 | " 'http://www.wikidata.org/entity/Q106227',\n",
769 | " 'http://www.wikidata.org/entity/Q106227',\n",
770 | " 'http://www.wikidata.org/entity/Q106235357',\n",
771 | " 'http://www.wikidata.org/entity/Q106235362',\n",
772 | " 'http://www.wikidata.org/entity/Q106235384',\n",
773 | " 'http://www.wikidata.org/entity/Q106235408',\n",
774 | " 'http://www.wikidata.org/entity/Q106235432',\n",
775 | " 'http://www.wikidata.org/entity/Q106235436',\n",
776 | " 'http://www.wikidata.org/entity/Q106235441',\n",
777 | " 'http://www.wikidata.org/entity/Q106235460',\n",
778 | " 'http://www.wikidata.org/entity/Q106235467',\n",
779 | " 'http://www.wikidata.org/entity/Q106235494',\n",
780 | " 'http://www.wikidata.org/entity/Q106235517',\n",
781 | " 'http://www.wikidata.org/entity/Q106235519',\n",
782 | " 'http://www.wikidata.org/entity/Q106235560',\n",
783 | " 'http://www.wikidata.org/entity/Q106235566',\n",
784 | " 'http://www.wikidata.org/entity/Q106235569',\n",
785 | " 'http://www.wikidata.org/entity/Q106235595',\n",
786 | " 'http://www.wikidata.org/entity/Q106235595',\n",
787 | " 'http://www.wikidata.org/entity/Q106235595',\n",
788 | " 'http://www.wikidata.org/entity/Q106235595',\n",
789 | " 'http://www.wikidata.org/entity/Q106235604',\n",
790 | " 'http://www.wikidata.org/entity/Q106235604',\n",
791 | " 'http://www.wikidata.org/entity/Q106235604',\n",
792 | " 'http://www.wikidata.org/entity/Q106235614',\n",
793 | " 'http://www.wikidata.org/entity/Q106235649',\n",
794 | " 'http://www.wikidata.org/entity/Q106235652',\n",
795 | " 'http://www.wikidata.org/entity/Q106235652',\n",
796 | " 'http://www.wikidata.org/entity/Q106235735',\n",
797 | " 'http://www.wikidata.org/entity/Q106235778',\n",
798 | " 'http://www.wikidata.org/entity/Q106235948',\n",
799 | " 'http://www.wikidata.org/entity/Q106243194',\n",
800 | " 'http://www.wikidata.org/entity/Q106244608',\n",
801 | " 'http://www.wikidata.org/entity/Q106244620',\n",
802 | " 'http://www.wikidata.org/entity/Q106244683',\n",
803 | " 'http://www.wikidata.org/entity/Q106244753',\n",
804 | " 'http://www.wikidata.org/entity/Q106244821',\n",
805 | " 'http://www.wikidata.org/entity/Q106244835',\n",
806 | " 'http://www.wikidata.org/entity/Q106244835',\n",
807 | " 'http://www.wikidata.org/entity/Q106244912',\n",
808 | " 'http://www.wikidata.org/entity/Q106259131',\n",
809 | " 'http://www.wikidata.org/entity/Q106259165',\n",
810 | " 'http://www.wikidata.org/entity/Q106259215',\n",
811 | " 'http://www.wikidata.org/entity/Q106259260',\n",
812 | " 'http://www.wikidata.org/entity/Q106259265',\n",
813 | " 'http://www.wikidata.org/entity/Q106259278',\n",
814 | " 'http://www.wikidata.org/entity/Q106259365',\n",
815 | " 'http://www.wikidata.org/entity/Q106259481',\n",
816 | " 'http://www.wikidata.org/entity/Q106259491',\n",
817 | " 'http://www.wikidata.org/entity/Q106259513',\n",
818 | " 'http://www.wikidata.org/entity/Q106259535',\n",
819 | " 'http://www.wikidata.org/entity/Q106291866',\n",
820 | " 'http://www.wikidata.org/entity/Q106291866',\n",
821 | " 'http://www.wikidata.org/entity/Q106291872',\n",
822 | " 'http://www.wikidata.org/entity/Q106291885',\n",
823 | " 'http://www.wikidata.org/entity/Q106291923',\n",
824 | " 'http://www.wikidata.org/entity/Q106291941',\n",
825 | " 'http://www.wikidata.org/entity/Q106291956',\n",
826 | " 'http://www.wikidata.org/entity/Q106291960',\n",
827 | " 'http://www.wikidata.org/entity/Q106291969',\n",
828 | " 'http://www.wikidata.org/entity/Q106291985',\n",
829 | " 'http://www.wikidata.org/entity/Q1063',\n",
830 | " 'http://www.wikidata.org/entity/Q1063',\n",
831 | " 'http://www.wikidata.org/entity/Q106304406',\n",
832 | " 'http://www.wikidata.org/entity/Q106304427',\n",
833 | " 'http://www.wikidata.org/entity/Q106304482',\n",
834 | " 'http://www.wikidata.org/entity/Q106304482',\n",
835 | " 'http://www.wikidata.org/entity/Q106304582',\n",
836 | " 'http://www.wikidata.org/entity/Q106304675',\n",
837 | " 'http://www.wikidata.org/entity/Q106304763',\n",
838 | " 'http://www.wikidata.org/entity/Q106304845',\n",
839 | " 'http://www.wikidata.org/entity/Q106305026',\n",
840 | " 'http://www.wikidata.org/entity/Q106318778',\n",
841 | " 'http://www.wikidata.org/entity/Q106318823',\n",
842 | " 'http://www.wikidata.org/entity/Q106318823',\n",
843 | " 'http://www.wikidata.org/entity/Q106318834',\n",
844 | " 'http://www.wikidata.org/entity/Q106318837',\n",
845 | " 'http://www.wikidata.org/entity/Q106318855',\n",
846 | " 'http://www.wikidata.org/entity/Q106318858',\n",
847 | " 'http://www.wikidata.org/entity/Q106318863',\n",
848 | " 'http://www.wikidata.org/entity/Q106318872',\n",
849 | " 'http://www.wikidata.org/entity/Q106318882',\n",
850 | " 'http://www.wikidata.org/entity/Q106318884',\n",
851 | " 'http://www.wikidata.org/entity/Q106318886',\n",
852 | " 'http://www.wikidata.org/entity/Q106369827',\n",
853 | " 'http://www.wikidata.org/entity/Q106369827',\n",
854 | " 'http://www.wikidata.org/entity/Q106369832',\n",
855 | " 'http://www.wikidata.org/entity/Q106369839',\n",
856 | " 'http://www.wikidata.org/entity/Q106369854',\n",
857 | " 'http://www.wikidata.org/entity/Q106369922',\n",
858 | " 'http://www.wikidata.org/entity/Q106369929',\n",
859 | " 'http://www.wikidata.org/entity/Q106369935',\n",
860 | " 'http://www.wikidata.org/entity/Q106369935',\n",
861 | " 'http://www.wikidata.org/entity/Q106369941',\n",
862 | " 'http://www.wikidata.org/entity/Q106369952',\n",
863 | " 'http://www.wikidata.org/entity/Q106369959',\n",
864 | " 'http://www.wikidata.org/entity/Q106369966',\n",
865 | " 'http://www.wikidata.org/entity/Q106369966',\n",
866 | " 'http://www.wikidata.org/entity/Q106376619',\n",
867 | " 'http://www.wikidata.org/entity/Q106376652',\n",
868 | " 'http://www.wikidata.org/entity/Q106376978',\n",
869 | " 'http://www.wikidata.org/entity/Q106377009',\n",
870 | " 'http://www.wikidata.org/entity/Q106411314',\n",
871 | " 'http://www.wikidata.org/entity/Q106411324',\n",
872 | " 'http://www.wikidata.org/entity/Q106411350',\n",
873 | " 'http://www.wikidata.org/entity/Q106411365',\n",
874 | " 'http://www.wikidata.org/entity/Q106425682',\n",
875 | " 'http://www.wikidata.org/entity/Q106425763',\n",
876 | " 'http://www.wikidata.org/entity/Q106425867',\n",
877 | " 'http://www.wikidata.org/entity/Q106425867',\n",
878 | " 'http://www.wikidata.org/entity/Q106426043',\n",
879 | " 'http://www.wikidata.org/entity/Q106439652',\n",
880 | " 'http://www.wikidata.org/entity/Q106439661',\n",
881 | " 'http://www.wikidata.org/entity/Q106439843',\n",
882 | " 'http://www.wikidata.org/entity/Q106466562',\n",
883 | " 'http://www.wikidata.org/entity/Q106466568',\n",
884 | " 'http://www.wikidata.org/entity/Q106466571',\n",
885 | " 'http://www.wikidata.org/entity/Q106466573',\n",
886 | " 'http://www.wikidata.org/entity/Q106466587',\n",
887 | " 'http://www.wikidata.org/entity/Q106466588',\n",
888 | " 'http://www.wikidata.org/entity/Q106473666',\n",
889 | " 'http://www.wikidata.org/entity/Q106473750',\n",
890 | " 'http://www.wikidata.org/entity/Q106473750',\n",
891 | " 'http://www.wikidata.org/entity/Q106473769',\n",
892 | " 'http://www.wikidata.org/entity/Q106473777',\n",
893 | " 'http://www.wikidata.org/entity/Q106490043',\n",
894 | " 'http://www.wikidata.org/entity/Q106490047',\n",
895 | " 'http://www.wikidata.org/entity/Q106490057',\n",
896 | " 'http://www.wikidata.org/entity/Q106490059',\n",
897 | " 'http://www.wikidata.org/entity/Q106501661',\n",
898 | " 'http://www.wikidata.org/entity/Q106501839',\n",
899 | " 'http://www.wikidata.org/entity/Q106501926',\n",
900 | " 'http://www.wikidata.org/entity/Q106501997',\n",
901 | " 'http://www.wikidata.org/entity/Q106502019',\n",
902 | " 'http://www.wikidata.org/entity/Q10693',\n",
903 | " 'http://www.wikidata.org/entity/Q107',\n",
904 | " 'http://www.wikidata.org/entity/Q107',\n",
905 | " 'http://www.wikidata.org/entity/Q107',\n",
906 | " 'http://www.wikidata.org/entity/Q1070952',\n",
907 | " 'http://www.wikidata.org/entity/Q1072',\n",
908 | " 'http://www.wikidata.org/entity/Q1072012',\n",
909 | " 'http://www.wikidata.org/entity/Q1073',\n",
910 | " 'http://www.wikidata.org/entity/Q1073',\n",
911 | " 'http://www.wikidata.org/entity/Q1073',\n",
912 | " 'http://www.wikidata.org/entity/Q1073',\n",
913 | " 'http://www.wikidata.org/entity/Q1073',\n",
914 | " 'http://www.wikidata.org/entity/Q1074953',\n",
915 | " 'http://www.wikidata.org/entity/Q1075',\n",
916 | " 'http://www.wikidata.org/entity/Q108000',\n",
917 | " 'http://www.wikidata.org/entity/Q10862338',\n",
918 | " 'http://www.wikidata.org/entity/Q1093098',\n",
919 | " 'http://www.wikidata.org/entity/Q1093098',\n",
920 | " 'http://www.wikidata.org/entity/Q11016',\n",
921 | " 'http://www.wikidata.org/entity/Q11016',\n",
922 | " 'http://www.wikidata.org/entity/Q11016',\n",
923 | " 'http://www.wikidata.org/entity/Q11016',\n",
924 | " 'http://www.wikidata.org/entity/Q11016',\n",
925 | " 'http://www.wikidata.org/entity/Q11016',\n",
926 | " 'http://www.wikidata.org/entity/Q11016',\n",
927 | " 'http://www.wikidata.org/entity/Q11016',\n",
928 | " 'http://www.wikidata.org/entity/Q11028',\n",
929 | " 'http://www.wikidata.org/entity/Q11028',\n",
930 | " 'http://www.wikidata.org/entity/Q11028',\n",
931 | " 'http://www.wikidata.org/entity/Q11028',\n",
932 | " 'http://www.wikidata.org/entity/Q11028',\n",
933 | " 'http://www.wikidata.org/entity/Q11028',\n",
934 | " 'http://www.wikidata.org/entity/Q11028',\n",
935 | " 'http://www.wikidata.org/entity/Q11028',\n",
936 | " 'http://www.wikidata.org/entity/Q11028',\n",
937 | " 'http://www.wikidata.org/entity/Q11028',\n",
938 | " 'http://www.wikidata.org/entity/Q11028',\n",
939 | " 'http://www.wikidata.org/entity/Q11028',\n",
940 | " 'http://www.wikidata.org/entity/Q11028',\n",
941 | " 'http://www.wikidata.org/entity/Q11042',\n",
942 | " 'http://www.wikidata.org/entity/Q11053',\n",
943 | " 'http://www.wikidata.org/entity/Q11053',\n",
944 | " 'http://www.wikidata.org/entity/Q11053',\n",
945 | " 'http://www.wikidata.org/entity/Q11053',\n",
946 | " 'http://www.wikidata.org/entity/Q11053',\n",
947 | " 'http://www.wikidata.org/entity/Q11090',\n",
948 | " 'http://www.wikidata.org/entity/Q1115221',\n",
949 | " 'http://www.wikidata.org/entity/Q11190',\n",
950 | " 'http://www.wikidata.org/entity/Q11190',\n",
951 | " 'http://www.wikidata.org/entity/Q11190',\n",
952 | " 'http://www.wikidata.org/entity/Q11190',\n",
953 | " 'http://www.wikidata.org/entity/Q11190',\n",
954 | " 'http://www.wikidata.org/entity/Q11210',\n",
955 | " 'http://www.wikidata.org/entity/Q1128340',\n",
956 | " 'http://www.wikidata.org/entity/Q11293125',\n",
957 | " 'http://www.wikidata.org/entity/Q11306265',\n",
958 | " 'http://www.wikidata.org/entity/Q11306265',\n",
959 | " 'http://www.wikidata.org/entity/Q1134833',\n",
960 | " 'http://www.wikidata.org/entity/Q11369',\n",
961 | " 'http://www.wikidata.org/entity/Q11369',\n",
962 | " 'http://www.wikidata.org/entity/Q11369',\n",
963 | " 'http://www.wikidata.org/entity/Q11369',\n",
964 | " 'http://www.wikidata.org/entity/Q11369',\n",
965 | " 'http://www.wikidata.org/entity/Q11369',\n",
966 | " 'http://www.wikidata.org/entity/Q11369',\n",
967 | " 'http://www.wikidata.org/entity/Q11369',\n",
968 | " 'http://www.wikidata.org/entity/Q11369',\n",
969 | " 'http://www.wikidata.org/entity/Q11369',\n",
970 | " 'http://www.wikidata.org/entity/Q1137767',\n",
971 | " 'http://www.wikidata.org/entity/Q11394395',\n",
972 | " 'http://www.wikidata.org/entity/Q11398090',\n",
973 | " 'http://www.wikidata.org/entity/Q1144560',\n",
974 | " 'http://www.wikidata.org/entity/Q11451',\n",
975 | " 'http://www.wikidata.org/entity/Q1145523',\n",
976 | " 'http://www.wikidata.org/entity/Q1145523',\n",
977 | " 'http://www.wikidata.org/entity/Q11471',\n",
978 | " 'http://www.wikidata.org/entity/Q11471',\n",
979 | " 'http://www.wikidata.org/entity/Q11471',\n",
980 | " 'http://www.wikidata.org/entity/Q11471',\n",
981 | " 'http://www.wikidata.org/entity/Q11471',\n",
982 | " 'http://www.wikidata.org/entity/Q11471',\n",
983 | " 'http://www.wikidata.org/entity/Q11471',\n",
984 | " 'http://www.wikidata.org/entity/Q1147112',\n",
985 | " 'http://www.wikidata.org/entity/Q1151519',\n",
986 | " 'http://www.wikidata.org/entity/Q1154774',\n",
987 | " 'http://www.wikidata.org/entity/Q1156',\n",
988 | " 'http://www.wikidata.org/entity/Q11563',\n",
989 | " 'http://www.wikidata.org/entity/Q1168263',\n",
990 | " 'http://www.wikidata.org/entity/Q1168263',\n",
991 | " 'http://www.wikidata.org/entity/Q1168263',\n",
992 | " 'http://www.wikidata.org/entity/Q11707',\n",
993 | " 'http://www.wikidata.org/entity/Q1172284',\n",
994 | " 'http://www.wikidata.org/entity/Q1172284',\n",
995 | " 'http://www.wikidata.org/entity/Q11771331',\n",
996 | " 'http://www.wikidata.org/entity/Q1188986',\n",
997 | " 'http://www.wikidata.org/entity/Q1188986',\n",
998 | " 'http://www.wikidata.org/entity/Q1188986',\n",
999 | " 'http://www.wikidata.org/entity/Q1192422',\n",
1000 | " 'http://www.wikidata.org/entity/Q1199823',\n",
1001 | " 'http://www.wikidata.org/entity/Q1200750',\n",
1002 | " 'http://www.wikidata.org/entity/Q1200750',\n",
1003 | " 'http://www.wikidata.org/entity/Q1201019',\n",
1004 | " 'http://www.wikidata.org/entity/Q1201019',\n",
1005 | " 'http://www.wikidata.org/entity/Q1203526',\n",
1006 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1007 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1008 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1009 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1010 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1011 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1012 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1013 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1014 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1015 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1016 | " 'http://www.wikidata.org/entity/Q1207505',\n",
1017 | " 'http://www.wikidata.org/entity/Q12078',\n",
1018 | " 'http://www.wikidata.org/entity/Q12078',\n",
1019 | " 'http://www.wikidata.org/entity/Q12078',\n",
1020 | " 'http://www.wikidata.org/entity/Q12078',\n",
1021 | " 'http://www.wikidata.org/entity/Q12078874',\n",
1022 | " 'http://www.wikidata.org/entity/Q12136',\n",
1023 | " 'http://www.wikidata.org/entity/Q12136',\n",
1024 | " 'http://www.wikidata.org/entity/Q12136',\n",
1025 | " 'http://www.wikidata.org/entity/Q12136',\n",
1026 | " 'http://www.wikidata.org/entity/Q12136',\n",
1027 | " 'http://www.wikidata.org/entity/Q12136',\n",
1028 | " 'http://www.wikidata.org/entity/Q12136',\n",
1029 | " 'http://www.wikidata.org/entity/Q12136',\n",
1030 | " 'http://www.wikidata.org/entity/Q12136',\n",
1031 | " 'http://www.wikidata.org/entity/Q12136',\n",
1032 | " 'http://www.wikidata.org/entity/Q12136',\n",
1033 | " 'http://www.wikidata.org/entity/Q12136',\n",
1034 | " 'http://www.wikidata.org/entity/Q12136',\n",
1035 | " 'http://www.wikidata.org/entity/Q12136',\n",
1036 | " 'http://www.wikidata.org/entity/Q12139612',\n",
1037 | " 'http://www.wikidata.org/entity/Q12147',\n",
1038 | " 'http://www.wikidata.org/entity/Q12147',\n",
1039 | " 'http://www.wikidata.org/entity/Q12147',\n",
1040 | " 'http://www.wikidata.org/entity/Q1230584',\n",
1041 | " 'http://www.wikidata.org/entity/Q1230584',\n",
1042 | " 'http://www.wikidata.org/entity/Q1230584',\n",
1043 | " 'http://www.wikidata.org/entity/Q123619',\n",
1044 | " 'http://www.wikidata.org/entity/Q123619',\n",
1045 | " 'http://www.wikidata.org/entity/Q1241025',\n",
1046 | " 'http://www.wikidata.org/entity/Q1241025',\n",
1047 | " 'http://www.wikidata.org/entity/Q12453',\n",
1048 | " 'http://www.wikidata.org/entity/Q12453',\n",
1049 | " 'http://www.wikidata.org/entity/Q12453',\n",
1050 | " 'http://www.wikidata.org/entity/Q12453',\n",
1051 | " 'http://www.wikidata.org/entity/Q12453',\n",
1052 | " 'http://www.wikidata.org/entity/Q12453',\n",
1053 | " 'http://www.wikidata.org/entity/Q12453',\n",
1054 | " 'http://www.wikidata.org/entity/Q12453',\n",
1055 | " 'http://www.wikidata.org/entity/Q12488383',\n",
1056 | " 'http://www.wikidata.org/entity/Q1250464',\n",
1057 | " 'http://www.wikidata.org/entity/Q126017',\n",
1058 | " 'http://www.wikidata.org/entity/Q12718609',\n",
1059 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1060 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1061 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1062 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1063 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1064 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1065 | " 'http://www.wikidata.org/entity/Q12772819',\n",
1066 | " 'http://www.wikidata.org/entity/Q12821248',\n",
1067 | " 'http://www.wikidata.org/entity/Q1283504',\n",
1068 | " 'http://www.wikidata.org/entity/Q128581',\n",
1069 | " 'http://www.wikidata.org/entity/Q128581',\n",
1070 | " 'http://www.wikidata.org/entity/Q12888920',\n",
1071 | " 'http://www.wikidata.org/entity/Q12888920',\n",
1072 | " 'http://www.wikidata.org/entity/Q1296024',\n",
1073 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1074 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1075 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1076 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1077 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1078 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1079 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1080 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1081 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1082 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1083 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1084 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1085 | " 'http://www.wikidata.org/entity/Q1298668',\n",
1086 | " 'http://www.wikidata.org/entity/Q1298969',\n",
1087 | " 'http://www.wikidata.org/entity/Q1303415',\n",
1088 | " 'http://www.wikidata.org/entity/Q1303415',\n",
1089 | " 'http://www.wikidata.org/entity/Q1310239',\n",
1090 | " 'http://www.wikidata.org/entity/Q1310239',\n",
1091 | " 'http://www.wikidata.org/entity/Q13136',\n",
1092 | " 'http://www.wikidata.org/entity/Q13136',\n",
1093 | " 'http://www.wikidata.org/entity/Q1318295',\n",
1094 | " 'http://www.wikidata.org/entity/Q131841',\n",
1095 | " 'http://www.wikidata.org/entity/Q133212',\n",
1096 | " 'http://www.wikidata.org/entity/Q133212',\n",
1097 | " 'http://www.wikidata.org/entity/Q133212',\n",
1098 | " 'http://www.wikidata.org/entity/Q1336182',\n",
1099 | " 'http://www.wikidata.org/entity/Q1336182',\n",
1100 | " 'http://www.wikidata.org/entity/Q1336182',\n",
1101 | " 'http://www.wikidata.org/entity/Q1340858',\n",
1102 | " 'http://www.wikidata.org/entity/Q134435',\n",
1103 | " 'http://www.wikidata.org/entity/Q1347572',\n",
1104 | " 'http://www.wikidata.org/entity/Q1362683',\n",
1105 | " 'http://www.wikidata.org/entity/Q1371819',\n",
1106 | " 'http://www.wikidata.org/entity/Q1371819',\n",
1107 | " 'http://www.wikidata.org/entity/Q1383412',\n",
1108 | " 'http://www.wikidata.org/entity/Q1383412',\n",
1109 | " 'http://www.wikidata.org/entity/Q1383412',\n",
1110 | " 'http://www.wikidata.org/entity/Q1383412',\n",
1111 | " 'http://www.wikidata.org/entity/Q1383412',\n",
1112 | " 'http://www.wikidata.org/entity/Q1384726',\n",
1113 | " 'http://www.wikidata.org/entity/Q1395034',\n",
1114 | " 'http://www.wikidata.org/entity/Q1395034',\n",
1115 | " 'http://www.wikidata.org/entity/Q141124',\n",
1116 | " 'http://www.wikidata.org/entity/Q1412309',\n",
1117 | " 'http://www.wikidata.org/entity/Q1415372',\n",
1118 | " 'http://www.wikidata.org/entity/Q1415372',\n",
1119 | " 'http://www.wikidata.org/entity/Q1415899',\n",
1120 | " 'http://www.wikidata.org/entity/Q1418791',\n",
1121 | " 'http://www.wikidata.org/entity/Q1422013',\n",
1122 | " 'http://www.wikidata.org/entity/Q1425577',\n",
1123 | " 'http://www.wikidata.org/entity/Q1425577',\n",
1124 | " 'http://www.wikidata.org/entity/Q1425625',\n",
1125 | " 'http://www.wikidata.org/entity/Q1425625',\n",
1126 | " 'http://www.wikidata.org/entity/Q1425625',\n",
1127 | " 'http://www.wikidata.org/entity/Q1425977',\n",
1128 | " 'http://www.wikidata.org/entity/Q14402006',\n",
1129 | " 'http://www.wikidata.org/entity/Q1456827',\n",
1130 | " 'http://www.wikidata.org/entity/Q14645705',\n",
1131 | " 'http://www.wikidata.org/entity/Q147027',\n",
1132 | " 'http://www.wikidata.org/entity/Q1474521',\n",
1133 | " 'http://www.wikidata.org/entity/Q1474611',\n",
1134 | " 'http://www.wikidata.org/entity/Q1474611',\n",
1135 | " 'http://www.wikidata.org/entity/Q1477',\n",
1136 | " 'http://www.wikidata.org/entity/Q14859958',\n",
1137 | " 'http://www.wikidata.org/entity/Q14859963',\n",
1138 | " 'http://www.wikidata.org/entity/Q14860133',\n",
1139 | " 'http://www.wikidata.org/entity/Q14863499',\n",
1140 | " 'http://www.wikidata.org/entity/Q14863499',\n",
1141 | " 'http://www.wikidata.org/entity/Q14863499',\n",
1142 | " 'http://www.wikidata.org/entity/Q14863969',\n",
1143 | " 'http://www.wikidata.org/entity/Q14864292',\n",
1144 | " 'http://www.wikidata.org/entity/Q14873666',\n",
1145 | " 'http://www.wikidata.org/entity/Q14911658',\n",
1146 | " 'http://www.wikidata.org/entity/Q14944328',\n",
1147 | " 'http://www.wikidata.org/entity/Q14944328',\n",
1148 | " 'http://www.wikidata.org/entity/Q15039945',\n",
1149 | " 'http://www.wikidata.org/entity/Q15039945',\n",
1150 | " 'http://www.wikidata.org/entity/Q150526',\n",
1151 | " 'http://www.wikidata.org/entity/Q150630',\n",
1152 | " 'http://www.wikidata.org/entity/Q15088675',\n",
1153 | " 'http://www.wikidata.org/entity/Q15176415',\n",
1154 | " 'http://www.wikidata.org/entity/Q15176415',\n",
1155 | " 'http://www.wikidata.org/entity/Q15176415',\n",
1156 | " 'http://www.wikidata.org/entity/Q1517706',\n",
1157 | " 'http://www.wikidata.org/entity/Q1517706',\n",
1158 | " 'http://www.wikidata.org/entity/Q151885',\n",
1159 | " 'http://www.wikidata.org/entity/Q151885',\n",
1160 | " 'http://www.wikidata.org/entity/Q151885',\n",
1161 | " 'http://www.wikidata.org/entity/Q151885',\n",
1162 | " 'http://www.wikidata.org/entity/Q151885',\n",
1163 | " 'http://www.wikidata.org/entity/Q151885',\n",
1164 | " 'http://www.wikidata.org/entity/Q151885',\n",
1165 | " 'http://www.wikidata.org/entity/Q1530412',\n",
1166 | " 'http://www.wikidata.org/entity/Q15304597',\n",
1167 | " 'http://www.wikidata.org/entity/Q15304597',\n",
1168 | " 'http://www.wikidata.org/entity/Q15304597',\n",
1169 | " 'http://www.wikidata.org/entity/Q15401884',\n",
1170 | " 'http://www.wikidata.org/entity/Q1553259',\n",
1171 | " 'http://www.wikidata.org/entity/Q1553259',\n",
1172 | " 'http://www.wikidata.org/entity/Q1553259',\n",
1173 | " 'http://www.wikidata.org/entity/Q1554231',\n",
1174 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1175 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1176 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1177 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1178 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1179 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1180 | " 'http://www.wikidata.org/entity/Q15635432',\n",
1181 | " 'http://www.wikidata.org/entity/Q1570272',\n",
1182 | " 'http://www.wikidata.org/entity/Q159236',\n",
1183 | " 'http://www.wikidata.org/entity/Q159236',\n",
1184 | " 'http://www.wikidata.org/entity/Q159236',\n",
1185 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1186 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1187 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1188 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1189 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1190 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1191 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1192 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1193 | " 'http://www.wikidata.org/entity/Q15978631',\n",
1194 | " 'http://www.wikidata.org/entity/Q15989253',\n",
1195 | " 'http://www.wikidata.org/entity/Q16000077',\n",
1196 | " 'http://www.wikidata.org/entity/Q16000077',\n",
1197 | " 'http://www.wikidata.org/entity/Q16000077',\n",
1198 | " 'http://www.wikidata.org/entity/Q16000077',\n",
1199 | " 'http://www.wikidata.org/entity/Q16021',\n",
1200 | " 'http://www.wikidata.org/entity/Q16026109',\n",
1201 | " 'http://www.wikidata.org/entity/Q1620186',\n",
1202 | " 'http://www.wikidata.org/entity/Q162827',\n",
1203 | " 'http://www.wikidata.org/entity/Q1638475',\n",
1204 | " 'http://www.wikidata.org/entity/Q1638475',\n",
1205 | " 'http://www.wikidata.org/entity/Q16502',\n",
1206 | " 'http://www.wikidata.org/entity/Q16502',\n",
1207 | " 'http://www.wikidata.org/entity/Q16502',\n",
1208 | " 'http://www.wikidata.org/entity/Q1650915',\n",
1209 | " 'http://www.wikidata.org/entity/Q1650915',\n",
1210 | " 'http://www.wikidata.org/entity/Q1650915',\n",
1211 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1212 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1213 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1214 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1215 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1216 | " 'http://www.wikidata.org/entity/Q16511806',\n",
1217 | " 'http://www.wikidata.org/entity/Q16515105',\n",
1218 | " 'http://www.wikidata.org/entity/Q1664628',\n",
1219 | " 'http://www.wikidata.org/entity/Q1683540',\n",
1220 | " 'http://www.wikidata.org/entity/Q1683540',\n",
1221 | " 'http://www.wikidata.org/entity/Q16886469',\n",
1222 | " 'http://www.wikidata.org/entity/Q16887380',\n",
1223 | " 'http://www.wikidata.org/entity/Q16889133',\n",
1224 | " 'http://www.wikidata.org/entity/Q16919015',\n",
1225 | " ...]"
1226 | ]
1227 | },
1228 | "execution_count": 73,
1229 | "metadata": {},
1230 | "output_type": "execute_result"
1231 | }
1232 | ],
1233 | "source": [
1234 | "wikidata_ids"
1235 | ]
1236 | }
1237 | ],
1238 | "metadata": {
1239 | "kernelspec": {
1240 | "display_name": "Python 3",
1241 | "language": "python",
1242 | "name": "python3"
1243 | },
1244 | "language_info": {
1245 | "codemirror_mode": {
1246 | "name": "ipython",
1247 | "version": 3
1248 | },
1249 | "file_extension": ".py",
1250 | "mimetype": "text/x-python",
1251 | "name": "python",
1252 | "nbconvert_exporter": "python",
1253 | "pygments_lexer": "ipython3",
1254 | "version": "3.6.9"
1255 | }
1256 | },
1257 | "nbformat": 4,
1258 | "nbformat_minor": 4
1259 | }
1260 |
--------------------------------------------------------------------------------