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

remove language tags and quotation marks from multi-valued properties of type 
datetime and string


diffs (34 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
@@ -5514,9 +5514,12 @@ int getObjValueFromMVBat(ValPtr returnVa
                        //printf("A String object value: %s \n",objStr);
                        tmpStr = BUNtail(tmpi, pos); 
                        if (strcmp(tmpStr,str_nil) != 0){
-                               inputStr = GDKmalloc(sizeof(char) * 
strlen(tmpStr) + 1); 
-                               memcpy(inputStr, tmpStr, sizeof(char) * 
strlen(tmpStr) + 1);
-
+                               // remove quotes and language tags
+                               str tmpStrShort;
+                               getStringBetweenQuotes(&tmpStrShort, tmpStr);
+                               inputStr = GDKmalloc(sizeof(char) * 
strlen(tmpStrShort) + 1); 
+                               memcpy(inputStr, tmpStrShort, sizeof(char) * 
strlen(tmpStrShort) + 1);
+                               GDKfree(tmpStrShort);
                                VALset(returnValue, TYPE_str, inputStr);
                                if (rdfcast(objType, STRING, returnValue, 
castedValue) != 1){
                                        printf("Everything should be able to 
cast to String \n");
@@ -5532,8 +5535,12 @@ int getObjValueFromMVBat(ValPtr returnVa
                        //printf("A Datetime object value: %s \n",objStr);
                        tmpStr = BUNtail(tmpi, pos);
                        if (strcmp(tmpStr,str_nil) != 0){
-                               inputStr = GDKmalloc(sizeof(char) * 
strlen(tmpStr) + 1);
-                               memcpy(inputStr, tmpStr, sizeof(char) * 
strlen(tmpStr) + 1);
+                               // remove quotes and language tags
+                               str tmpStrShort;
+                               getStringBetweenQuotes(&tmpStrShort, tmpStr);
+                               inputStr = GDKmalloc(sizeof(char) * 
strlen(tmpStrShort) + 1);
+                               memcpy(inputStr, tmpStrShort, sizeof(char) * 
strlen(tmpStrShort) + 1);
+                               GDKfree(tmpStrShort);
                                VALset(returnValue, TYPE_str, inputStr);
                                if (rdfcast(objType, STRING, returnValue, 
castedValue) != 1){
                                        printf("Everything should be able to 
cast to String \n");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to