Changeset: 6832434de2c2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6832434de2c2
Modified Files:
        monetdb5/extras/rdf/rdflabels.c
Branch: rdf
Log Message:

fix creation of typeAttributesHistogram

type values were assigned to the wrong CS because the new csFreqIdx was used 
instead of the old one


diffs (33 lines):

diff --git a/monetdb5/extras/rdf/rdflabels.c b/monetdb5/extras/rdf/rdflabels.c
--- a/monetdb5/extras/rdf/rdflabels.c
+++ b/monetdb5/extras/rdf/rdflabels.c
@@ -967,9 +967,7 @@ void createTypeAttributesHistogram(BAT *
                // check if property (*pbt) is a type
                for (i = 0; i < typeAttributesCount; ++i) {
                        if (*pbt == typeAttributesOids[i]) {
-
                                // prop is a type!
-                               csFreqIdx = csIdFreqIdxMap[subjCSMap[*sbt]];
 
                                // get object
                                obt = (oid *) BUNtloc(oi, p);
@@ -988,6 +986,7 @@ void createTypeAttributesHistogram(BAT *
                                                // nothing to add to histogram
                                        } else {
                                                // analyze values and add to 
histogram
+                                               csFreqIdx = 
csIdFreqIdxMap[subjCSMap[curS]]; // get csFreqIdx of last subject
                                                
insertLeafsIntoTypeAttributesHistogram(typeValues, typeValuesSize, 
typeAttributesHistogram, typeAttributesHistogramCount, csFreqIdx, curT, 
ontmetaBat, ontclassSet);
                                                typeValuesSize = 0; // reset
                                        }
@@ -1008,7 +1007,10 @@ void createTypeAttributesHistogram(BAT *
        }
 
        // analyze and add last set of typeValues
-       if (curS != BUN_NONE && typeValuesSize != 0) 
insertLeafsIntoTypeAttributesHistogram(typeValues, typeValuesSize, 
typeAttributesHistogram, typeAttributesHistogramCount, csFreqIdx, curT, 
ontmetaBat, ontclassSet);
+       if (curS != BUN_NONE && typeValuesSize != 0) {
+               csFreqIdx = csIdFreqIdxMap[subjCSMap[curS]]; // get csFreqIdx 
of last subject
+               insertLeafsIntoTypeAttributesHistogram(typeValues, 
typeValuesSize, typeAttributesHistogram, typeAttributesHistogramCount, 
csFreqIdx, curT, ontmetaBat, ontclassSet);
+       }
 
        GDKfree(typeValues);
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to