query-b6566d13062c0ee2ec3e3d64aeb6ba88
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT $author ?articleId WHERE {
{
SELECT $author WHERE {
$author wdt:P31 wd:Q5 ;
wdt:P6872 wd:Q164746 ;
p:P6872 $n .
$n pq:P2699 $url .
# FILTER(STR(?url) = "https://www.wsj.com/news/author/margot-patrick" )
FILTER(STRENDS(STR(?url), "margot-patrick")) .
}
}
{
SELECT DISTINCT $author ?articleId WHERE {
?item wdt:P1433 wd:Q164746.
?item (wdt:P31/(wdt:P279*)) wd:Q191067;
p:P1433 ?publishedIn.
$item wdt:P50 $author.
?publishedIn pq:P2322 ?articleId.
}
GROUP BY $author ?articleId
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?articleId"):::projected
v2("?author"):::projected
v4("?item")
v3("?n")
v5("?publishedIn")
v1("?url")
a1((" "))
c5(["wd:Q164746"]):::iri
c3(["wd:Q5"]):::iri
c10(["wd:Q191067"]):::iri
f0[["ends-with(str(?url),'margot-patrick')"]]
f0 --> v1
v2 --"p:direct/P31"--> c3
v2 --"p:direct/P6872"--> c5
v2 --"p:P6872"--> v3
v3 --"p:qualifier/P2699"--> v1
v4 --"p:direct/P1433"--> c5
v4 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c10
v4 --"p:P1433"--> v5
v4 --"p:direct/P50"--> v2
v5 --"p:qualifier/P2322"--> v6