You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
Hi,
I am currently trying to understand the algorithms better - your code helps a lot! Thank you very much.
While implementing my own interpretation of the algorithm, I stumbled upon the ordering of graphs, which you have implemented in the Dataset as isSmaller.
As I understood from the paper, the ordering itself was not specified so you had to come up with your own:
G < H if and only if G ⊂ H or there exists a triple t ∈ G \ H such that no triple t' ∈ H \ G exists where t' < t .
You implemented a shortcut with
// If HmG, i.e., H\G is empty then the second predicate is trivially true, so we are also done
if( HmG.length === 0 ) return true;
While your implementation does exactly what you defined, I was wondering - more generally - the follwoing:
Let G = { (s,p,o), (s,p,x) } a graph consisting of two triples.
Let H = { (s,p,o) } a graph consisting of one triple such that H is a true subgraph of G.
Then: GmH = {(s,p,x)} and HmG = { }.
Now, isSmaller(G,H) will return true as HmG is empty, just as you defined.
However, isSmaller(H,G) will also return true as H is a true subgraph of G, just as you defined.
Intuitively, I would have expected to first check for true subgraphs in both directions and second if none is a true subgraph of the other then to check if all triples in GmH are (lexicographically) smaller than all triples in HmG otherwise G is not smaller than H.
So, in a nutshell, I was expecting the check if H is subgraph of G, instead of the shortcut. The rest is fine to my understanding.
So: if( HmG.length === 0 ) return false;
Am I missing something? I would appreciate any clarifications and explanations why I am totally wrong about this :)
Cheers
Christoph
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am currently trying to understand the algorithms better - your code helps a lot! Thank you very much.
While implementing my own interpretation of the algorithm, I stumbled upon the ordering of graphs, which you have implemented in the Dataset as
isSmaller
.As I understood from the paper, the ordering itself was not specified so you had to come up with your own:
You implemented a shortcut with
While your implementation does exactly what you defined, I was wondering - more generally - the follwoing:
Let G = { (s,p,o), (s,p,x) } a graph consisting of two triples.
Let H = { (s,p,o) } a graph consisting of one triple such that H is a true subgraph of G.
Then:
GmH = {(s,p,x)}
andHmG = { }
.Now,
isSmaller(G,H)
will returntrue
asHmG
is empty, just as you defined.However,
isSmaller(H,G)
will also returntrue
as H is a true subgraph of G, just as you defined.Intuitively, I would have expected to first check for true subgraphs in both directions and second if none is a true subgraph of the other then to check if all triples in GmH are (lexicographically) smaller than all triples in HmG otherwise G is not smaller than H.
So, in a nutshell, I was expecting the check if H is subgraph of G, instead of the shortcut. The rest is fine to my understanding.
So:
if( HmG.length === 0 ) return false
;Am I missing something? I would appreciate any clarifications and explanations why I am totally wrong about this :)
Cheers
Christoph
The text was updated successfully, but these errors were encountered: