UpdateAPI: How to use it
RDF Suite RSSDB RDF Update API Download UpdateAPI Installation API specification Usage Error Handling
In the following we consider UpdateAPI as
compiled and the resulting library file
(rql-spi-api.so) is installed in a location known by the user. We will
refer to this location as
UpdateApiPath and we will use
it as a variable (so we can say that the library file is located at UpdateApiPath/rql-spi-api.so ). In
your applications and tests you
must replace UpdateApiPath with the actuall location of the library
file. By default, the library is located at the BIN directory inside
the UpdateAPI source directory.
1. Using UpdateAPI through postgres interactive command line client (psql)
1.1 Loading UpdateAPI
| > create function
create_instance(text,text,text) returns int4 as 'UpdateApiPath/rql-spi-api.so' language 'c'; CREATE FUNCTION > create function delete_object(text, text, text, int4) returns int4 as 'UpdateApiPath/rql-spi-api.so' language 'c'; CREATE FUNCTION > create function add_property(text, text, text, text) returns int4 as 'UpdateApiPath/rql-spi-api.so' language 'c'; CREATE FUNCTION > create function delete_property(text, text, text, text, int4) returns int4 as 'UpdateApiPath/rql-spi-api.so' language 'c'; CREATE FUNCTION > create function update_property(text, text, text, text, text, int4) returns int4 as 'UpdateApiPath/rql-spi-api.so' language 'c'; CREATE FUNCTION > |
1.2 Using UpdateAPI methods
| > select create_instance('#davinci','','artist'); 1 > select delete_object('#guernica', '', 'painting', 0); 1 > select add_property('', 'title', '#guernica', 'Guernica'); 1 > select delete_property('#guernica', '', 'painting', 0); 1 > select update_property('#guernica', '', 'painting', 0); 1 > |
1.3 Removing UpdateAPi methods
| > drop function
create_instance(text,text,text); DROP FUNCTION > drop function delete_object(text, text, text, int4); DROP FUNCTION > drop function add_property(text, text, text, text); DROP FUNCTION > drop function delete_property(text, text, text, text, int4); DROP FUNCTION > drop function update_property(text, text, text, text, text, int4); DROP FUNCTION > |
2 Using UpdateAPI with java and JDBC
2.1 Loading UpdateAPI
2.2 Using UpdateAPI
2.3 Removing UpdateAPI