On the Mutually Beneficial Nature of DBpedia and Wikidata

https://clientmanagementvn.files.wordpress.com/2013/09/partnerships-in-ad-agency-client-relationship-at-theoutsideviewblog-com-e13300335017541.jpg

DBpedia and Wikidata are two related and similar, but still very different, Linked Data projects, both built around Wikipedia.

DBpedia’s focus is on generating Linked Open Data from Wikipedia documents.

Wikidata’s focus is on creating Linked Open (meta)Data to supplement Wikipedia documents.

Both projects provide access to their respective Linked Open Data via SPARQL Query Service endpoints.

Best of all, DBpedia and Wikidata are extremely complementary — filling in different gaps — when it comes to collecting a broad range of information about topics of interest.

Here, I offer a simple demonstration of the mutually beneficial nature of these two projects, through a Federated SPARQL Query that will combine data from both of these rich data sources.

Demo Tools

What is a SPARQL Query Service Endpoint?

Database Management Systems (DBMS) and other Stores that support the functionality described above are generally referred to as supporting the SPARQL Query Language, Protocol, and Results Serialization formats (HTML Tables, CSV, JSON, XML, RDF-Turtle, RDF-XML, JSON-LD, HTML+Microdata, HTML+JSON-LD, HTML+Turtle, HTML+RDF+XML, etc.).

Example Scenario

Wikidata SPARQL Query

#defaultView:ImageGrid
# Items in the Messier Catalog
SELECT DISTINCT ?item
?itemLabel
?numero
( SAMPLE(?pic) AS ?picture )
WHERE
{
?item p:P528 ?catalogStatement .
?catalogStatement ps:P528 ?numero .
?catalogStatement pq:P972 wd:Q14530 .
OPTIONAL {?item wdt:P18 ?pic } .
SERVICE wikibase:label
{ bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?itemLabel ?numero
ORDER BY ?numero

Here’s the Live Query Definition Link running on Wikidata, and a Federated SPARQL Query variant on URIBurner.

Federated SPARQL Query, incorporating data from both DBpedia & Wikidata

PREFIX        wd:  <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT DISTINCT ?dbpediaID AS ?href
xsd:string(?label) AS ?name
?description
?subjectText
?item AS ?wikidataID
?dbpediaID
?image
?picture
WHERE
{
SERVICE <http://query.wikidata.org/sparql>
{
SELECT DISTINCT ?item
?itemLabel
?numero
( SAMPLE(?pic) AS ?picture )
WHERE
{
?item p:P528 ?catalogStatement .
?catalogStatement ps:P528 ?numero .
?catalogStatement pq:P972 wd:Q14530 .
OPTIONAL { ?item wdt:P18 ?pic } .
SERVICE wikibase:label
{ bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?itemLabel ?numero
ORDER BY ?numero
}

SERVICE <http://dbpedia.org/sparql>
{
SELECT ?item
?dbpediaID
?label
?image
?description
?subjectText
FROM <http://dbpedia.org>
WHERE
{
?dbpediaID owl:sameAs ?item ;
rdfs:label ?label ;
foaf:depiction ?image ;
rdfs:comment ?description ;
dct:subject
[ rdfs:label ?subjectText ] .
FILTER ( LANG(?label) = "en" )
FILTER ( LANG(?description) = "en" )
}
}
}

Here’s the Live Query Definition Link (whitespace adjusted from the above, to accommodate limits of Medium.com’s link redirector in some browsers).

I can now use the federated query to produce a nice drill-down-oriented data visualization page in OpenLink’s HTML5 PivotViewer, which enables:

  • Visually-aided filtering, using Entity Relationship Types (i.e., attributes) to group the merged data
  • Isolating items of interest, once found, with exit available to either DBpedia or Wikidata
  • Sharing chosen aspects of this visualization using hyperlinks

Here are some screenshots that illustrate what I’ve outlined above.

Click here to access Live Edition — Selecting a tile leads to a link to DBpedia
Click here to access Live Edition — Selecting a tile leads to a link to Wikidata
Visually Filtering by Subject Matter Heading
Specific Galaxy of Interest

Conclusion

  • Powerful cross references that provide richer insights
  • Application portability — i.e., we have an HTML5 based PivotViewer that visualizes data from either (or both!) data sources, without any source-specific application modification or tuning
  • Significant demonstrations of the power of Federated SPARQL Queries

Links

Related

OpenLink Virtuoso Weblog

News & Articles related to OpenLink Virtuoso & Related…

OpenLink Virtuoso Weblog

News & Articles related to OpenLink Virtuoso & Related Technologies

Kingsley Uyi Idehen

Written by

CEO, OpenLink Software —High-Performance Data Centric Technology Providers.

OpenLink Virtuoso Weblog

News & Articles related to OpenLink Virtuoso & Related Technologies