Changeset: 845cdd0171ab for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=845cdd0171ab
Modified Files:
        monetdb5/extras/rdf/10_rdf.mal
Branch: default
Log Message:

Merge with default


diffs (truncated from 1342 to 300 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2903,7 +2903,7 @@
        Mapi mid;
 
        /* if it doesn't make sense, don't try to crash */
-       if (host == NULL || (host[0] != '/' && port <= 0) || pattern == NULL)
+       if (pattern == NULL)
                return NULL;
 
        mid = mapi_mapi(host, port, "mero", "mero", "resolve", pattern);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -3210,7 +3210,7 @@
 echo "    LDFLAGS:    ${LDFLAGS}"
 echo
 echo "* Enabled/disabled components:"
-for comp in common monetdb{4,5} sql geom unixodbc java testing; do
+for comp in common monetdb5 sql geom unixodbc java testing; do
        echo $ECHO_N "    $comp is $ECHO_C"
        eval "if test \"x\$enable_$comp\" = xno ; then echo 
\"${ECHO_T}disabled\"; else echo \"${ECHO_T}enabled\"; fi"
 done
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -2,12 +2,10 @@
 debian/tmp/usr/lib/libmonetdb5.so.* usr/lib
 debian/tmp/usr/lib/monetdb5/autoload/70_vault.mal usr/lib/monetdb5/autoload
 debian/tmp/usr/lib/monetdb5/autoload/72_fits.mal usr/lib/monetdb5/autoload
-debian/tmp/usr/lib/monetdb5/lib_batxml.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_crackers.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_fits.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_mal_compiler.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/lib_vault.so usr/lib/monetdb5
-debian/tmp/usr/lib/monetdb5/lib_xml.so usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/aggr.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/alarm.mal usr/lib/monetdb5
 debian/tmp/usr/lib/monetdb5/algebra.mal usr/lib/monetdb5
diff --git a/monetdb5/extras/rdf/10_rdf.mal b/monetdb5/extras/rdf/10_rdf.mal
deleted file mode 100644
--- a/monetdb5/extras/rdf/10_rdf.mal
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
-#
-# 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-2011 MonetDB B.V.
-# All Rights Reserved.
-
-# This loads the MonetDB/RDF module
-include tokenizer;
-include rdf;
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
@@ -24,26 +24,8 @@
 
 MTSAFE
 
-lib__rdf = {
-       MODULE
+lib_rdf = {
+       NOINST
        DIR = libdir/monetdb5
        SOURCES = rdf.mx rdf_shredder.mx
-       LIBS = ../../tools/libmonetdb5 \
-               ../../../gdk/libbat \
-               $(MALLOC_LIBS) $(raptor_LIBS)
 }
-
-headers_mal = {
-       HEADERS = mal
-       DIR = libdir/monetdb5
-       SOURCES = rdf.mx
-}
-
-headers_autoload = {
-       HEADERS = mal
-       DIR = libdir/monetdb5/autoload
-       SOURCES = 10_rdf.mal
-}
-
-#EXTRA_DIST_DIR = Tests
-EXTRA_DIST = 10_rdf.mal
diff --git a/monetdb5/extras/rdf/rdf.mx b/monetdb5/extras/rdf/rdf.mx
--- a/monetdb5/extras/rdf/rdf.mx
+++ b/monetdb5/extras/rdf/rdf.mx
@@ -22,13 +22,6 @@
 
 @* The RDF module For MonetDB5 (aka. MonetDB/RDF)
 
-@mal
-module rdf;
-
-command shred(location:str, graphname:str, schema:str):bat[:void, :bat]
-address RDFParser
-comment "look behind you!"
-
 @h
 #ifndef _RDF_H_
 #define _RDF_H_
@@ -75,5 +68,3 @@
 #define N_GRAPH_BAT (MAP_LEX+1)
 
 #endif /* _RDF_H_ */
-
-@c
diff --git a/monetdb5/modules/mal/remote.mx b/monetdb5/modules/mal/remote.mx
--- a/monetdb5/modules/mal/remote.mx
+++ b/monetdb5/modules/mal/remote.mx
@@ -212,9 +212,9 @@
                        "your platform, sorry"); /* please upgrade to Linux, 
etc. */
 #else
        BAT *list;
-       char mero_running;
-       char path[8096];
-       int fd;
+       char *mero_uri;
+       char *p;
+       unsigned int port;
        char **redirs;
        char **or;
 
@@ -222,27 +222,23 @@
                throw(ILLARG, "remote.resolve",
                                ILLEGAL_ARGUMENT ": pattern is NULL or nil");
 
-       mero_running = 1;
-       snprintf(path, 8096, "%s/.merovingian_lock", GDKgetenv("gdk_dbfarm"));
-       fd = MT_lockf(path, F_TLOCK, 4, 1);
-       if (fd >= 0 || fd <= -2) {
-               if (fd >= 0) {
-                       /* oops, not running */
-                       close(fd);
-               }
-               mero_running = 0;
-       }
-
-       if (mero_running == 0)
-               throw(MAL, "remote.resolve", "this function needs merovingian "
-                               "to be running, please start it first");
+       mero_uri = GDKgetenv("merovingian_uri");
+       if (mero_uri == NULL)
+               throw(MAL, "remote.resolve", "this function needs the mserver "
+                               "have been started by merovingian");
 
        list = BATnew(TYPE_oid, TYPE_str, 20);
        if (list == NULL)
                throw(MAL, "remote.resolve", MAL_MALLOC_FAIL);
 
-       snprintf(path, 8096, "%s/mapi_socket", GDKgetenv("gdk_dbfarm"));
-       or = redirs = mapi_resolve(path, 0, *pat);
+       /* extract port from mero_uri, let mapi figure out the rest */
+       mero_uri+=strlen("mapi:monetdb://");
+       if ((p = strchr(mero_uri, ':')) == NULL)
+               throw(MAL, "remote.resolve", "illegal merovingian_uri setting: 
%s",
+                               GDKgetenv("merovingian_uri"));
+       port = (unsigned int)atoi(p + 1);
+
+       or = redirs = mapi_resolve(NULL, port, *pat);
 
        if (redirs == NULL)
                throw(MAL, "remote.resolve", "unknown failure when resolving 
pattern");
diff --git a/monetdb5/scheduler/run_octopus.mx 
b/monetdb5/scheduler/run_octopus.mx
--- a/monetdb5/scheduler/run_octopus.mx
+++ b/monetdb5/scheduler/run_octopus.mx
@@ -531,10 +531,10 @@
 str
 OCTOPUSbidding(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
-    bit *res = (bit*) getArgReference(stk,pci,0);
-    int j, start, k;
-    InstrPtr p;
-       lng *lbid;
+       bit *res = (bit*) getArgReference(stk,pci,0);
+       int j, start, k, i;
+       InstrPtr p;
+       lng bid;
        str *wname;
        str msg = MAL_SUCCEED;
 
@@ -550,11 +550,12 @@
        if ( octopusLocal ) { /* skip bidding for local execution */
                for (k = start + 1; k < j ; k++){
                p = getInstrPtr(mb,k);
-                       lbid = (lng*) getArgReference(stk,p,0);
-                       wname = (str*) getArgReference(stk,p,1);
+                       wname = (str*) getArgReference(stk,p,p->retc);
                        if ( strcmp(*wname, "NOTworker") == 0 )
-                       *lbid = -1;
-                       else *lbid = 0;
+                       bid = -1;
+                       else bid = 0;
+                       for ( i = 0; i < p->retc; i++) 
+                               *(lng*)getArgReference(stk,p,i) = bid;
                }
        }
     else {     /* distributed execution */
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -55,11 +55,12 @@
                   ../../storage/restrict/librestrictstore \
                   ../../storage/bpm/libbpmstore \
                   ../../common/libsqlcommon \
-                  HAVE_RAPTOR?../../../monetdb5/extras/rdf/lib_rdf \
+                  HAVE_RAPTOR?../../../monetdb5/extras/rdf/librdf \
                   ../../../monetdb5/tools/libmonetdb5 \
                   ../../../gdk/libbat \
                   ../../../common/stream/libstream \
-                  $(READLINE_LIBS) $(PTHREAD_LIBS)
+                  $(READLINE_LIBS) $(PTHREAD_LIBS) \
+                  $(raptor_LIBS)
 }
 
 
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -1316,7 +1316,7 @@
 #include <replication.h>
 #include <opt_dictionary.h>
 #ifdef HAVE_RAPTOR
-       #include <rdf.h>
+# include <rdf.h>
 #endif
 
 /* Windows doesn't have round or trunc, but it does have floor and ceil */
@@ -5541,10 +5541,9 @@
        @:gzcompression(CMDbbpexpand(&ret, &b->batCacheid,&sbuf),expand)@
 }
 @- Shredding RDF documents through SQL
-Wrapper around the RDF shredder of the rdf module of M5. The first time
-the database is going to be used for rdf run sql/src/sql/rdf.sql.
-
-An rdf file can be now shreded with SQL command:
+Wrapper around the RDF shredder of the rdf module of M5.
+
+An rdf file can be now shredded with SQL command:
 CALL rdf_shred('/path/to/location','graph name');
 
 The table rdf.graph will be updated with an entry of the form:
@@ -5604,29 +5603,26 @@
        mvc *m = NULL;
        int id = 0;
        oid rid = oid_nil;
-
-       str msg = getContext(cntxt, mb, &m, NULL);
-       if (msg)
-               return msg;
-
-       sch = mvc_bind_schema(m, *schema);
-       if ( sch == NULL)
-               throw(MAL,"sql.rdfSchred","Schema missing");
+       str msg;
+
+       rethrow("sql.rdfShred", msg, getContext(cntxt, mb, &m, NULL));
+
+       if ((sch = mvc_bind_schema(m, *schema)) == NULL)
+               throw(MAL, "sql.rdfShred", "schema missing");
+
        g_tbl = mvc_bind_table(m, sch, "graph");
        gname = mvc_bind_column(m, g_tbl, "gname");
        gid = mvc_bind_column(m, g_tbl, "gid");
 
        rid = table_funcs.column_find_row(m->session->tr, gname, *name, NULL);
-       if (rid != oid_nil) {
-               throw(SQL,"sql.rdfShred","graph name allready exists in 
rdf.graph");
-       }
+       if (rid != oid_nil)
+               throw(SQL, "sql.rdfShred", "graph name already exists in 
rdf.graph");
+
        id = (int) store_funcs.count_col(gname);
        store_funcs.append_col(m->session->tr, gname, *name, TYPE_str);
        store_funcs.append_col(m->session->tr, gid, &id, TYPE_int);
 
-       msg = RDFParser(&docbats, location, name, schema);
-       if (msg)
-               return msg;
+       rethrow("sql.rdfShred", msg, RDFParser(&docbats, location, name, 
schema));
 
        if (sizeof(oid) == 8) {
                sql_find_subtype(&tpe, "oid", 31, 0);
@@ -5653,13 +5649,12 @@
        sql_find_subtype(&tpe, "varchar", 1024, 0);
        mvc_create_column(m, map_tbl, "lexical", &tpe);
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to