2.1 Getting Started with RDF Data in a Schema-Private Network

  1. 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;
    
  2. 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 rdfuser and grants the necessary privileges to rdfuser:
    CREATE USER rdfuser
    IDENTIFIED BY <password-for-rdfuser> 
    QUOTA 5G ON rdf_tblspace;
    
    GRANT CONNECT, RESOURCE, CREATE VIEW TO rdfuser;
  3. Connect as the network owner user.
    CONNECT rdfuser/<password-for-rdfuser>
  4. Create a schema-private RDF network.

    Creating an RDF network adds RDF data support to an Oracle 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 net1 owned by a database user named rdfuser using a tablespace named rdf_tblspace:

    EXECUTE SEM_APIS.CREATE_RDF_NETWORK('rdf_tblspace', network_owner=>'rdfuser', network_name=>'net1');
  5. 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 articles in the net1 schema-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).