aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-10-11 23:47:56 +0000
committerRob Austein <sra@hactrn.net>2013-10-11 23:47:56 +0000
commit869b10862cce00824dadb73e9e25d1e459b2b8c7 (patch)
tree4de3a8dde73d864191cc3ce5c2c6a422b54014fb
parent542296d92a794ee1bedadbac771e3d9a104facaa (diff)
Checkpoint.
svn path=/trunk/; revision=5564
-rwxr-xr-xscripts/rcynic-lta15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/rcynic-lta b/scripts/rcynic-lta
index e06a07a8..ef168150 100755
--- a/scripts/rcynic-lta
+++ b/scripts/rcynic-lta
@@ -169,13 +169,22 @@ class main(object):
candidates = self.rpdb.find_by_resource_bag(constraint.mentioned_resources)
candidates.sort(reverse = True, key = lambda candidate: candidate.depth)
deepest = max(candidate.depth for candidate in candidates)
+
+ # It's possible that the right answer to selecting the deepest
+ # match here is the query we already have supplemented by a
+ # HAVING clause that picks out just the rows with maximum depth
+ # out of the result produced by the SELECT. Not sure yet, and
+ # may take a bit of doing to work that into the rpdb.find_...()
+ # code, but seems like the right general approach in SQL terms
+
print
print "Constraint:", repr(constraint)
print "Resources: ", constraint.mentioned_resources
for i, candidate in enumerate(candidates):
- print " Candidate #%d id %d depth %d deepest %s name %s uri %s" % (
- i, candidate.rowid, candidate.depth, candidate.depth == deepest,
- candidate.subject_name, candidate.uri)
+ if candidate.depth == deepest:
+ print " Candidate #%d id %d depth %d deepest %s resources %s uri %s" % (
+ i, candidate.rowid, candidate.depth, candidate.depth == deepest,
+ candidate.resources, candidate.uri)
def compute_all_mentioned_resources(self):
for constraint in self.constraints: