Database Reference
In-Depth Information
The table function named RDF_MATCH
takes four parameters. The first parameter is a
graph pattern to be matched. This graph pattern
is defined with a syntax similar to the clause
WHERE of SPARQL (basically a set of triples
with variables). The second parameter specifies
the RDF graph to be queried. The third parameter
specifies the rulebase (if any) that must be used
to infer new RDF data. A rulebase is composed
of a set of rules. Each rule consists of a left hand
side graph pattern for the antecedents, filter condi-
tions, and a right hand side graph pattern for the
consequents. Notice that RDF-Schema inference
rules (e.g, transitive closure of the subsumption
relationship) is created by the system (named rdfs)
and available to users. Finally, the last parameter
specifies user-defined namespaces aliases. The
RDF_MATCH function returns a table having a
column for each variable used in the graph pattern.
Thus, this function can be seamlessly combined
with SQL queries.
A strong effort has been made to optimize the
RDF_MATCH function. Indeed, this function
is rewritten has a SQL query so that it can be
optimized with the rest of the query. Moreover,
indexes and materialized views are used to execute
efficiently queries. Scalability of the proposed
approach has been demonstrated on 80 million
RDF triples.
search instances of the class Item (?i). This func-
tion returns a table with a column named i for the
variable ?i. This variable can be projected in the
SELECT clause.
Like SPARQL, result of the previous query
depends on the triple represented in the RDF data
source. For the RDF_MATCH function, it de-
pends also of the rulebase specified. Indeed, if we
specify the rdfs rulebase in the previous example,
all (direct and indirect) instances of Item will be
returned (the transitive closure of the subsumption
relationship is computed by a rule).
Requirement 2 (Definition of
Non Canonical Concepts)
The data manipulation language of SQL can be
used to define the non canonical class PostDupont
A rule can be used to compute automatically its
extension (set of instances). Example 2 . Create
the class PostDupont defined as all messages
of the user Dupont.
INSERT INTO rdf_example
VALUES ('PostDupont',
rdf:type, rdfs:Class)
SELECT i FROM TABLE(
RDF_MATCH('(?i rdf:type PostDu-
pont)', NULL, rb_example, NULL)
Requirement 1 (Queries at
the Ontological Level)
The rulebase rb_example contains the fol-
lowing rule:
The RDF_MATCH function can be used to express
ontological queries decomposed in a triples pattern.
Example . Retrieve instances of the class Item.
('(?p rdf:type Post)(?p has_creator
?c)',
'?c = Dupont',
'(?p rdf:type PostDupont)')
SELECT t.i
FROM TABLE(RDF_MATCH('(?i rdf:type
Item)', NULL, NULL, NULL))
Explanation . In this example, we suppose that a
table named rdf_example has been created to store
RDF data. An Insert statement is used to insert
the class PostDupont. Instances of PostDupont
can be retrieved through a SQL query that uses
the RDF_MATCH function. This function infers
Explanation . The table function RDF_MATCH
is used in the clause FROM of the query. It only
takes a simple graph pattern as parameter to
Search WWH ::




Custom Search