Logo Search packages:      
Sourcecode: zeitgeist-extensions version File versions  Download package

def fts::Indexer::_compile_event_filter_query (   self,
  events 
) [private]
Takes a list of event templates and compiles a filter query
   based on their, interpretations, manifestations, and actor,
   for event and subjects.
   
   All fields within the same event will be ANDed and each template
   will be ORed with the others. Like elsewhere in Zeitgeist the
   type tree of the interpretations and manifestations will be expanded
   to match all child symbols as well

Definition at line 746 of file fts.py.

                                                    :
            """Takes a list of event templates and compiles a filter query
               based on their, interpretations, manifestations, and actor,
               for event and subjects.
               
               All fields within the same event will be ANDed and each template
               will be ORed with the others. Like elsewhere in Zeitgeist the
               type tree of the interpretations and manifestations will be expanded
               to match all child symbols as well
            """
            query = []
            for event in events:
                  if not isinstance(event, Event):
                        raise TypeError("Expected Event. Found %s" % type(event))
                  
                  tmpl = []
                  if event.interpretation :
                        tmpl.append(expand_type("zgei", event.interpretation))
                  if event.manifestation :
                        tmpl.append(expand_type("zgem", event.manifestation))
                  if event.actor : tmpl.append("zga:%s" % mangle_uri(event.actor))
                  for su in event.subjects:
                        if su.uri :
                              tmpl.append("zgsu:%s" % mangle_uri(su.uri))
                        if su.interpretation :
                              tmpl.append(expand_type("zgsi", su.interpretation))
                        if su.manifestation :
                              tmpl.append(expand_type("zgsm", su.manifestation))
                        if su.origin :
                              tmpl.append("zgso:%s" % mangle_uri(su.origin))
                        if su.mimetype :
                              tmpl.append("zgst:%s" % su.mimetype)
                        if su.storage :
                              tmpl.append("zgss:%s" % su.storage)
                  
                  tmpl = "(" + ") AND (".join(tmpl) + ")"
                  query.append(tmpl)
            
            return " OR ".join(query)
      

Generated by  Doxygen 1.6.0   Back to index