Getting Started with RDF Data in a Schema-Private Network
-
Create a tablespace for the system tables. You must be connected as a user with appropriate privileges to create the tablespace. The following example creates a tablespace named
rdf_tblspace:CREATE TABLESPACE rdf_tblspace DATAFILE 'rdf_tblspace.dat' SIZE 1024M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED SEGMENT SPACE MANAGEMENT AUTO; -
Create a database user to work with RDF data in the database and grant the necessary privileges to the database user. You must be connected as a user with appropriate privileges to create the database user.
The following example creates a network owner user
rdfuserand grants the necessary privileges tordfuser:CREATE USER rdfuser IDENTIFIED BY <password-for-rdfuser> QUOTA 5G ON rdf_tblspace; GRANT CONNECT, RESOURCE, CREATE VIEW TO rdfuser; -
Connect as the network owner user.
CONNECT rdfuser/<password-for-rdfuser> -
Create a schema-private RDF network.
Creating an RDF network adds RDF data support to an Oracle AI Database. You must create an RDF network as the intended owner of the schema-private network, specifying a valid tablespace with adequate space.
The following example creates a schema-private RDF network named
net1owned by a database user namedrdfuserusing a tablespace namedrdf_tblspace:EXECUTE SEM_APIS.CREATE_RDF_NETWORK('rdf_tblspace', network_owner=>'rdfuser', network_name=>'net1'); -
Create an RDF graph.
When you create an RDF graph, you specify the RDF graph name, the table to hold references to RDF data for the graph, and the column of type SDO_RDF_TRIPLE_S in that table.
The following command creates an RDF graph named
articlesin thenet1schema-private network.EXECUTE SEM_APIS.CREATE_RDF_GRAPH('articles', NULL, NULL, network_owner=>'rdfuser', network_name=>'net1');
After you create the RDF graph, you can insert triples into the graph, as shown in the examples in RDF Graph Management Examples (PL/SQL and Java).