Adding Graph Rules using RGML and Logic Primitives
Tim Berners-Lee has designed a new language, Notation 3
[NOT3]
to describe the RDF data model
[RDF] . Using Notation
3, we can add logic primitives to RGML to generate RDF properties [RDFS]
that are commonly used to describe graph information such as, cycle, adjacent,
path, etc. We will add simple rules to define two graph concepts: adjacency
and paths between nodes. The latter is a modification of the example given
by the Euler proof engine [EULER]
Two nodes are adjacent if they are connected by an edge. This can be
expressed using two simple rules, where e is an edge, and u and v are nodes:
Using Notation 3 we can express these rules as:
A path is a sequence of consecutive nodes in a graph. Two nodes, u and
v, are said to be consecutive if there is a directed edge from u to v,
where u is the parent of v (rule 1). The second rule states that if the
node u is the parent of the node v, there is a directed path from u to
v. The third, a recursive rule, states the condition for the existence
of a path from nodes u to w. These three rules are the following (where
u, v, w are nodes; e is an edge and g is a graph) :
Using Notation 3 we can express these rules as:
To express the rules we use the logic properties log:implies and log:forAll
that are part of the logic schema
[NOT3] . We use the
cwm engine [CWM] to process these rules on a simple
graph expressed in RGML.