200 likes | 324 Views
Virtuoso Universal Server Open-Source Edition. Anton Avramov. Openlink Software - Кратка история. 1992 – Основана 1992 - Разработка на ODBC драйвери 1998 - Купува Kubl от Ори Ърлинг и започва проекта Виртуозо
E N D
Virtuoso Universal ServerOpen-Source Edition Anton Avramov
Openlink Software - Кратка история • 1992 – Основана • 1992 - Разработка на ODBC драйвери • 1998 - Купува Kubl от Ори Ърлинг и започва проекта Виртуозо • 2000 - Сформира се мултинационален екип България, Русия, Новосибирск, Холандия, Финландия, САЩ, Англия и др. • 2006 - Пуска се Open-Source Версия
Проектът Virtuoso • Virtuoso Universal Server • DB Server, WEB Server, … • Компилирана на 32 платформи • Linux • Windows • MacOS • Solaris • SunOS • FreeBSD • HP-UX • ….
Проектът Virtuoso - възможности • Database Server • SQL-200n (including SQLX) • Stored procedures, User Define Type, Views, Triggers, Indexes, Free-text indexes • XML Storage, XML Free text index, XSLT, XML Schema, XPath, and XQuery • Web Application Server • Hosting (PHP, Perl, Python, Java, CLR, .Net & ASPX Host, Mono, Ruby) • VSP, VSPX Web Services SOAP, WSDL, UDDI, WS-Security, WS-Routing, WS-ReliableMessaging, WS-Policy, WS-Addressing, BPEL4WS • Internet & Web • HTTP, WebDAV, SMTP, POP3, LDAP, FTP, NNTP • Blogging & Weblogs • … и други
Application Server – VSP <html> <body> <p> <?vsphttp(‘Hello World’); ?> </p> <?vsp declare name varchar; name := ‘Pesho’; ?> <p> My name is <?V name ?>. </p> </body> </html> • Текстов файл в файловата система или WebDav • Автоматучно компилиране до процедура в базата дани
Application Server - VSP <html> <body> <table> <?vsp for( SELECT name, address FROM customers WHERE country = ‘BG’) do{ ?> <tr> <td><?V name ?></td><td><?V address ?></td> </tr> <?vsp } if (true) { DBA.DB.myprocedure(params); } ?> </table> </body> </html> <?vsphttp_xslt ('file://my_transformation.xslt'); ?> SQL oптимизатор на заявките
Database • Начини за връзка • ISQL – Interactive SQL • Conductor – Web Interface • http://localhost:8889/conductor • ODBC, JDBC • Visual Studio Plugin – OPL Explorer …. $isql localhost:1111 dba dba SQL> select * from my_table; … SQL> select my_procedure(); ….
Database • Views, Triggers – Instead of
Database - Indexes • SQL Inverse Functions -- Създаваме view CREATE VIEW euro_item AS SELECT id, dollar_to_euro (price) as price, name FROM item; -- Декларираме реципрочни функций db.dba.sinv_create_inverse ('euro_to_dollar', 'dollar_to_euro', 1); -- Изпълняваме запистване SELECT * FROM euro_item WHERE price > 100; -- Нормално това би означавало SELECT * FROM item WHERE dollar_to_euro (I_price) > 100; -- Но благодарение на реципрочната функция се изпълнява SELECT * FROM item WHERE price > euro_to_dollar (100);
Database – Free text indexes • Контрол върху индексираните данни CREATE TABLE channels (c_id integer,title varchar,primary key (c_id); CREATE TABLE articles (c_id integerreferenceschannels, a_id integer,content long varchar,primary key (c_id, a_id); CREATE TEXT INDEXON articles (content) using function ; CREATE PROCEDURE articles_content_index_hook ( inout vtb any, inouti_id any ) { vt_batch_feed (vtb, (SELECT title FROMchannelsWHEREa_id = i_id), 0); return 0; }; SELECTTOP 10 * FROM articles WHEREcontains(content, ’sample’);
Database – XML Support CREATE TABLE my_xml (id integer, content any); INSERT INTO my_xml (1,xtree_doc(’ <root><node attr=“hello”>text</node></root> ’)); SELECT * FROMmy_xmlWHERE xpath_eval(‘//node[@attr = “hello”]’); SELECT * FROM my_xml WHERExpath_contains(‘//node’,’text’); CREATE TEXT XML INDEXmy_xml(content); SELECT * FROM my_xml WHERExcontains(content, ’//node[. = “text”]’); SELECT * FROM my_xml WHERExcontains(content, ’//node[text-contains (., “text”) ]’);
Database – XML (FOR XML Clause) xmla (‘SELECT "CategoryID", "CatName", "ProdName", "ProductID" FROM "Categories" as "category", "Products" as "product" WHERE "product"."CategoryID" = "category"."CategoryID" FOR XML AUTO ELEMENT'); -------------- <category> <CategoryID>1</CategoryID><CatName>Beverages</CatName> <product> <ProdName>Chai</ProdName> <ProductID>1</ProductID> </product> <product> <ProdName>Chang</ProdName> <ProductID>2</ProductID> </product> … </category> <category> … • RAW, AUTO, EXPLICIT
Database – XML - SQLX SELECTXMLELEMENT ('FullAddress', XMLATTRIBUTES ( "PostalCode", "City"), xtree_doc ('<Region>WA</Region>'), xquery_eval('//@country', xtree_doc('<a country="USA"/>')), XMLELEMENT('emp', "LastName")) FROM "Demo"."demo"."Employees“; ---------------------------- <FullAddress PostalCode="98122" City="Seattle" country="USA"> <Region>WA</Region> <emp>Davolio</emp> </FullAddress> <FullAddress PostalCode="98401" City="Tacoma" country="USA"> <Region>WA</Region> <emp>Fuller</emp> </FullAddress> . . .
UDT – User Defined Types CREATE TYPEmy_udtas (A integer default 12) methodnegative() returnsinteger; CREATE METHODnegative () returnsintegerformy_udt { return self.A * -1; } CREATETABLEudt_table (ID integerprimary key, DATA my_udt); INSERT INTOudt_table (ID, DATA) VALUES (1, newmy_udt ()); SELECT C.DATA.A FROMudt_table C where C.ID = 1; SELECT C.ID FROMudt_table C WHERE C.DATA.A > 10; SELECT C.ID FROMudt_table C WHERE C.DATA.negavite() < -10;
WebServices – SOAP CREATE TYPE“WS”.”soap_demo”.soap_udtas () methodgetCurrency( in cnt_code varchar) returnsvarchar; CREATE METHODgetCurrency (in cnt_code varchar) returnsvarcharfor“WS”.”soap_demo”. soap_udt { return(SELECT amount FROM currencies WHERE code = cnt_code); }; vhost_define(vhost=>'*ini*',lhost=>'*ini*',lpath=>'/myendpoint', ppath=>'/SOAP/',soap_user=>‘soap_demo') ); GRAND EXECUTE ON “WS”.”soap_demo”.soap_udt TO soap_demo; http://localhost:8889/myendpoint/services.wsdl http://localhost:8889/myendpoint/services.vsmx
RDF Database • Що е то Semantic Web?
RDF Database • Аз направих тази статия!
RDF Database ... <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/" > ... <item rdf:about="http://c.moreover.com/click/here.pl?r123"> <title>XML: A Disruptive Technology</title> <link>http://c.moreover.com/click/here.pl?r123</link> <dc:subject> <rdf:Description> <rdf:value>XML</rdf:value> </rdf:Description> </dc:subject> </item> ...
SPARQL • Намери ми всичко …. PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ns: <http://example.org/ns#> SELECT ?title ?price WHERE { ?x ns:price ?price . FILTER (?price < 30) . ?x dc:title ?title . }
Въпроси? Контакт: Антон Аврамов aavramov@openlinksw.com Връзки: http://virtuoso.openlinksw.com/wiki/main/Main/ http://sourceforge.net/projects/virtuoso http://virtuoso.openlinksw.com/ http://www.openlinksw.com/