Python and Linked Data: Leveraging SPARQL for Knowledge Retrieval

leveraging linked data using python and sparql n.w
1 / 16
Embed
Share

Discover how Python can be used to extract and manipulate data from linked sources like Wikipedia, DBpedia, and Wikidata. Learn about the power of SPARQL for querying structured information and the significance of Semantic Web technologies in data mining for machine learning and natural language processing applications.

  • Python
  • Linked Data
  • SPARQL
  • Wikipedia
  • Semantic Web

Uploaded on | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. LEVERAGING LINKED DATA USING PYTHON AND SPARQL Nabanita Roy EuroPython2021

  2. WIKIPEDIA Multidomain Multilingual Freely accessible Automatically evolving

  3. HOW TO GET DATA FROM WIKIPEDIA? Linked Data Using SPARQLWrapper Web Scraping Using BeautifulSoup or Wikipedia Python Library

  4. DEMO: WIKIPEDIA PYTHON LIBRARY Notebook Link

  5. DBpedia is a crowd-sourced community effort to extract structured information from Wikipedia and make this information available on the Web in the form of Linked Data.

  6. Wikidata is a free and open knowledge base that can be read and edited by both humans and machines.

  7. LINKED DATA

  8. A CLOSER LOOK New York location http://www.pyladies.com/ Website link PyLadies location Dublin location External link London Python Programming Language type Organization location Designer type type Guido van Rossum type WAI WWC WIC

  9. WHY Contains knowledge from Wikipedia DBPEDIA Semantics of information Easily Accessible OR Python wrapper available WIKIDATA? Data Mining for ML or NLP

  10. Semantic query language to retrieve and manipulate data stored in RDF format. S P A R Q L PARQL rotocol Resource Description Framework nd DF standard model for data interchange on the Web Data Representation Format : Triple uery subject predicate object python type programming language anguage

  11. https://en.wikipedia.org/wiki/PyLadies URI URL https://dbpedia.org/page/PyLadies Vocabulary DBO DBR FOAF SKOS Dublin Core

  12. SPARQL PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX dbp: <http://dbpedia.org/property/> PREFIX ling: <http://purl.org/linguistics/gold/> SELECT DISTINCT ?a, ?dob, ?ht, ?hpn, ?g, ?name, ?c, ?intro WHERE { PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX dbp: <http://dbpedia.org/property/> SELECT DISTINCT ?a, ?dob, ?ht, ?name, ?c, ?intro SELECT ?subject, ?predicate, ?object WHERE { ?subject ?predicate ?object . } ?a a dbo:Athlete; dbo:birthDate ?dob; dbo:height ?ht; ling:hypernym ?hpn; foaf:gender ?g; foaf:name ?name; dbo:abstract ?intro. OPTIONAL{?a dbo:country ?c} FILTER(LANG(?name) = "en"). } LIMIT 10000 OFFSET 0 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?entity, ?name WHERE {?entity rdfs:label ?name .} WHERE { ?a a dbo:Athlete; dbo:birthDate ?dob; dbo:height ?ht; foaf:name ?name; dbo:abstract ?intro. OPTIONAL{?a dbo:country ?c} FILTER(LANG(?name) = "en"). } LIMIT 10000 OFFSET 0

  13. Demo : SPARQLWrapper Notebook Link

  14. Demo : Corpora Generation using SPARQLWrapper and Wikipedia Python Library Notebook Link

  15. THANK YOU QA

  16. REFERENCES Introduction to Linked Data: RDF Vocabularies (slideshare.net) http://risis.eu/wp-content/uploads/2017/03/linked-data-sparql.pdf Constructing SPARQL Queries. From simple queries to federated | by Angus Addlesee | Wallscope | Medium https://www.wikidata.org/wiki/Wikidata:Main_Page

More Related Content