SPARQL Test: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{#sparql: PREFIX prop: <https://bca.tsadra.org/index.php/Property> PREFIX page: <https://bca.tsadra.org/index.php/> select ?FullTitle ?People ?TileDescription where { ?la...") |
((by SublimeText.Mediawiker)) |
||
(54 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== ✅ Sample Wikidata Query == | |||
<pre> | |||
{{#sparql: | {{#sparql: | ||
PREFIX | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
PREFIX | 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#> | ||
Line 49: | Line 60: | ||
|config=http://www.wikidata.org | |config=http://www.wikidata.org | ||
}} | }} | ||
<!-- | |||
== Trying to query BCA endpoint == | |||
{{#sparql: | |||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | |||
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#> | |||
PREFIX wiki: <https://commons.tsadra.org/index.php/Special:URIResolver/> | |||
PREFIX category: <https://commons.tsadra.org/index.php/Special:URIResolver/Category-3A> | |||
PREFIX property: <https://commons.tsadra.org/index.php/Special:URIResolver/Property-3A> | |||
select ?fullname | |||
where { | |||
?person property:Bornin "Rongyab (rong rgyab)" . | |||
?person rdfs:label ?fullname . | |||
} | |||
LIMIT 5 | |||
|log=2 | |||
}} | |||
== Trying to query BCA endpoint TEST 2 == | |||
{{#sparql: | |||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | |||
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#> | |||
PREFIX wiki: <https://bca.tsadra.org/index.php/Special:URIResolver/> | |||
PREFIX category: <https://bca.tsadra.org/index.php/Special:URIResolver/Category-3A> | |||
PREFIX property: <https://bca.tsadra.org/index.php/Special:URIResolver/Property-3A> | |||
SELECT DISTINCT ?Title | |||
WHERE | |||
{ | |||
?Title property:Title "The Nectar of" . | |||
} | |||
LIMIT 5 | |||
|log=2 | |||
|debug=YES | |||
}} | |||
--> |
Latest revision as of 20:41, 20 April 2022
✅ 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 }}