Changeset: f96997d399b9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f96997d399b9
Modified Files:
monetdb5/extras/rdf/rdf_shredder.c
sql/backends/monet5/sql_rdf.c
Branch: rdf
Log Message:
Handling nonNegativeInteger suffix
diffs (148 lines):
diff --git a/monetdb5/extras/rdf/rdf_shredder.c
b/monetdb5/extras/rdf/rdf_shredder.c
--- a/monetdb5/extras/rdf/rdf_shredder.c
+++ b/monetdb5/extras/rdf/rdf_shredder.c
@@ -197,13 +197,13 @@ getObjectType_and_Value(unsigned char* o
lng realLng;
len = strlen((str)objStr);
- if (len > 100 || len <= 20){
+ if (len > 100 || len <= 30){
//String is too long for any kind of data or there is no
XMLschema
obType = STRING;
}
else{ //(len > 20)
- endpart = objStr + (len - 19); /* XMLSchema#dateTime> */
- /* printf("Original: %s --> substring: %s \n", (str)objStr,
(str)endpart); */
+ endpart = objStr + (len - 29); /* XMLSchema#dateTime> */
+ printf("Original: %s --> substring: %s \n", (str)objStr,
(str)endpart);
if ( (pos = strstr((str)endpart , "XMLSchema#date>")) != NULL
|| (pos = strstr((str)endpart, "XMLSchema#dateTime>")) != NULL ){
obType = DATETIME;
@@ -226,7 +226,9 @@ getObjectType_and_Value(unsigned char* o
GDKfree(valuepart);
}
- else if ((pos = strstr((str) endpart, "XMLSchema#int>")) !=
NULL || (pos = strstr((str)endpart, "XMLSchema#integer>")) != NULL){
+ else if ((pos = strstr((str) endpart, "XMLSchema#int>")) !=
NULL
+ || (pos = strstr((str)endpart, "XMLSchema#integer>"))
!= NULL
+ || (pos = strstr((str)endpart,
"XMLSchema#nonNegativeInteger>")) != NULL) {
//TODO: Consider nonNegativeInteger
obType = INTEGER;
subLen = (int) (pos - (str)objStr - 28);
@@ -235,7 +237,7 @@ getObjectType_and_Value(unsigned char* o
if (isInt(valuepart, subLen) == 1){ /* Check
whether the real value is an integer */
realInt = (BUN) atoi(valuepart);
VALset(vrPtrRealValue,TYPE_int, &realInt);
- //printf("Real int value is: %d \n",
vrPtrRealValue->val.ival);
+ printf("Real int value is: %d \n",
vrPtrRealValue->val.ival);
}
else
obType = STRING;
diff --git a/sql/backends/monet5/sql_rdf.c b/sql/backends/monet5/sql_rdf.c
--- a/sql/backends/monet5/sql_rdf.c
+++ b/sql/backends/monet5/sql_rdf.c
@@ -1673,20 +1673,20 @@ static void appendResult(BAT **r_obats,
for (j = 0; j < np; j++){
//Output result
- /*
- if (sbt == (oid)879609302220975){
+
+ if (sbt == (oid)1460151441687511){
printf(BUNFMT " | ", tmpres[j]);
}
- */
+
BUNappend(r_obats[j], &(tmpres[j]), TRUE);
}
- /*
- if (sbt == (oid) 879609302220975){
+
+ if (sbt == (oid) 1460151441687511){
printf("\n");
}
- */
+
}
/*
static
@@ -1787,10 +1787,11 @@ void fetch_result(BAT **r_obats, oid **o
//Then, get all teh value from MVBATs
//assert(cur_p >= nrp || regular_obat_cursors[cur_p][tmpS] !=
oid_nil);
+ int hasvalue = 0;
tmpres[cur_p] = oid_nil;
- if (regular_obat_mv_cursors[cur_p] != NULL){ //mv col
+ if (regular_obat_mv_cursors[cur_p] != NULL &&
regular_obat_cursors[cur_p][tmpS] != oid_nil){ //mv col
//Get the values from mvBat
oid offset = regular_obat_cursors[cur_p][tmpS];
oid nextoffset;
@@ -1812,7 +1813,7 @@ void fetch_result(BAT **r_obats, oid **o
if (nextS == batCnt) {
numCand = BUNlast(regular_obat_mv[cur_p]) -
offset;
}
- assert(numCand >= 0);
+ assert(numCand > 0);
for (i = 0; i < numCand; i++){
tmpres[cur_p] =
regular_obat_mv_cursors[cur_p][offset + i];
@@ -1823,9 +1824,10 @@ void fetch_result(BAT **r_obats, oid **o
appendResult(r_obats, tmpres, np, sbt,
n_exp_value);
}
}
+ hasvalue = 1;
}
- else if (regular_obat_cursors[cur_p] != NULL){
+ else if (regular_obat_cursors[cur_p] != NULL &&
regular_obat_cursors[cur_p][tmpS] != oid_nil){
tmpres[cur_p] = regular_obat_cursors[cur_p][tmpS];
@@ -1836,6 +1838,8 @@ void fetch_result(BAT **r_obats, oid **o
//Output result
appendResult(r_obats, tmpres, np, sbt,
n_exp_value);
}
+
+ hasvalue = 1;
}
@@ -1850,6 +1854,19 @@ void fetch_result(BAT **r_obats, oid **o
//Output result
appendResult(r_obats, tmpres, np, sbt,
n_exp_value + 1);
}
+ hasvalue = 1;
+ }
+
+
+ if (hasvalue == 0){
+
+ if (cur_p < (np -1))
+ fetch_result(r_obats, obatCursors, pos,
regular_obat_cursors, regular_obat_mv_cursors, regular_obats, regular_obat_mv,
sbt, tmpS, cur_p + 1, nrp, np, tmpres, n_exp_value);
+
+ else if (cur_p == (np - 1))
+ //Output result
+ appendResult(r_obats, tmpres, np, sbt,
n_exp_value);
+
}
@@ -2012,11 +2029,11 @@ void combine_exception_and_regular_table
//printf("At row "BUNFMT" of table %d for sbt "BUNFMT"...",
tmpS, tid, sbt);
- /*
- if (sbt == (oid)879609302220975 && accept == 1){
+
+ if (sbt == (oid)1460151441687511 && accept == 1){
printf("[DEBUG2] THAT SUBJECT "BUNFMT " IS
ACCEPTED\n",sbt);
}
- */
+
if (accept == 1){ //Accept, can insert to the output bat
oid *tmpres = (oid *) malloc(sizeof(oid) * nP);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list