SPARQL Test: Difference between revisions
((by SublimeText.Mediawiker)) |
((by SublimeText.Mediawiker)) |
||
Line 21: | Line 21: | ||
== ✅ Sample Wikidata Query == | == ✅ Sample Wikidata Query == | ||
<pre> | |||
{{#sparql: | |||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |||
PREFIX pq: <http://www.wikidata.org/prop/qualifier/> | |||
PREFIX psv: <http://www.wikidata.org/prop/statement/value/> | |||
PREFIX p: <http://www.wikidata.org/prop/> | |||
PREFIX bd: <http://www.bigdata.com/rdf#> | |||
PREFIX wikibase: <http://wikiba.se/ontology#> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |||
select distinct ?lat ?long ?presidentLabel | |||
where { | |||
?president wdt:P39 wd:Q191954 ; | |||
wdt:P19 ?villeNaissance ; | |||
p:P39 ?s . | |||
?villeNaissance p:P625 ?coord . | |||
?coord psv:P625 ?coordValue . | |||
?coordValue a wikibase:GlobecoordinateValue ; | |||
wikibase:geoLatitude ?lat ; | |||
wikibase:geoLongitude ?long . | |||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "fr" . | |||
} | |||
} | |||
|config=http://www.wikidata.org | |||
}} | |||
</pre> | |||
{{#sparql: | {{#sparql: | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> |
Revision as of 14:48, 18 April 2022
{{#sparql: PREFIX prop: <https://bca.tsadra.org/index.php/Property> PREFIX page: <https://bca.tsadra.org/index.php/>
select ?FullTitle ?People ?TileDescription where { ?label page:Books/The_Nectar_of_Manjushri-27s_Speech . } LIMIT 5 |config=https://bca.tsadra.org |log=2 }}
✅ Sample Wikidata Query
{{#sparql: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> PREFIX psv: <http://www.wikidata.org/prop/statement/value/> PREFIX p: <http://www.wikidata.org/prop/> PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> select distinct ?lat ?long ?presidentLabel where { ?president wdt:P39 wd:Q191954 ; wdt:P19 ?villeNaissance ; p:P39 ?s . ?villeNaissance p:P625 ?coord . ?coord psv:P625 ?coordValue . ?coordValue a wikibase:GlobecoordinateValue ; wikibase:geoLatitude ?lat ; wikibase:geoLongitude ?long . SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" . } } |config=http://www.wikidata.org }}
{{#sparql: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> PREFIX psv: <http://www.wikidata.org/prop/statement/value/> PREFIX p: <http://www.wikidata.org/prop/> PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select distinct ?lat ?long ?presidentLabel where {
?president wdt:P39 wd:Q191954 ; wdt:P19 ?villeNaissance ; p:P39 ?s .
?villeNaissance p:P625 ?coord . ?coord psv:P625 ?coordValue . ?coordValue a wikibase:GlobecoordinateValue ; wikibase:geoLatitude ?lat ; wikibase:geoLongitude ?long .
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" . }
} |config=http://www.wikidata.org }}