User:Derek J Moore/SPARQL

From Wikipedia, the free encyclopedia

SPARQL and Libraries in South Africa

Welcome to this tutorial to support those who wish to use Linked Data.

Overview

This tutorial consists of

  • Activity 1 - Do you know where your local library is? (Introduction to SPARQL Queries)
  • Activity 2 - (The Wikidata Knowledge Graphs)
  • Step 2 - SPARQL (SPARKLE) Query Language

Objective of This Module

This tutorial will guide you through the initial use of Linked Data in preparation for using Wikidata. You should be able to answer these questions

  1. What is Linked Data?
  2. What is the difference between nodes, connections, and statements?
  3. What is SPARQL?
  4. What is a Knowledge Graph?

Display geographic coordinates for all libraries, worldwide

#defaultView:Map
#Display the results as a Map
SELECT distinct * WHERE {
#Look for instances (p31) of libraries (Q7075)
#(and) add the coordinate location (P625) as ?geo
}
#Inspired by Museums in Antwerp
#Look at AfLIA WikiData training
SELECT distinct * WHERE {
  ?library wdt:P31 wd:Q7075;     
   wdt:P625 ?geo.        
}
Click here to launch the Wikidata query

Do you know where your local library is?

SELECT distinct ?library ?libraryLabel ?geoLabel
WHERE {
  ?library wdt:P31 wd:Q7075; 
   wdt:P17 wd:Q258;
   wdt:P625 ?geo.LIMIT 1000
Locations of libraries according to Wikidata


Watch Out - BIG jump ahead

Well done. You have been introduced to SPARQL.

Related Articles

Wikiwand AI