# prep() # Now, go through the triples in the query document. if there is a bnode, check # to see if it's in self.vars (which it will be). Go through each triple in f, # matching the arrangement of the variables. Once one is found, store the values # in self.vars next to the label and move the quad to self.results. # dothetriple() # You either match things, or store things, for every triple. # For example, if the query is :a :b _:c ., you match a and b, and check to # see if c already has a value. if it does, then you match that too, if not, # you store something in there, until all of the variables are satisfied. 20:51:59 So how do you do query? just running thru triples to see if they match? 20:52:36 if only it were that simple! 20:52:50 you have two stores, one for the query quads, and one for the file quads 20:53:03 then you have a list of universal variables: with labels and value 20:53:26 scrape all of the universal variables out of the query quads, and set them all to an empty value (which later gets filled in) 20:53:56 then, for each quad in the query quads, gague which pattern of variables needs to be filled in, and go to the appropriate function 20:54:32 match each triple in the file quads store against the pattern, and if you find a term that matches a variable, checjk to see if it's still empty in the vars list 20:54:51 if so, put the value in there, and move the quad from the file store to a results store 20:55:18 do so until all of the query quads are satisfied, output, and run through until there's nothing left to match 20:55:38 that's the basic jist of it... there's a lot of weird hacking in between to glue it all together 20:55:47 a lot of conversion function to save space and so on 20:56:08 * AaronSw reads several times to try and make sense of it