Mining relations from DBpedia

DBpedia is one of the best-known sources of Linked Data. Based on Wikipedia, it augments the content of the popular wiki-based encyclopedia with semantic connections between entities. The structured information from DBpedia can be accessed via the Web using a SQL-like language called SPARQL, a semantic query language for RDF.

In Python, while we have the option of querying the database with SPARQL, we can take advantage of the RDFLib package, a library used to work with RDF.

From our virtual environment, we can install it using pip:

$ pip install rdflib

Given the complexity of the Semantic Web topic, we prefer to dig into an example so that you can have the flavor of the capabilities of DBpedia, and at the same time, ...

Get Mastering Social Media Mining with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.