Changeset: d17b7070c2e2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d17b7070c2e2
Added Files:
        monetdb5/extras/rdf/rdfschema.h
Modified Files:
        monetdb5/extras/rdf/Makefile.ag
        monetdb5/extras/rdf/rdf.h
        monetdb5/extras/rdf/rdfschema.c
Branch: rdf
Log Message:

Add rdfschema.h and move the declarations of schema-related functions to this 
file


diffs (162 lines):

diff --git a/monetdb5/extras/rdf/Makefile.ag b/monetdb5/extras/rdf/Makefile.ag
--- a/monetdb5/extras/rdf/Makefile.ag
+++ b/monetdb5/extras/rdf/Makefile.ag
@@ -31,7 +31,7 @@ lib__rdf = {
        #MODULE
        NOINST
        #DIR = libdir/monetdb5
-       SOURCES = rdf.h rdf_shredder.mx rdfalgebra.c rdfschema.c 
+       SOURCES = rdf.h rdfschema.h rdf_shredder.mx rdfalgebra.c rdfschema.c 
        #SEP = _
        # LIBS =  ./hashmap/librdfhash  
        #       ../../tools/libmonetdb5 \
diff --git a/monetdb5/extras/rdf/rdf.h b/monetdb5/extras/rdf/rdf.h
--- a/monetdb5/extras/rdf/rdf.h
+++ b/monetdb5/extras/rdf/rdf.h
@@ -19,7 +19,7 @@
 
 /*
  * @f rdf
- * @a L.Sidirourgos
+ * @a L.Sidirourgos, Minh-Duc Pham
  *
  * @* The RDF module For MonetDB5 (aka. MonetDB/RDF)
  *
@@ -51,16 +51,8 @@ RDFleftfetchjoin_sortedestimate(int *res
 rdf_export str 
 RDFleftfetchjoin_sorted(int *result, int* lid, int *rid);
 
-rdf_export str
-RDFSchemaExplore(int *ret, str *tbname, str *clname);
 
 
-rdf_export str
-RDFextractCS(int *ret, bat *sbatid, bat *pbatid); 
-
-rdf_export str
-RDFextractPfromPSO(int *ret, bat *pbatid, bat *sbatid); 
-
 #define IS_DUPLICATE_FREE 0    /* 0: Duplications have not been removed, 
otherwise 1 */
 #define TRIPLE_STORE 1
 #define MLA_STORE    2
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
@@ -21,6 +21,7 @@
 
 #include "monetdb_config.h"
 #include "rdf.h"
+#include "rdfschema.h"
 #include "algebra.h"
 #include <gdk.h>
 #include <hashmap/hashmap.h>
@@ -40,7 +41,7 @@ static void copyIntSet(int* dest, int* o
        }
 }
 
-static void putCStoHash(map_t csmap, int* buff, int num, oid *csoid){
+static void putaCStoHash(map_t csmap, int* buff, int num, oid *csoid){
        oid     *getCSoid; 
        oid     *putCSoid; 
        int     err; 
@@ -60,16 +61,12 @@ static void putCStoHash(map_t csmap, int
 
                err = hashmap_put(csmap, cs, num, putCSoid);    
                assert(err == MAP_OK); 
-                               
-               //printf("Put CS %d into hashmap \n", (int) *putCSoid);
 
                (*csoid)++; 
        }
-       else{
-               //printf("The key %d exists in the hashmap with freq %d \n", 
(int) *getCSoid, freq);
+       else
                free(cs); 
 
-       }
 }
 
 
@@ -172,8 +169,6 @@ static void getStatisticCSsBySupports(ma
        free(statCS); 
 }
 
-
-
 /* Extract CS from SPO triples table */
 str
 RDFextractCS(int *ret, bat *sbatid, bat *pbatid){
@@ -211,7 +206,7 @@ RDFextractCS(int *ret, bat *sbatid, bat 
                bt = (oid *) BUNtloc(si, p);            
                if (*bt != curS){
                        if (p != 0){    /* Not the first S */
-                               putCStoHash(csMap, buff, numP, &CSoid); 
+                               putaCStoHash(csMap, buff, numP, &CSoid); 
                                
                                if (numP > maxNumProp) 
                                        maxNumProp = numP; 
@@ -224,7 +219,7 @@ RDFextractCS(int *ret, bat *sbatid, bat 
                pbt = (oid *) BUNtloc(pi, p); 
 
                if (numP > INIT_PROPERTY_NUM){
-                       printf("# of properties %d is greater than 
INIT_PROPERTY_NUM at CS %d property %d \n", numP, (int)CSoid, (int)*pbt);
+                       throw(MAL, "rdf.RDFextractCS", "# of properties is 
greater than INIT_PROPERTY_NUM");
                        exit(-1);
                }
                
@@ -237,7 +232,7 @@ RDFextractCS(int *ret, bat *sbatid, bat 
        }
        
        /*put the last CS */
-       putCStoHash(csMap, buff, numP, &CSoid); 
+       putaCStoHash(csMap, buff, numP, &CSoid); 
 
        if (numP > maxNumProp) 
                maxNumProp = numP; 
diff --git a/monetdb5/extras/rdf/rdfschema.h b/monetdb5/extras/rdf/rdfschema.h
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/rdf/rdfschema.h
@@ -0,0 +1,42 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2012 MonetDB B.V.
+ * All Rights Reserved.
+ */
+
+#ifndef _RDFSCHEMA_H_
+#define _RDFSCHEMA_H_
+
+rdf_export str
+RDFSchemaExplore(int *ret, str *tbname, str *clname);
+
+rdf_export str
+RDFextractCS(int *ret, bat *sbatid, bat *pbatid); 
+
+rdf_export str
+RDFextractPfromPSO(int *ret, bat *pbatid, bat *sbatid); 
+
+typedef struct SubProps
+{
+       int     subIdx;         //Id of subject
+       int*    lstProp;        //List of properties' Ids
+       int     numProp;
+       int     numAllocation;
+} SubProps;
+
+SubProps* subPropSet;
+
+#endif /* _RDFSCHEMA_H_ */
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to