Hi Ivan,

On Sun, Oct 11, 2009 at 3:50 AM, Ivan Mikhailov
<imikhai...@openlinksw.com> 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
>>
>
>



-- 
Aldo Bucchi
skype:aldo.bucchi
http://www.univrz.com/
http://aldobucchi.com/

PRIVILEGED AND CONFIDENTIAL INFORMATION
This message is only for the use of the individual or entity to which it is
addressed and may contain information that is privileged and confidential. If
you are not the intended recipient, please do not distribute or copy this
communication, by e-mail or otherwise. Instead, please notify us immediately by
return e-mail.

Reply via email to