query-f47ed0ac3ff8af1d49f1d972dafbd637
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?title ?begin ?begin2 WHERE {
BIND(wd:Q42 AS ?item)
?item wdt:P18 ?image.
#BIND(STRAFTER(wikibase:decodeUri(STR(?image)), "http://commons.wikimedia.org/wiki/Special:FilePath/") AS ?fileTitle)
?article schema:isPartOf <https://fr.wikipedia.org/> ;
schema:about ?item ;
schema:name ?title.
bind (substr(?content, 1, 2000) as ?begin)
bind (strbefore(?content, ". ") as ?begin2)
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "fr.wikipedia.org";
wikibase:api "Generator";
wikibase:limit "once";
mwapi:generator "allpages";
mwapi:gapfrom ?title;
# mwapi:gapnamespace 6; # NS_FILE
mwapi:gaplimit 1;
mwapi:prop "revisions";
mwapi:rvprop "content".
#?contentmodel wikibase:apiOutput 'revisions/rev/@contentmodel'.
#?contentformat wikibase:apiOutput 'revisions/rev/@contentformat'.
?content wikibase:apiOutput 'revisions/rev/text()' .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v5("?begin"):::projected
v6("?begin2"):::projected
v7("?content")
v2("?image")
v1("?item"):::projected
v4("?title"):::projected
c3([https://fr.wikipedia.org/]):::iri
c24(["revisions/rev/text()"]):::literal
c22(["content"]):::literal
c18(["1^^xsd:integer"]):::literal
c9(["fr.wikipedia.org"]):::literal
c7(["bd:serviceParam"]):::iri
c13(["once"]):::literal
c15(["allpages"]):::literal
c20(["revisions"]):::literal
c11(["Generator"]):::literal
bind0[/"'wd:Q42'"/]
bind0 --as--o v1
v1 --"wdt:P18"--> v2
v3 --"schema:isPartOf"--> c3
v3 --"schema:about"--> v1
v3 --"schema:name"--> v4
bind1[/"substring(?content,'1^^xsd:integer','2000^^xsd:integer')"/]
v7 --o bind1
bind1 --as--o v5
bind2[/"substring-before(?content,'. ')"/]
v7 --o bind2
bind2 --as--o v6
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c7 --"mwapi:endpoint"--> c9
c7 --"mwapi:api"--> c11
c7 --"mwapi:limit"--> c13
c7 --"mwapi:generator"--> c15
c7 --"mwapi:gapfrom"--> v4
c7 --"mwapi:gaplimit"--> c18
c7 --"mwapi:prop"--> c20
c7 --"mwapi:rvprop"--> c22
v7 --"mwapi:apiOutput"--> c24
end