SlideShare a Scribd company logo
SPARQL Query!

Group: Qian, Pierre-Adrien
Query 1
Objective: Find all the people who were born in Paris on DBpedia

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>

SELECT distinct ?name ?birth ?person WHERE {
    ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> .
    ?person dbpedia2:birthDate ?birth .
    ?person foaf:name ?name .
} ORDER BY ?name


Result:
Plenty of them!
ex: "René Laloux"@en1929-07-13http://dbpedia.org/resource/Ren%C3%A9_Laloux
Query 2
Objective: Find all the people born in Paris after 1970 by using FILTER

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>

SELECT distinct ?name ?person ?birthDate WHERE {
    ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> .
    ?person foaf:name ?name .
    ?person dbpedia2:birthDate ?birthDate .
    FILTER (1970 < ?birthDate)
} ORDER BY ?birthDate


Result:
"Jules de Balincourt"@enhttp://dbpedia.org/resource/Jules_de_Balincourt"1972"^^<http://www.w3.org/2001/XMLSchema#int>
"Phoebe Philo"@enhttp://dbpedia.org/resource/Phoebe_Philo"1973"^^<http://www.w3.org/2001/XMLSchema#int>
"Caroline Ducey"@enhttp://dbpedia.org/resource/Caroline_Ducey"1977"^^<http://www.w3.org/2001/XMLSchema#int>
Query 3
Objective: Find all the solo singer who were born in London

PREFIX dbpedia3: <http://dbpedia.org/ontology/>

SELECT distinct
    ?name ?birthdate ?person WHERE
{ ?person dbpedia3:birthPlace <http://dbpedia.org/resource/London> .
  ?person dbpedia3:birthDate ?birthdate .
  ?person dbpedia3:background "solo_singer"@en .
  ?person foaf:name ?name .

} ORDER BY ?name
Query 4
Objective: Find all the people born in Brest using FILTER regex
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia3: <http://dbpedia.org/ontology/>


SELECT distinct ?name ?person ?birthPlace WHERE {
    ?person foaf:name ?name .
    ?person dbpedia2:birthPlace ?birthPlace
    FILTER regex (?birthPlace, "Brest")
} ORDER BY ?name


Result :
"Alex Thepot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alex
      Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexand
      re Coeff"@enhttp://dbpedia.org/resource/Alexandre_Coeffhttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexis
      Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re
Query 5
Objective: Find the solo artists who did concert tours of more than 200 shows


PREFIX dbpedia2: <http://dbpedia.org/property/>
SELECT distinct ?tour ?artist ?numberOfShows WHERE
{
  ?tour dbpedia2:artist ?artist .
  ?artist dbpedia2:background "solo_singer"@en .
  ?tour dbpedia2:numberOfShows ?numberOfShows .
  FILTER (?numberOfShows > 200)
} ORDER BY ?numberOfShows



Several results (Bob Dylan, Cher, Lady Gaga...)
Query Simpsons




•   Find out all the chalk gag that Bart wrote on the blackboard!
     –   http://www.snee.com/bobdc.blog/2008/10/learning-more-about-sparql.html
     –   http://www.snee.com/bobdc.blog/2007/11/querying-dbpedia.html
     –   http://dbpedia.org/page/Category:The_Simpsons_episodes



•   We didn’t succeed in doing this within our limited working hours. So if you
    are interested, try it out! These links are useful for you!

More Related Content

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Sparql

  • 2. Query 1 Objective: Find all the people who were born in Paris on DBpedia PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX : <http://dbpedia.org/resource/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia: <http://dbpedia.org/> PREFIX dbpedia3: <http://dbpedia.org/ontology/> SELECT distinct ?name ?birth ?person WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> . ?person dbpedia2:birthDate ?birth . ?person foaf:name ?name . } ORDER BY ?name Result: Plenty of them! ex: "René Laloux"@en1929-07-13http://dbpedia.org/resource/Ren%C3%A9_Laloux
  • 3. Query 2 Objective: Find all the people born in Paris after 1970 by using FILTER PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbpedia: <http://dbpedia.org/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia3: <http://dbpedia.org/ontology/> SELECT distinct ?name ?person ?birthDate WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Paris> . ?person foaf:name ?name . ?person dbpedia2:birthDate ?birthDate . FILTER (1970 < ?birthDate) } ORDER BY ?birthDate Result: "Jules de Balincourt"@enhttp://dbpedia.org/resource/Jules_de_Balincourt"1972"^^<http://www.w3.org/2001/XMLSchema#int> "Phoebe Philo"@enhttp://dbpedia.org/resource/Phoebe_Philo"1973"^^<http://www.w3.org/2001/XMLSchema#int> "Caroline Ducey"@enhttp://dbpedia.org/resource/Caroline_Ducey"1977"^^<http://www.w3.org/2001/XMLSchema#int>
  • 4. Query 3 Objective: Find all the solo singer who were born in London PREFIX dbpedia3: <http://dbpedia.org/ontology/> SELECT distinct ?name ?birthdate ?person WHERE { ?person dbpedia3:birthPlace <http://dbpedia.org/resource/London> . ?person dbpedia3:birthDate ?birthdate . ?person dbpedia3:background "solo_singer"@en . ?person foaf:name ?name . } ORDER BY ?name
  • 5. Query 4 Objective: Find all the people born in Brest using FILTER regex PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia: <http://dbpedia.org/> PREFIX dbpedia3: <http://dbpedia.org/ontology/> SELECT distinct ?name ?person ?birthPlace WHERE { ?person foaf:name ?name . ?person dbpedia2:birthPlace ?birthPlace FILTER regex (?birthPlace, "Brest") } ORDER BY ?name Result : "Alex Thepot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alex Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexand re Coeff"@enhttp://dbpedia.org/resource/Alexandre_Coeffhttp://dbpedia.org/resource/Brest,_Finist%C3%A8re"Alexis Thépot"@enhttp://dbpedia.org/resource/Alex_Th%C3%A9pothttp://dbpedia.org/resource/Brest,_Finist%C3%A8re
  • 6. Query 5 Objective: Find the solo artists who did concert tours of more than 200 shows PREFIX dbpedia2: <http://dbpedia.org/property/> SELECT distinct ?tour ?artist ?numberOfShows WHERE { ?tour dbpedia2:artist ?artist . ?artist dbpedia2:background "solo_singer"@en . ?tour dbpedia2:numberOfShows ?numberOfShows . FILTER (?numberOfShows > 200) } ORDER BY ?numberOfShows Several results (Bob Dylan, Cher, Lady Gaga...)
  • 7. Query Simpsons • Find out all the chalk gag that Bart wrote on the blackboard! – http://www.snee.com/bobdc.blog/2008/10/learning-more-about-sparql.html – http://www.snee.com/bobdc.blog/2007/11/querying-dbpedia.html – http://dbpedia.org/page/Category:The_Simpsons_episodes • We didn’t succeed in doing this within our limited working hours. So if you are interested, try it out! These links are useful for you!