Aldo,
The attached file contains an efficient procedure that keeps simple
cases of graphs with bnodes. First it compares all triples without
bnodes, then it iteratively establishes equivalences between bnodes that
are directly and unambiguously connected to equivalent vertexes by
identical predicates.
Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com
On Tue, 2009-10-13 at 03:57 -0300, Aldo Bucchi wrote:
> Hi Ivan,
>
> On Sun, Oct 11, 2009 at 3:50 AM, Ivan Mikhailov
> <[email protected]> wrote:
> > Hello Aldo,
> >
> > Yes, some low-level tricks could be possible. But it depends on two
> > things.
> >
> > 1) What are sizes of graphs in question?
>
> Initially they will be small. 1000 triples or less.
> I want to use this for a minimalistic unit testing framework I am
> putting together.
> http://code.google.com/p/vunit/
>
> Here's the specific piece where graph comparison should be
> http://code.google.com/p/vunit/source/browse/vunit.sql#181
>
> I hope I can gain some insight on best practices you use at OLS when
> coding V PL by collaborating on this framework, so feel free to leave
> annotations (using that very same source browser) and/or clone the
> project to make modifications.
> This is something I put together in a couple of hours, so I really
> expect it to evolve quite a bit, and fast.
>
> We need it because coding in something as powerful as SPASQL with no
> IDE is suicide unless you test properly.
>
> >
> > 2) With BNodes, what's the needed criterion to decide wither two BNodes
> > are equivalent?
>
> Hmm. For my particular use case, I just figured I can abritrarily
> forget about bnodes ( at least for the first version ).
> However, I understand there is a formal algorithm for Graph
> equivalence, as per this spec doc:
>
> http://www.w3.org/TR/rdf-concepts/
>
> [quote]
> 6.3 Graph Equivalence
>
> Two RDF graphs G and G' are equivalent if there is a bijection M
> between the sets of nodes of the two graphs, such that:
>
> 1. M maps blank nodes to blank nodes.
> 2. M(lit)=lit for all RDF literals lit which are nodes of G.
> 3. M(uri)=uri for all RDF URI references uri which are nodes of G.
> 4. The triple ( s, p, o ) is in G if and only if the triple ( M(s),
> p, M(o) ) is in G'
>
> With this definition, M shows how each blank node in G can be replaced
> with a new blank node to give G'.
> [endquote]
>
> Regards,
> A
>
> >
> > Best Regards,
> >
> > Ivan Mikhailov
> > OpenLink Software
> > http://virtuoso.openlinksw.com
> >
> > On Sun, 2009-10-11 at 02:07 -0300, Aldo Bucchi wrote:
> >> Hi,
> >>
> >> What would be a PERFORMANT way of testing graph equality for two
> >> graphs in the Quad store?
> >> * A: without BNodes
> >> * B: with BNodes
> >>
> >> I am now using SPARUL and temp graphs to generate a diff, but I
> >> imagine there is a better way ( using low level APIs perhaps? ).
> >>
> >> Regards,
> >> A
> >>
> >
> >
>
>
>
-- Fast Approximate RDF Graph Equivalence Test
-- (C) 2009 OpenLink Software
-- License: GNU General Public License (only version 2 of the license).
-- No warranty, even implied warranty
-- This compares the content of triple dictionaries \c dict1 and \c dict2,
-- returns NULL if no difference found (with bnode equivalence in mind),
-- returns description of a difference otherwise.
-- The function is experimental (note suffix _EXP), so no accurate QA is made.
-- Some version of the function may be inserted later in OpenLink Virtuoso Server under some different name.
create function DB.DBA.RDF_TRIPLE_DICTS_DIFFER_EXP (
in dict1 any, --- Triple dictionary, traditional, (vectors of S, P, O are keys, any non-nulls are values)
in dict2 any, --- Second triple dictionary, like to \c dict1
in accuracy integer, --- Accuracy, 0 if no bnodes expected, 1 if "convenient" trees with intermediate bnodes expected, 2 and more are not yet implemented
in equiv_map any := null, --- If specified then it contain mapping from IRI_IDs of bnodes of \c dict1 to equivalent IRI_IDs of bnodes of \c dict1.
-- It can be extended during the run so use dict_duplicate() before call if needed.
in equiv_rev any := null --- If specified then it is an inverted dictionary of \c equiv_map (this time \c dict2 bnodes are keys and \c dict1 bnodes are values)
)
{
declare dict_size1, dict_size2 integer;
declare old_dirt_level, dirt_level integer;
declare ctr, tailctr, sp_made_new_equiv integer;
declare array1, array2, dict2_sp, dict1_op, dict2_op, array1_op any;
dict_size1 := dict_size (dict1);
dict_size2 := dict_size (dict2);
dict2 := dict_duplicate (dict2);
if (dict_size1 <> dict_size2)
return 'Sizes differ';
if (equiv_map is null)
{
equiv_map := dict_new (dict_size1);
equiv_rev := dict_new (dict_size1);
}
old_dirt_level := dict_size1 - dict_size (equiv_map);
array1 := dict_list_keys (dict1, 0);
next_loop:
-- Step 1: removing triples with all three items matched
ctr := dict_size1-1;
while (ctr >= 0)
{
declare s_in_1, o_in_1, s_in_2, o_in_2, triple_in_2 any;
s_in_1 := array1[ctr][0];
o_in_1 := array1[ctr][2];
if (is_bnode_iri_id (s_in_1))
{
s_in_2 := dict_get (equiv_map, s_in_1, null);
if (s_in_2 is null)
goto next_full_eq_check;
}
else
s_in_2 := s_in_1;
if (is_bnode_iri_id (o_in_1))
{
o_in_2 := dict_get (equiv_map, o_in_1, null);
if (o_in_2 is null)
goto next_full_eq_check;
}
else
o_in_2 := o_in_1;
triple_in_2 := vector (s_in_2, array1[ctr][1], o_in_2);
if (dict_get (dict2, triple_in_2, null) is null)
return vector (array1[ctr], ' is in first, ', triple_in_2, ' is missing in second');
dict_remove (dict2, triple_in_2);
if (ctr < dict_size1-1)
array1[ctr] := array1[dict_size1-1];
dict_size1 := dict_size1-1;
next_full_eq_check:
ctr := ctr-1;
}
-- Step 1 end, garbage truncated:
if ((0 = dict_size1) or (0 = accuracy))
return null;
if (dict_size1 < length (array1))
array1 := subseq (array1, 0, dict_size1);
if (dict_size (dict2) <> dict_size1)
signal ('OBLOM', 'Internal error: sizes of graphs suddenly differ');
-- Step 2: establishing equivs between not-yet-coupled bnodes that are values of functional predicates of coupled subjects
sp_made_new_equiv := 0;
dict2_sp := dict_new (dict_size1);
array2 := dict_list_keys (dict2, 0);
for (ctr := dict_size1-1; ctr >= 0; ctr := ctr-1)
{
declare sp2, o2, prev_uniq_o2 any;
sp2 := vector (array2[ctr][0], array2[ctr][1]);
prev_uniq_o2 := dict_get (dict2_sp, sp2, null);
if (prev_uniq_o2 is null)
{
o2 := array2[ctr][2];
if (is_bnode_iri_id (o2))
dict_put (dict2_sp, sp2, o2);
else
dict_put (dict2_sp, sp2, #i0);
}
else if (prev_uniq_o2 <> #i0)
dict_put (dict2_sp, sp2, #i0);
}
rowvector_subj_sort (array1, 0, 1);
rowvector_subj_sort (array1, 1, 1);
rowvector_subj_sort (array2, 1, 1);
ctr := 0;
while (ctr < dict_size1)
{
declare s_in_1, o_in_1, s_in_2, o_in_2, o_in_dict2_sp, o_in_dict2_sp_in_1 any;
tailctr := ctr+1;
if (array1[ctr][1] <> array2[ctr][1])
{
if (array1[ctr][1] > array2[ctr][1])
return vector ('Cardinality of predicate ', array2[ctr][1], ' is greater in second than in first');
else
return vector ('Cardinality of predicate ', array1[ctr][1], ' is greater in first than in second');
}
while ((tailctr < dict_size1) and
(array1[tailctr][0] = array1[ctr][0]) and
(array1[tailctr][1] = array1[ctr][1]) )
tailctr := tailctr+1;
if ((tailctr - ctr) > 1)
goto next_sp_check;
o_in_1 := array1[ctr][2];
if (not is_bnode_iri_id (o_in_1))
goto next_sp_check;
o_in_2 := dict_get (equiv_map, o_in_1, null);
if (o_in_2 is not null)
goto next_sp_check;
s_in_1 := array1[ctr][0];
if (is_bnode_iri_id (s_in_1))
{
s_in_2 := dict_get (equiv_map, s_in_1, null);
if (s_in_2 is null)
goto next_sp_check;
}
else
s_in_2 := s_in_1;
o_in_dict2_sp := dict_get (dict2_sp, vector (s_in_2, array1[ctr][1]), null);
if (o_in_dict2_sp is null)
return vector (vector (s_in_1, array1[ctr][1], o_in_1), ' is unique SP in first, ', vector (s_in_2, array1[ctr][1]), ' is missing SP in second');
if (o_in_dict2_sp = #i0)
return vector (vector (s_in_1, array1[ctr][1], o_in_1), ' is unique SP in first, ', vector (s_in_2, array1[ctr][1]), ' is not unique SP-to-bnode in second');
o_in_dict2_sp_in_1 := dict_get (equiv_rev, o_in_dict2_sp, null);
if (o_in_dict2_sp_in_1 is not null)
{
if (o_in_dict2_sp_in_1 = o_in_1)
goto next_sp_check;
return vector (vector (s_in_1, array1[ctr][1], o_in_1), ' is unique SP in first, ', vector (s_in_2, array1[ctr][1], o_in_dict2_sp), ' is unique SP in second but ', o_in_dict2_sp, ' rev-equiv to ', o_in_dict2_sp_in_1);
}
dict_put (equiv_map, o_in_1, o_in_dict2_sp);
dict_put (equiv_rev, o_in_dict2_sp, o_in_1);
sp_made_new_equiv := sp_made_new_equiv + 1;
next_sp_check:
ctr := tailctr;
}
dict_list_keys (dict2_sp, 2);
-- Step 2 end
if (sp_made_new_equiv * 10 > dict_size1)
goto next_loop; -- If dictionary is noticeably extended then it's worth to remove more triples before continue.
-- Step 3: establishing equivs between not-yet-coupled bnodes that are subjects of inverse functional properties with coupled objects.
dict1_op := dict_new (dict_size1);
for (ctr := dict_size1-1; ctr >= 0; ctr := ctr-1)
{
declare op1, s1, prev_uniq_s1 any;
op1 := vector (array1[ctr][2], array1[ctr][1]);
prev_uniq_s1 := dict_get (dict1_op, op1, null);
if (prev_uniq_s1 is null)
{
s1 := array1[ctr][0];
if (is_bnode_iri_id (s1))
dict_put (dict1_op, op1, s1);
else
dict_put (dict1_op, op1, #i0);
}
else if (prev_uniq_s1 <> #i0)
dict_put (dict1_op, op1, #i0);
}
array1_op := dict_to_vector (dict1_op, 2);
dict2_op := dict_new (dict_size1);
for (ctr := dict_size1-1; ctr >= 0; ctr := ctr-1)
{
declare op2, s2, prev_uniq_s2 any;
op2 := vector (array2[ctr][2], array2[ctr][1]);
prev_uniq_s2 := dict_get (dict2_op, op2, null);
if (prev_uniq_s2 is null)
{
s2 := array2[ctr][0];
if (is_bnode_iri_id (s2))
dict_put (dict2_op, op2, s2);
else
dict_put (dict2_op, op2, #i0);
}
else if (prev_uniq_s2 <> #i0)
dict_put (dict2_op, op2, #i0);
}
ctr := length (array1_op) - 2;
while (ctr >= 0)
{
declare o_in_1, s_in_1, o_in_2, s_in_2, s_in_dict2_op, s_in_dict2_op_in_1 any;
s_in_1 := array1_op[ctr+1];
if (not is_bnode_iri_id (s_in_1))
goto next_op_check;
s_in_2 := dict_get (equiv_map, s_in_1, null);
if (s_in_2 is not null)
goto next_op_check;
o_in_1 := array1_op[ctr][0];
if (is_bnode_iri_id (o_in_1))
{
o_in_2 := dict_get (equiv_map, o_in_1, null);
if (o_in_2 is null)
goto next_op_check;
}
else
o_in_2 := o_in_1;
s_in_dict2_op := dict_get (dict2_op, vector (o_in_2, array1_op[ctr][1]), null);
if (s_in_dict2_op is null)
return vector (vector (s_in_1, array1_op[ctr][1], o_in_1), ' is unique OP in first, ', vector (o_in_2, array1_op[ctr][1]), ' is missing OP in second');
if (s_in_dict2_op = #i0)
return vector (vector (s_in_1, array1_op[ctr][1], o_in_1), ' is unique OP in first, ', vector (o_in_2, array1_op[ctr][1]), ' is not unique OP-to-bnode in second');
s_in_dict2_op_in_1 := dict_get (equiv_rev, s_in_dict2_op, null);
if (s_in_dict2_op_in_1 is not null)
{
if (s_in_dict2_op_in_1 = s_in_1)
goto next_op_check;
return vector (vector (s_in_1, array1_op[ctr][1], o_in_1), ' is unique OP in first, ', vector (s_in_dict2_op, array1[ctr][1], o_in_2), ' is unique OP in second but ', s_in_dict2_op, ' rev-equiv to ', s_in_dict2_op_in_1);
}
dict_put (equiv_map, s_in_1, s_in_dict2_op);
dict_put (equiv_rev, s_in_dict2_op, s_in_1);
next_op_check:
ctr := ctr - 2;
}
dict_list_keys (dict2_op, 2);
-- Step 3 end
dirt_level := dict_size1 - dict_size (equiv_map);
if (dirt_level >= old_dirt_level)
return vector (vector (array1[0][0], array1[0][1], array1[0][2]), ' has no matches in second with the requested accuracy');
old_dirt_level := dirt_level;
goto next_loop;
}
;
create function DB.DBA.RDF_GRAPHS_DIFFER_EXP (in g1_uri varchar, in g2_uri varchar, in accuracy integer)
{
return DB.DBA.RDF_TRIPLE_DICTS_DIFFER_EXP (
(sparql define output:valmode "LONG" construct { ?s ?p ?o } where { graph `iri(?:g1_uri)` { ?s ?p ?o }}),
(sparql define output:valmode "LONG" construct { ?s ?p ?o } where { graph `iri(?:g2_uri)` { ?s ?p ?o }}),
accuracy );
}
;
-- The rest of file contains some minimal tests.
set verbose off;
set banner off;
set types off;
create function DB.DBA.DICT_EXTEND_WITH_KEYS (in dict any, in keys any)
{
if (dict is null)
dict := dict_new (length (keys));
foreach (any k in keys) do
dict_put (dict, k, 1);
return dict;
}
;
create function DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP (in title varchar, in should_differ integer, in v1 any, in v2 any, in accuracy integer)
{
declare d1, d2, eqm, eqr, differ_status any;
d1 := DB.DBA.DICT_EXTEND_WITH_KEYS (null, v1);
d2 := DB.DBA.DICT_EXTEND_WITH_KEYS (null, v2);
eqm := dict_new (10);
eqr := dict_new (10);
dbg_obj_princ ('===== ' || title);
differ_status := DB.DBA.RDF_TRIPLE_DICTS_DIFFER_EXP (d1, d2, accuracy, eqm, eqr);
dbg_obj_princ ('Result: ', differ_status);
if (0 < dict_size (eqm))
dbg_obj_princ ('Equivalence map: ', dict_to_vector (eqm, 0));
dbg_obj_princ ('Equivalence rev: ', dict_to_vector (eqr, 0));
return sprintf ('%s: %s',
case when (case when should_differ then equ (0, isnull (differ_status)) else isnull (differ_status) end) then 'PASSED' else '***FAILED' end,
title );
}
;
create function DB.DBA.TEST_RDF_GRAPHS_DIFFER_EXP (in title varchar, in should_differ integer, in g1_uri varchar, in g2_uri varchar, in accuracy integer)
{
declare differ_status any;
differ_status := DB.DBA.RDF_GRAPHS_DIFFER_EXP (g1_uri, g2_uri, accuracy);
dbg_obj_princ ('Result: ', differ_status);
return sprintf ('%s: %s',
case when (case when should_differ then equ (0, isnull (differ_status)) else isnull (differ_status) end) then 'PASSED' else '***FAILED' end,
title );
}
;
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Identical graphs', 0,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i200, 1) ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i200, 1) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Sizes differ', 1,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i200, 1) ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i200, 1),
vector (#i101, #i201, #i301) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Cardinality of a pred differ', 1,
vector (
vector (#i100, #i200, #ib300),
vector (#i101, #i200, #ib302),
vector (#i103, #i201, #ib304),
vector (#ib109, #i200, #ib109) ),
vector (
vector (#i100, #i200, #ib301),
vector (#i101, #i200, #ib303),
vector (#i103, #i201, #ib305),
vector (#ib109, #i201, #ib109) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Bnodes in O with unique SP (equiv)', 0,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i101, #i201, #ib301),
vector (#i102, #i202, #ib303),
vector (#ib303, #i204, #i306),
vector (#ib303, #i205, #ib305),
vector (#i100, #i200, 1) ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i101, #i201, #ib302),
vector (#i102, #i202, #ib304),
vector (#ib304, #i204, #i306),
vector (#ib304, #i205, #ib306),
vector (#i100, #i200, 1) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Bnodes in O with unique SP (diff 1)', 1,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i102, #i202, #ib303),
vector (#ib303, #i204, #i306),
vector (#ib303, #i205, #ib305),
vector (#i100, #i200, 1) ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i102, #i202, #ib304),
vector (#ib304, #i204, #i306),
vector (#ib304, #i205, #i306),
vector (#i100, #i200, 1) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'Bnodes in O with unique SP (diff 2)', 1,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i102, #i202, #ib303),
vector (#ib303, #i204, #i306),
vector (#ib303, #i205, #ib305),
vector (#i100, #i200, 1) ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i102, #i202, #ib304),
vector (#ib304, #i204, #i306),
vector (#ib304, #i205, #ib304),
vector (#i100, #i200, 1) ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'foaf-like-mix (equiv)', 0,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i100, #i201, #ib303),
vector (#i100, #i201, #ib305),
vector (#i100, #i201, #ib307),
vector (#ib301, #i202, 'Anna'),
vector (#ib303, #i202, 'Anna'),
vector (#ib305, #i202, 'Brigit'),
vector (#ib307, #i202, 'Clara'),
vector (#ib301, #i203, '[email protected]'),
vector (#ib303, #i203, '[email protected]'),
vector (#ib305, #i203, '[email protected]'),
vector (#ib307, #i203, '[email protected]') ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i100, #i201, #ib304),
vector (#i100, #i201, #ib306),
vector (#i100, #i201, #ib308),
vector (#ib302, #i202, 'Anna'),
vector (#ib304, #i202, 'Anna'),
vector (#ib306, #i202, 'Brigit'),
vector (#ib308, #i202, 'Clara'),
vector (#ib302, #i203, '[email protected]'),
vector (#ib304, #i203, '[email protected]'),
vector (#ib306, #i203, '[email protected]'),
vector (#ib308, #i203, '[email protected]') ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'foaf-like-mix (swapped names)', 1,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i100, #i201, #ib303),
vector (#i100, #i201, #ib305),
vector (#i100, #i201, #ib307),
vector (#ib301, #i202, 'Anna'),
vector (#ib303, #i202, 'Anna'),
vector (#ib305, #i202, 'Brigit'),
vector (#ib307, #i202, 'Clara'),
vector (#ib301, #i203, '[email protected]'),
vector (#ib303, #i203, '[email protected]'),
vector (#ib305, #i203, '[email protected]'),
vector (#ib307, #i203, '[email protected]') ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i100, #i201, #ib304),
vector (#i100, #i201, #ib306),
vector (#i100, #i201, #ib308),
vector (#ib302, #i202, 'Anna'),
vector (#ib304, #i202, 'Brigit'),
vector (#ib306, #i202, 'Anna'),
vector (#ib308, #i202, 'Clara'),
vector (#ib302, #i203, '[email protected]'),
vector (#ib304, #i203, '[email protected]'),
vector (#ib306, #i203, '[email protected]'),
vector (#ib308, #i203, '[email protected]') ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'foaf-like-mix (swapped names)', 1,
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib301),
vector (#i100, #i201, #ib303),
vector (#i100, #i201, #ib305),
vector (#i100, #i201, #ib307),
vector (#ib301, #i202, 'Anna'),
vector (#ib303, #i202, 'Anna'),
vector (#ib305, #i202, 'Brigit'),
vector (#ib307, #i202, 'Clara'),
vector (#ib301, #i203, '[email protected]'),
vector (#ib303, #i203, '[email protected]'),
vector (#ib305, #i203, '[email protected]'),
vector (#ib307, #i203, '[email protected]') ),
vector (
vector (#i100, #i200, #i300),
vector (#i100, #i201, #ib302),
vector (#i100, #i201, #ib304),
vector (#i100, #i201, #ib306),
vector (#i100, #i201, #ib308),
vector (#ib302, #i202, 'Anna'),
vector (#ib304, #i202, 'Brigit'),
vector (#ib306, #i202, 'Anna'),
vector (#ib308, #i202, 'Clara'),
vector (#ib302, #i203, '[email protected]'),
vector (#ib304, #i203, '[email protected]'),
vector (#ib306, #i203, '[email protected]'),
vector (#ib308, #i203, '[email protected]') ),
100
);
select DB.DBA.TEST_RDF_TRIPLE_DICTS_DIFFER_EXP ( 'bnodes only (equiv that can not be proven)', 1,
vector (
vector (#ib101, #i200, #ib103),
vector (#ib103, #i201, #ib101) ),
vector (
vector (#ib102, #i200, #ib104),
vector (#ib104, #i201, #ib102) ),
100
);
sparql clear graph <http://GraphCmp/One>;
TTLP ('@prefix foaf: <http://i-dont-remember-it> .
_:me
a foaf:Person ;
foaf:knows [ foaf:nick "oerling" ; foaf:title "Mr." ; foaf:sha1 "abra" ] ;
foaf:knows [ foaf:nick "kidehen" ; foaf:title "Mr." ; foaf:sha1 "bra" ] ;
foaf:knows [ foaf:nick "aldo" ; foaf:title "Mr." ; foaf:sha1 "cada" ] .',
'', 'http://GraphCmp/One' );
sparql clear graph <http://GraphCmp/Two>;
TTLP ('@prefix foaf: <http://i-dont-remember-it> .
_:iv
foaf:knows [ foaf:title "Mr." ; foaf:sha1 "cada" ; foaf:nick "aldo" ] ;
foaf:knows [ foaf:sha1 "bra" ; foaf:title "Mr." ; foaf:nick "kidehen" ] ;
foaf:knows [ foaf:nick "oerling" ; foaf:sha1 "abra" ; foaf:title "Mr." ] ;
a foaf:Person .',
'', 'http://GraphCmp/Two' );
select DB.DBA.TEST_RDF_GRAPHS_DIFFER_EXP ( 'nonexisting graphs (equiv, of course)', 0,
'http://GraphCmp/NoSuch', 'http://GraphCmp/NoSuch',
100 );
select DB.DBA.TEST_RDF_GRAPHS_DIFFER_EXP ( 'throughout test on foafs (equiv)', 0,
'http://GraphCmp/One', 'http://GraphCmp/Two',
100 );