Changeset 63 for php/trunk/classes/rdfa_Data.php
- Timestamp:
- Jul 19, 2011, 6:20:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
php/trunk/classes/rdfa_Data.php
r36 r63 952 952 953 953 // -------------------------------------------------------- 954 954 955 955 /** 956 956 * Retrieves a list of Projections based on a set of selection criteria. … … 995 995 return false; 996 996 997 // create projections for examination997 // examine properties 998 998 $aprojection_test = array(); 999 999 $count = count( $asubjects); 1000 if ($fLogMessages) $this->debugger->sendMessage( " Getting $count projections for filter test",1000 if ($fLogMessages) $this->debugger->sendMessage( "Testing $count subjects", 1001 1001 self::debugcontext); 1002 $aFilteredSubjects = array(); 1002 1003 foreach ($asubjects as $subject) { 1003 $aprojection_test[] = new \rdfa\Projection( $this, $subject, $template);1004 1004 $debugmessage .= "$subject\n"; 1005 }1006 1007 // determine which projections have to be filtered out1008 $aFilteredSubjects = array();1009 foreach ($aprojection_test as $projection) {1010 $subject = $projection->getSubject();1011 1005 foreach ($query as $property => $value) { 1012 $avalues = $ projection->getAll($property);1006 $avalues = $this->getValues( $subject, $property); 1013 1007 if ($avalues == false) { 1014 // filter this projection: property not found1008 // filter this subject: property not found 1015 1009 $aFilteredSubjects[ $subject] = "Property $property not found"; 1016 1010 break; … … 1024 1018 } 1025 1019 } 1020 1026 1021 $count = count( $aFilteredSubjects); 1027 1022 if ($count == 0) { 1028 1023 $debugmessage = "No projections filtered\n"; 1029 1024 } else { 1030 $debugmessage = "Filtering $count projections\n";1025 $debugmessage = "Filtering $count subjects\n"; 1031 1026 foreach ( $aFilteredSubjects as $subject => $reason) { 1032 1027 $debugmessage .= "$subject: $reason\n"; … … 1039 1034 // take over unfiltered projections 1040 1035 $aprojection = array(); 1041 foreach ($a projection_test as $projection) {1042 if (array_key_exists( $ projection->getSubject(), $aFilteredSubjects) === false) {1043 $aprojection[] = $projection;1044 } else {1045 unset( $projection); 1046 }1047 }1048 1049 // create log output1036 foreach ($asubjects as $subject) { 1037 if (array_key_exists( $subject, $aFilteredSubjects) === false) 1038 $aprojection[] = new \rdfa\Projection( $this, $subject, $template); 1039 } 1040 1041 // create projections on unfiltered subjects 1042 foreach ($aprojection as $projection) { 1043 $debugmessage .= "{$projection->getSubject()}\n"; 1044 } 1050 1045 $count = count( $aprojection); 1051 1046 $debugmessage = "Returning $count projections \n"; 1052 foreach ($aprojection as $projection) { 1053 $debugmessage .= "{$projection->getSubject()}\n"; 1054 } 1047 1055 1048 if ($fLogMessages) $this->debugger->sendMessage( "$debugmessage", 1056 1049 self::debugcontext);
Note:
See TracChangeset
for help on using the changeset viewer.