How to automate creation of property tables in monetdb?
I am trying to load data (from myfile, the format of myfile is explained
below) into monetdb using itsSQL interface. mytable format:
1 2 3
5 7 8
8 2 3.....
The commands which I am using for performing the same are given below:
sql> create table mytable(subject integer, property integer, object integer);
sql> copy 10000000 records into mytable from myfile delimiter ' ','\n';
For each property value (i.e. middle column) I create a separate table:
create table prop1(subject integer, object integer);
create table prop2(subject integer, object integer);
create table prop3(subject integer, object integer); ...
and then fill these tables using the following commands:
INSERT into prop1 SELECT subject, object FROM triples_table where
property=prop1 ORDER BY subject, object;
Is there some way to automate this process. i.e. right now I am manually
creating a separate table for all the distinct properties (using create
table prop1(subject integer, object integer); ) and then filling this table
using insert command (INSERT into prop1 SELECT subject, object FROM
triples_table where property=prop1 ORDER BY subject, object; ). Is there
some way by which I may automate this procedure.
One of the methods which I know of is to create a C++/python program and
then call all functions like "create table" by using shell script. But is
there a faster method to achieve the same.
Also can you please guide as to how can I create and integrate dictionary
(RDF: id to string mapping) to sql queries?
A gentle reminder. Can someone please help me with this?
On Fri, Sep 20, 2013 at 7:58 PM, Rose Beck
I am trying to load data (from myfile, the format of myfile is explained below) into monetdb using itsSQL interface. mytable format:
1 2 3 5 7 8 8 2 3.....
The commands which I am using for performing the same are given below:
sql> create table mytable(subject integer, property integer, object integer);
sql> copy 10000000 records into mytable from myfile delimiter ' ','\n';
For each property value (i.e. middle column) I create a separate table:
create table prop1(subject integer, object integer); create table prop2(subject integer, object integer); create table prop3(subject integer, object integer); ...
and then fill these tables using the following commands:
INSERT into prop1 SELECT subject, object FROM triples_table where property=prop1 ORDER BY subject, object;
Is there some way to automate this process. i.e. right now I am manually creating a separate table for all the distinct properties (using create table prop1(subject integer, object integer); ) and then filling this table using insert command (INSERT into prop1 SELECT subject, object FROM triples_table where property=prop1 ORDER BY subject, object; ). Is there some way by which I may automate this procedure.
One of the methods which I know of is to create a C++/python program and then call all functions like "create table" by using shell script. But is there a faster method to achieve the same.
Also can you please guide as to how can I create and integrate dictionary (RDF: id to string mapping) to sql queries?
A gentle reminder. Can someone please help me with this? Consult your SQL background. You should know that SQL standard does not
On 9/21/13 8:19 AM, Rose Beck wrote: permit/support conversion of string-expressions into table-names. RDF processing and its catalog management is not an integral part of the system, there is no RDF base type. good luck. Martin
On Fri, Sep 20, 2013 at 7:58 PM, Rose Beck
mailto:rosebeck.82@gmail.com> wrote: I am trying to load data (from myfile, the format of myfile is explained below) into monetdb using its|SQL|interface. mytable format:
|1 2 3
5 7 8
8 2 3 .....|
The commands which I am using for performing the same are given below:
|sql> create table mytable(subject integer, property integer, object integer);
sql> copy10000000 recordsinto mytablefrom myfile delimiter'','\n';|
For each property value (i.e. middle column) I create a separate table:
|create table prop1(subject integer, object integer); create table prop2(subject integer, object integer); create table prop3(subject integer, object integer); ... |
and then fill these tables using the following commands:
|INSERTinto prop1 SELECT subject, object FROM triples_tablewhere property=prop1 ORDER BY subject, object;|
Is there some way to automate this process. i.e. right now I am manually creating a separate table for all the distinct properties (using|create table prop1(subject integer, object integer);|) and then filling this table using insert command (|INSERT into prop1 SELECT subject, object FROM triples_table where property=prop1 ORDER BY subject, object;|). Is there some way by which I may automate this procedure.
One of the methods which I know of is to create a C++/python program and then call all functions like "create table" by using shell script. But is there a faster method to achieve the same.
Also can you please guide as to how can I create and integrate dictionary (RDF: id to string mapping) to sql queries?
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Martin Kersten
-
Rose Beck