MonetDB: Jan2014 - Make sure Perl modules are installed in the c...

2014-03-14 Thread Sjoerd Mullender
Changeset: f86c74dcfbb5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f86c74dcfbb5
Modified Files:
MonetDB.spec
debian/rules
Branch: Jan2014
Log Message:

Make sure Perl modules are installed in the correct place.


diffs (67 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -58,7 +58,6 @@ BuildRequires: rubygems-devel
 BuildRequires: unixODBC-devel
 BuildRequires: zlib-devel
 
-%define perl_libdir %(perl -MConfig -e '$x=$Config{installvendorarch}; $x =~ 
s|$Config{vendorprefix}/||; print $x;')
 # need to define python_sitelib on RHEL 5 and older
 # no need to define python3_sitelib: it's defined by python3-devel
 %if 0%{?rhel}  0%{?rhel} = 5
@@ -272,10 +271,15 @@ program.
 Summary: MonetDB perl interface
 Group: Applications/Databases
 Requires: %{name}-client = %{version}-%{release}
-Requires: perl
+Requires: perl(:MODULE_COMPAT_%(eval `%{__perl} -V:version`; echo $version))
 Requires: perl(DBI)
 Requires: perl(Digest::SHA)
 Requires: perl(Digest::MD5)
+# when not using BuildArch: noarch, globally replace perl_vendorlib by
+# perl_vendorarch
+BuildArch: noarch
+%{?perl_default_filter}
+%global __requires_exclude perl\\(DBD::monetdb|perl\\(MonetDB::|perl\\(Mapi\\)
 
 %description client-perl
 MonetDB is a database management system that is developed from a
@@ -288,7 +292,7 @@ program.
 
 %files client-perl
 %defattr(-,root,root)
-%{_prefix}/%{perl_libdir}/*
+%{perl_vendorlib}/*
 
 %package -n rubygem-monetdb-sql
 Summary: MonetDB ruby interface
@@ -754,6 +758,7 @@ developer, but if you do want to test, t
--with-java=no \
--with-mseed=no \
--with-perl=yes \
+   --with-perl-libdir=lib/perl5 \
--with-pthread=yes \
--with-python2=yes \
--with-python3=%{?rhel:no}%{!?rhel:yes} \
@@ -776,6 +781,10 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/monetdb5/dbfarm
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/monetdb
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/monetdb
+mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}
+if [ ! $RPM_BUILD_ROOT%{_prefix}/lib/perl5 -ef 
$RPM_BUILD_ROOT%{perl_vendorlib} ]; then
+mv $RPM_BUILD_ROOT%{_prefix}/lib/perl5/* $RPM_BUILD_ROOT%{perl_vendorlib}
+fi
 
 # remove unwanted stuff
 # .la files
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -53,6 +53,7 @@ override_dh_auto_configure:
--with-java=no \
--with-mseed=no \
--with-perl=yes \
+   --with-perl-libdir=lib/perl5 \
--with-pthread=yes \
--with-python2=yes \
--with-python3=yes \
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - BATcreatedesc: make headless complaint a bit ...

2014-03-14 Thread Fabian Groffen
Changeset: b7a80b4ca68d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b7a80b4ca68d
Modified Files:
gdk/gdk_bat.c
Branch: default
Log Message:

BATcreatedesc: make headless complaint a bit more helpful


diffs (44 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -64,6 +64,28 @@
 char *BATstring_h = h;
 char *BATstring_t = t;
 
+static char *
+type2str(int type)
+{
+   switch (type) {
+   case 0:   return void;   break;
+   case 1:   return bit;break;
+   case 2:   return bte;break;
+   case 3:   return sht;break;
+   case 4:   return bat;break;
+   case 5:   return int;break;
+   case 6:   return oid;break;
+   case 7:   return wrd;break;
+   case 8:   return ptr;break;
+   case 9:   return flt;break;
+   case 10:  return dbl;break;
+   case 11:  return lng;break;
+   case 12:  return str;break;
+   case 255: return any;break;
+   default:  return ???;break;
+   }
+}
+
 static int
 default_ident(char *s)
 {
@@ -90,9 +112,8 @@ BATcreatedesc(int ht, int tt, int heapna
if (bs == NULL)
return NULL;
HEADLESSDEBUG {
-   if ( ht != TYPE_void  ht != TYPE_oid)
-   fprintf(stderr, #headless violation in BATcreatedesc 
%d\n, ht);
-
+   if (ht != TYPE_void  ht != TYPE_oid)
+   fprintf(stderr, #headless violation in BATcreatedesc 
for bat[:%s,:%s]\n, type2str(ht), type2str(tt));
}
/*
 * assert needed in the kernel to get symbol eprintf resolved.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: rdf - Add the code for building ontology hierarchy info...

2014-03-14 Thread Minh-Duc Pham
Changeset: bd25ee565cab for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd25ee565cab
Modified Files:
monetdb5/extras/rdf/rdflabels.c
monetdb5/extras/rdf/rdflabels.h
monetdb5/extras/rdf/rdfontologyload.c
monetdb5/extras/rdf/rdfontologyload.h
monetdb5/extras/rdf/rdfschema.c
Branch: rdf
Log Message:

Add the code for building ontology hierarchy information.


diffs (truncated from 381 to 300 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
@@ -2074,12 +2074,15 @@ void removeDuplicatedCandidates(CSlabel 
 #if USE_TABLE_NAME
 /* For one CS: Choose the best table name out of all collected candidates 
(ontology, type, fk). */
 static
-void getTableName(CSlabel* label, int csIdx,  int typeAttributesCount, 
TypeAttributesFreq*** typeAttributesHistogram, int** 
typeAttributesHistogramCount, TypeStat* typeStat, int typeStatCount, oid** 
result, int* resultCount, IncidentFKs* links, oid** ontmetadata, int 
ontmetadataCount) {
+void getTableName(CSlabel* label, int csIdx,  int typeAttributesCount, 
TypeAttributesFreq*** typeAttributesHistogram, int** 
typeAttributesHistogramCount, TypeStat* typeStat, int typeStatCount, oid** 
result, int* resultCount, IncidentFKs* links, oid** ontmetadata, int 
ontmetadataCount, BAT *ontmetaBat, OntClass *ontclassSet) {
int i, j, k;
oid *tmpList;
int tmpListCount;
charnameFound = 0;
 
+   BUN ontClassPos;//Position of ontology in the ontmetaBat
+   oid typeOid;
+
// --- ONTOLOGY ---
// add all ontology candidates to list of candidates
if (resultCount[csIdx] = 1) {
@@ -2170,6 +2173,23 @@ void getTableName(CSlabel* label, int cs
tmpListCount = 0;
for (i = 0; i  typeAttributesCount; ++i) {
if (typeAttributesHistogramCount[csIdx][i] == 0) continue;
+   /*   //TODO: Uncomment this path
+   for (j = 0; j  typeAttributesHistogramCount[csIdx][i]; j++){
+   str typelabel; 
+   typeOid = typeAttributesHistogram[csIdx][i][j].value;
+   printf(FreqCS %d : Type[%d][%d][oid] =  BUNFMT, 
csIdx, i,j, typeOid);
+   ontClassPos = BUNfnd(BATmirror(ontmetaBat), typeOid); 
+   if (ontClassPos != BUN_NONE){
+   takeOid(typeOid,typelabel);
+   assert(ontclassSet[ontClassPos].cOid == 
typeOid); 
+   printf( -- class %s | Index = %d |Specific 
level: %d \n, typelabel, (int)ontClassPos, ontclassSet[ontClassPos].hierDepth);
+   GDKfree(typelabel);
+   }
+   else{
+   printf( -- No class \n); 
+   }
+   }
+   */
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);
@@ -2303,14 +2323,14 @@ CSlabel* initLabels(CSset *freqCSset) {
 #if USE_TABLE_NAME
 /* Creates the final result of the labeling: table name and attribute names. */
 static
-void getAllLabels(CSlabel* labels, CSset* freqCSset,  int typeAttributesCount, 
TypeAttributesFreq*** typeAttributesHistogram, int** 
typeAttributesHistogramCount, TypeStat* typeStat, int typeStatCount, oid** 
result, int* resultCount, IncidentFKs* links, oid** ontmetadata, int 
ontmetadataCount) {
+void getAllLabels(CSlabel* labels, CSset* freqCSset,  int typeAttributesCount, 
TypeAttributesFreq*** typeAttributesHistogram, int** 
typeAttributesHistogramCount, TypeStat* typeStat, int typeStatCount, oid** 
result, int* resultCount, IncidentFKs* links, oid** ontmetadata, int 
ontmetadataCount, BAT *ontmetaBat, OntClass *ontclassSet) {
int i, j;
 
for (i = 0; i  freqCSset-numCSadded; ++i) {
CS cs = (CS) freqCSset-items[i];
 
// get table name
-   getTableName(labels[i], i,  typeAttributesCount, 
typeAttributesHistogram, typeAttributesHistogramCount, typeStat, typeStatCount, 
result, resultCount, links, ontmetadata, ontmetadataCount);
+   getTableName(labels[i], i,  typeAttributesCount, 
typeAttributesHistogram, typeAttributesHistogramCount, typeStat, typeStatCount, 
result, resultCount, links, ontmetadata, ontmetadataCount, ontmetaBat, 
ontclassSet);
 
// copy attribute oids (names)
labels[i].numProp = cs.numProp;
@@ -2636,7 +2656,7 @@ void freeOntologyLookupResult(oid** onto
 }
 
 /* Creates labels for all CS (without a parent). */
-CSlabel* 

MonetDB: rdf - Small fix for compilation error as some code is c...

2014-03-14 Thread Minh-Duc Pham
Changeset: 1e8df017a24e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1e8df017a24e
Modified Files:
monetdb5/extras/rdf/rdflabels.c
Branch: rdf
Log Message:

Small fix for compilation error as some code is commented out.


diffs (26 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
@@ -2080,8 +2080,10 @@ void getTableName(CSlabel* label, int cs
int tmpListCount;
charnameFound = 0;
 
-   BUN ontClassPos;//Position of ontology in the ontmetaBat
-   oid typeOid;
+
+   (void) ontmetaBat;
+   (void) ontclassSet;
+
 
// --- ONTOLOGY ---
// add all ontology candidates to list of candidates
@@ -2176,6 +2178,9 @@ void getTableName(CSlabel* label, int cs
/*   //TODO: Uncomment this path
for (j = 0; j  typeAttributesHistogramCount[csIdx][i]; j++){
str typelabel; 
+   BUN ontClassPos;//Position of ontology 
in the ontmetaBat
+   oid typeOid;
+
typeOid = typeAttributesHistogram[csIdx][i][j].value;
printf(FreqCS %d : Type[%d][%d][oid] =  BUNFMT, 
csIdx, i,j, typeOid);
ontClassPos = BUNfnd(BATmirror(ontmetaBat), typeOid); 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: rdf - Do not return after labeling

2014-03-14 Thread Minh-Duc Pham
Changeset: 080d5b317590 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=080d5b317590
Modified Files:
monetdb5/extras/rdf/rdfschema.c
Branch: rdf
Log Message:

Do not return after labeling


diffs (12 lines):

diff --git a/monetdb5/extras/rdf/rdfschema.c b/monetdb5/extras/rdf/rdfschema.c
--- a/monetdb5/extras/rdf/rdfschema.c
+++ b/monetdb5/extras/rdf/rdfschema.c
@@ -6747,7 +6747,7 @@ RDFextractCSwithTypes(int *ret, bat *sba
printFreqCSSet(freqCSset, csBats-freqBat, mbat, 1, *freqThreshold, 
*labels); 
#endif

-   return Error; 
+   //return Error; 
 
/* Get the number of indirect refs in order to detect dimension table */
refCount = (int *) malloc(sizeof(int) * (freqCSset-numCSadded));
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list