Skip to content

Commit

Permalink
queries: constraining ?work_type before refering to it
Browse files Browse the repository at this point in the history
trying to make it more readable
  • Loading branch information
maxlath committed Nov 9, 2019
1 parent 107218f commit 04397e4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports =
?item wdt:P31 wd:Q3331189 .
# Filter-out entities tagged as both work and edition
FILTER NOT EXISTS {
?item wdt:P31 ?work_type
VALUES (?work_type) { (wd:Q571) (wd:Q47461344) (wd:Q7725634) (wd:Q2831984) (wd:Q1004) (wd:Q1760610) (wd:Q8274) } .
?item wdt:P31 ?work_type
}
}
LIMIT 1000
Expand Down
2 changes: 1 addition & 1 deletion server/data/wikidata/queries/humans_reverse_claims.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports =
# Keep only humans that are known for at least one work
?work wdt:P50 ?item .
?work wdt:P31 ?work_type .
VALUES (?work_type) { (wd:Q571) (wd:Q47461344) (wd:Q7725634) (wd:Q2831984) (wd:Q1004) (wd:Q1760610) (wd:Q8274) } .
?work wdt:P31 ?work_type .
}
LIMIT 1000
"""
2 changes: 1 addition & 1 deletion server/data/wikidata/queries/serie_parts.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module.exports =
?part wdt:P31 wd:Q3331189
# but recover parts that are also instances of work
FILTER NOT EXISTS {
?part wdt:P31 ?work_type .
VALUES (?work_type) { (wd:Q571) (wd:Q47461344) (wd:Q7725634) (wd:Q2831984) (wd:Q1004) (wd:Q1760610) (wd:Q8274) } .
?part wdt:P31 ?work_type .
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/data/wikidata/queries/works_reverse_claims.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports =
"""
SELECT DISTINCT ?item WHERE {
?item wdt:#{pid} wd:#{qid} .
?item wdt:P31 ?work_type .
VALUES (?work_type) { (wd:Q571) (wd:Q47461344) (wd:Q7725634) (wd:Q2831984) (wd:Q1004) (wd:Q1760610) (wd:Q8274) } .
?item wdt:P31 ?work_type .
}
LIMIT 1000
"""

0 comments on commit 04397e4

Please sign in to comment.