The current live instance of DBpedia has just received dose #1 of a series
of planned "Context" oriented booster shots. These shots
seek to to protect DBpedia from contextual incoherence as it
grows in data set
expanse and popularity. Dose #1 (vaccine label: Yago) equips DBpedia with a functional (albeit non
exclusive) Data Dictionary component courtesy of the Yago Class Hierarchy .
When the DBpedia & Yago integration took place last year (around
WWW2007, Banff) there was a little, but costly omission that
occurred: nobody sought to load the Yago Class Hierarchy into the Virtuoso's Inference Engine :-(
Anyway, the Class Hierarchy has now been loaded into the
Virtuoso's inference engine (as Virtuoso
Inference Rules) and the following queries are now feasible using
the live Virtuoso based DBpedia instance hosted by OpenLink Software:
-- Find all Fiction Books associated with a property
"dbpedia:name" that has literal value: "The Lord of the
Rings" .
DEFINE input:inference
"http://dbpedia.org/resource/inference/rules/yago#"
PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbpedia:
<http://dbpedia.org/property>
PREFIX yago:
<http://dbpedia.org/class/yago>
SELECT DISTINCT
?s
FROM < xmlns="http"
dbpedia.org="dbpedia.org">//dbpedia.org>
WHERE
{
?s a
yago:Fiction106367107 .
?s dbpedia:name "The
Lord of the Rings"@en .
}
-- Variant of query with Virtuoso's Full Text Index extension via the
bif:contains function/magic predicate
DEFINE input:inference
"http://dbpedia.org/resource/inference/rules/yago#"
PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbpedia:
<http://dbpedia.org/property>
PREFIX yago:
<http://dbpedia.org/class/yago>
SELECT DISTINCT ?s
?n
FROM < xmlns="http"
dbpedia.org="dbpedia.org">//dbpedia.org>
WHERE
{
?s a
yago:Fiction106367107 .
?s dbpedia:name ?n
.
?n bif:contains 'Lord
and Rings'
}
-- Retrieve all individuals instances of Fiction Class which
should include all Books.
DEFINE input:inference
"http://dbpedia.org/resource/inference/rules/yago#"
PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbpedia:
<http://dbpedia.org/property>
PREFIX yago:
<http://dbpedia.org/class/yago>
SELECT DISTINCT
?s
FROM
< xmlns="http"
dbpedia.org="dbpedia.org">//dbpedia.org>
WHERE
{
?s a
yago:Fiction106367107 .
}
LIMIT 50
Note: you can also move the inference pragmas to the Virtuoso
Sever side i.e place the inference rules in a server instance
config file, thereby negating the need to place "define
input:inference
'http://dbpedia.org/resource/inference/rules/yago#'" pragmas
directly in your SPARQL queries.
Related