1 / 8

Oracle RDF Scientific American Example

Oracle RDF Scientific American Example. The following is just for Dr. Cannata to do CREATE TABLESPACE rdf_tblspace DATAFILE 'C:APPADMINISTRATORORADATAORCLdf_tblspace.dat' SIZE 1024M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO;

duncan
Download Presentation

Oracle RDF Scientific American Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Oracle RDF Scientific American Example The following is just for Dr. Cannata to do CREATE TABLESPACE rdf_tblspace DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\rdf_tblspace.dat' SIZE 1024M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO; EXECUTE SEM_APIS.CREATE_SEM_NETWORK ('rdf_tblspace');

  2. _____________________________________________________ Only do this if you’re starting over. DROP TABLE Cannata_rdf_data cascade constraints ; DROP SEQUENCE triple_number ; DROP TRIGGER "PHIL"."TRIPLE_NUMBER_TRIGGER“ EXECUTE SDO_RDF.DROP_RDF_MODEL('Cannata_model') ; EXECUTE SDO_RDF_INFERENCE.DROP_RULEBASE('Cannata_rb') ; _____________________________________________________ Start Here. CREATE TABLE Cannata_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S) ; CREATE SEQUENCE triple_number start with 1 increment by 1 nomaxvalue; CREATE TRIGGER triple_number_trigger before insert on Cannata_rdf_data for each row begin select triple_number.nextval into :new.id from dual; end; / EXECUTE sdo_rdf.create_rdf_model('Cannata_model', 'Cannata_rdf_data', 'triple') ; EXECUTE SDO_RDF_INFERENCE.CREATE_RULEBASE(‘Cannata_rb') ;

  3. create or replace function strreplace(str varchar2, from_str varchar2, to_str varchar2) return varchar2 AS str_temp varchar2(4000); str_pos number := instr(str, from_str); BEGIN str_temp := str; while ( str_pos > 0 ) loop str_temp := substr(str_temp, 0, str_pos-1) || to_str || substr(str_temp, str_pos + length(from_str)); str_pos := instr(str_temp, from_str); end loop; return str_temp; END;

  4. Insert Data – click link to see data 20 Scientific American.sql

  5. SELECT strreplace(x, 'sa:', '') "C" FROM TABLE(SDO_RDF_MATCH( ' (?x :MEANS :NYC) ', SDO_RDF_Models('cs347_49_model'), SDO_RDF_Rulebases ('RDFS', 'cs347_49_RB'), SDO_RDF_Aliases (SDO_RDF_Alias('', 'sa:')), null)) SELECT strreplace(z, 'sa:', '') "A", strreplace(y, 'sa:', '') "B", strreplace(x, 'sa:', '') "C" FROM TABLE(SDO_RDF_MATCH( ' (?x :MEANS :NYC)(?y :MEANS :SetIn)(?z :MEANS :Sitcoms)(?z ?y ?x) ', SDO_RDF_Models('cs347_49_model'), SDO_RDF_Rulebases ('RDFS', 'cs347_49_RB'), SDO_RDF_Aliases (SDO_RDF_Alias('', 'sa:')), null))

More Related