Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/wikidata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ jobs:

echo 'Accessing the Wikidata data'
## Download outdated IDs for chemicals qLever Style
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/chemicalAllRedirects.rq -G https://qlever.cs.uni-freiburg.de/api/wikidata -o datasources/wikidata/recentData/metabolites.tsv
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/chemicalAllRedirects.rq -G https://qlever.dev/api/wikidata -o datasources/wikidata/recentData/metabolites.tsv
## Download outdated IDs for genes qLever Style
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/geneHumanAllRedirects.rq -G https://qlever.cs.uni-freiburg.de/api/wikidata -o datasources/wikidata/recentData/gene.tsv
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/geneHumanAllRedirects.rq -G https://qlever.dev/api/wikidata -o datasources/wikidata/recentData/gene.tsv
## Download outdated IDs for proteins qLever Style
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/proteinHumanAllRedirects.rq -G https://qlever.cs.uni-freiburg.de/api/wikidata -o datasources/wikidata/recentData/protein.tsv
curl -H "Accept: text/tab-separated-values" --data-urlencode query@datasources/wikidata/queries/proteinHumanAllRedirects.rq -G https://qlever.dev/api/wikidata -o datasources/wikidata/recentData/protein.tsv


##Check new data, fail job if query timeout has occured
Expand All @@ -89,6 +89,12 @@ jobs:
head -n 20 "$File"
#echo "DOWNLOAD_FILE=true" >>$GITHUB_ENV
fail_file="${fail_file} $File"
elif grep -q "html" "$File"; then
echo "Data grab error occurred for file: " "$File"
echo "Wikidata data will not be updated"
head -n 20 "$File"
#echo "DOWNLOAD_FILE=true" >>$GITHUB_ENV
fail_file="${fail_file} $File"
else
echo "No Query Timeout detected for file: " "$File"
fi
Expand Down
15 changes: 15 additions & 0 deletions datasources/wikidata/queries/chemicalAllRedirects.rq
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,34 @@ WHERE
{
{ ?primaryID p:P31/ps:P31 wd:Q11173 }
UNION
{ ?primaryID wdt:P31 wd:Q11173 }
UNION
{ ?primaryID p:P31/ps:P31 wd:Q36496 }
UNION
{ ?primaryID wdt:P31 wd:Q36496 }
UNION
{ ?primaryID p:P31/ps:P31 wd:Q79529 }
UNION
{ ?primaryID wdt:P31 wd:Q79529 }
UNION
{ ?primaryID p:P31/ps:P31 wd:Q55662747 }
UNION
{ ?primaryID wdt:P31 wd:Q55662747 }
UNION
{ ?primaryID p:P31/ps:31 wd:Q113145171 }
UNION
{ ?primaryID wdt:P31 wd:Q113145171 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q11173 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q36496 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q79529 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q55662747 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q113145171 }


OPTIONAL{?secondaryID owl:sameAs ?primaryID.}
OPTIONAL{?primaryID rdfs:label ?name.
Expand Down
2 changes: 2 additions & 0 deletions datasources/wikidata/queries/geneHumanAllRedirects.rq
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ WHERE
{
{ ?primaryID p:P31/ps:P31 wd:Q7187 }
UNION
{ ?primaryID wdt:P31 wd:Q7187 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q7187 }

?primaryID wdt:P703 wd:Q15978631.
Expand Down
2 changes: 2 additions & 0 deletions datasources/wikidata/queries/proteinHumanAllRedirects.rq
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ WHERE
{
{ ?primaryID p:P31/ps:P31 wd:Q8054 }
UNION
{ ?primaryID wdt:P31 wd:Q8054 }
UNION
{ ?primaryID p:P279/ps:P279 wd:Q8054 }

?primaryID wdt:P703 wd:Q15978631.
Expand Down