Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there some data structure or database that can handle path expression statements and path expression queries?
    text
    copied!<p>I need to model a graph (or could be seen as a recursive tree(s) since it typically as a single or small number of roots) based on things having children:</p> <pre><code>a hasChildren (b, c) b hasChildren (d, e) c hasChildren (f, g) d hasChildren (h, a) </code></pre> <p>Now there are implicit paths, a/c/f and recursive ones as well: a/b/d/a/b/d/...</p> <p>And then I need to set things on the graph via a path expression, both properties about them (these paths have color: blue, or such) and also changing their children--perhaps removing/hiding them, or adding new children.</p> <p>By path expression, I mean something like this:</p> <pre><code>a/b/** -&gt; color = "blue" </code></pre> <p>would mean that all paths that start with a/b/ have the property color = "blue". So, if I queried for the color of a/b/d/a/b/d/a, it would return blue. But if I queried for the color of just a, at this point there is none.</p> <p>Other expressions might be:</p> <pre><code>**/d/h a/b/[color="blue"] a/**/h </code></pre> <p>So, that would be used to make statements. I need similar way of doing querying. I need simple queries such as:</p> <pre><code>a/b/d </code></pre> <p>and more complex ones like:</p> <pre><code>a/**[color="blue"] -- descendants that have attribute color = "blue". This could be infinite in recursive case so we can put a restriction on this type of query to have it make sense, like does such a path exist, or just return first one or something. </code></pre> <p>Also, more nodes might be added at any time.</p> <p>a hasChildren (b, c, x, y, z)</p> <p>I need the queries after that to match appropriately all the statements. So in other words, I can't just run a query and set a property on all the results, since then it won't apply to new things added later.</p> <p>And of course, I need it to be very fast :) I would have on the order of 1000's of nodes, 1000's of path expression statements, and query on 100,000's of path expressions.</p> <p>Is there something that handles this type of thing well?</p> <p>I looked into RDF/OWL kind of thing but it doesn't seem to have any support for paths.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload