Changeset: 2434ad6a7541 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2434ad6a7541 Modified Files: monetdb5/extras/rdf/rdflabels.c monetdb5/extras/rdf/rdflabels.h Branch: rdf Log Message:
Use a not-so frequent type value for labeling CS if there is no choice. diffs (51 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 @@ -2116,7 +2116,7 @@ void getTableName(CSlabel* label, int cs } } */ - + if (typeAttributesHistogram[csIdx][i][0].percent < TYPE_FREQ_THRESHOLD) continue; // sorted tmpList = (oid *) realloc(tmpList, sizeof(oid) * (tmpListCount + 1)); if (!tmpList) fprintf(stderr, "ERROR: Couldn't realloc memory!\n"); @@ -2322,6 +2322,27 @@ void getTableName(CSlabel* label, int cs #endif } } + + //if no name is found, check again the typecount to assign a name + #if USE_BEST_TYPEVALUE_INSTEADOF_DUMMY + if (!nameFound){ + for (i = 0; i < typeAttributesCount; ++i){ + if (typeAttributesHistogramCount[csIdx][i] == 0) continue; + //printf("Current candidate count = %d",label->candidatesCount); + label->candidatesType = 1; + label->candidates = GDKrealloc(label->candidates, sizeof(oid)); + label->candidatesCount = 1; + label->name = typeAttributesHistogram[csIdx][i][0].value; + label->candidates[0] = typeAttributesHistogram[csIdx][i][0].value; + nameFound = 1; + #if INFO_WHERE_NAME_FROM + label->isType = 1; + #endif + + break; + } + } + #endif // --- NOTHING --- if (label->candidatesCount == 0) { diff --git a/monetdb5/extras/rdf/rdflabels.h b/monetdb5/extras/rdf/rdflabels.h --- a/monetdb5/extras/rdf/rdflabels.h +++ b/monetdb5/extras/rdf/rdflabels.h @@ -102,6 +102,7 @@ enum { #define USE_TABLE_NAME 1 // calculate and store the final labels #define SHOW_CANDIDATES 0 // inserts a row in UML diagrams to show all candidate names #define ONLY_USE_ONTOLOGYBASED_TYPE 0 +#define USE_BEST_TYPEVALUE_INSTEADOF_DUMMY 1 //Use the most frequent type value instead of a dummy for the label name rdf_export void getPropNameShort(char** name, char* propStr); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list