Changeset: da0510e84f28 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=da0510e84f28
Modified Files:
        debian/monetdb5-server.install
        monetdb5/extras/rdf/10_rdf.mal
        sql/backends/monet5/sql.mx
Branch: default
Log Message:

Merge with Mar2011 branch.


diffs (218 lines):

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/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);
 
-       if ((graph = BATdescriptor(docbats)) == NULL) {
+       if ((graph = BATdescriptor(docbats)) == NULL)
                throw(SQL, "sql.rdfShred", "docbat is missing");
-       }
+
        g = (bat *) Tloc(graph, BUNfirst(graph));
 
-       s =  BATdescriptor(g[MAP_LEX]);
-       if ( s == NULL){
+       if ((s =  BATdescriptor(g[MAP_LEX])) == NULL) {
                BBPreleaseref(graph->batCacheid);
                throw(SQL, "sql.rdfShred", "map_lex is missing");
        }
@@ -5684,18 +5679,13 @@
        @:crt_col(spo_tbl,S_sort,P_sort,O_sort)@
 #endif /* STORE */
 
-
-
-
        /* unfix graph */
        BBPunfix(graph->batCacheid);
 
        return MAL_SUCCEED;
-
-
 #else
        (void) cntxt; (void) mb; (void) stk; (void) pci;
-       throw(SQL, "sql.rdfShred", "RDF support is missing from Monet5");
+       throw(SQL, "sql.rdfShred", "RDF support is missing from MonetDB5");
 #endif /* RDF */
 }
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to