14.3.1 Data Sources Page

The Data Sources page allows you to create different types of data sources. Only administrator users can manage data sources. The RDF store can be linked to an Oracle Database or to an external RDF data provider. For Oracle data sources, there are three types of connections:

  • JDBC data source defined with database parameters
  • JDBC data source defined on an application server
  • Oracle wallet connection defined in a zip file

These database connections must be available in order to link the RDF web application to the data source.

To create a data source, click Data Sources, then Create.

Figure 14-11 Data Sources Page


Data Sources Page

14.3.1.1 Creating a JDBC URL Data Source

Oracle JDBC URL is defined using the standard database parameters with user credentials.

You can perform the following steps to create a JDBC URL data source:

  1. Click JDBC URL in Figure 14-11.
    Create JDBC URL Data source dialog opens as shown:

    Figure 14-12 Creating a JDBC URL Data Source

    Description of Figure 14-12 follows
    Description of "Figure 14-12 Creating a JDBC URL Data Source"
  2. Enter the Name of the data source.
  3. Optionally, enter Description.
  4. Select the JDBC Type.
  5. Enter SID/Service Name as appropriate.
  6. Enter the Host and Port details.
  7. Enter the User and Password credentials.
  8. Click OK to create the data source.

14.3.1.2 Creating an Oracle Container Data Source

As a prerequisite to create a container data source in the RDF Graph Server and Query UI application, the JDBC data source must exist in the application server. See Creating a JDBC Data Source in WebLogic Server and Creating a JDBC Data Source in Tomcat for more information.

You can then perform the following steps to create an Oracle Container data source:

  1. Click Container in Figure 14-11.
    Create Container Data source dialog opens as shown:

    Figure 14-13 Create Container Data Source

    Create Container Data Source
  2. Enter the Name of the data source.
  3. Optionally, enter Description.
  4. Select the JNDI Name that exists on the application server.
  5. Click OK to create the data source.

14.3.1.2.1 Creating a JDBC Data Source in WebLogic Server

To create a JDBC data source in WebLogic Server:

  1. Log in to the WebLogic administration console as an administrator: http://localhost:7101/console.

  2. Click Services, then JDBC Data sources.

  3. Click New and select the Generic data source menu option to create a JDBC data source.

    Figure 14-14 Generic Data Source

    Generic Data Source
  4. Enter the JDBC data source information (name and JNDI name), then click Next.

    Figure 14-15 JDBC Data Source and JNDI

    JDBC Data Source and JNDI
  5. Accept the defaults on the next two pages.

  6. Enter the database connection information: service name, host, port, and user credentials.

    Figure 14-16 Create JDBC Data Source

    Create JDBC Data Source
  7. Click Next to continue.

  8. Click the Test Configuration button to validate the connection and click Next to continue.

    Figure 14-17 Validate connection

    Validate connection
  9. Select the server target and click Finish.

    Figure 14-18 Create JDBC Data Source

    Create JDBC Data Source

The JDBC data gets added to the data source table and the JNDI name is added to the combo box list in the create container dialog.

14.3.1.2.2 Creating a JDBC Data Source in Tomcat

There are different ways to create a JDBC data source in Tomcat. See Tomcat documentaion for more details.

The following examples denote creation of JDBC data source in Tomcat by modifying the configuration files conf/server.xml and conf/content.xml.
  • Add global JNDI resources on conf/server.xml.

    <GlobalNamingResources>
        <Resource name="jdbc/RDFUSER19c" auth="Container" global="jdbc/RDFUSER19c"
                  type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
                  url="jdbc:oracle:thin:@host.name:db_port_number:db_sid"
                  username="rdfuser" password="rdfuserpwd" maxTotal="20" maxIdle="10"
                  maxWaitMillis="-1"/>
     </GlobalNamingResources>
  • Add the resource link to global JNDI’s on conf/context.xml:

    <Context>
        <ResourceLink name="jdbc/RDFUSER19c"
                      global="jdbc/RDFUSER19c"
                      auth="Container"
                      type="javax.sql.DataSource" />
    </Context>

14.3.1.3 Creating an Oracle Wallet Data Source

To create a wallet data source in the Query UI application, you must have a wallet zip file. It can be a simple wallet zip file created with Oracle utilities such as mkstore or orapki, or a wallet downloaded from Oracle Autonomous Database.

In general, wallets are obtained from the Autonomous Database. See Download Client Credentials (Wallets) for more information to download a wallet from Oracle Autonomous Database.

The following figure displays the contents of the wallet zip file:

Figure 14-19 Cloud Wallet

Cloud Wallet

Note that the tnsnames.ora file in the wallet zip file contains the wallet service alias names, and TCPS information. It does not contain the user credentials for each service.

Using this wallet zip file, you can define an RDF wallet data source in the Query UI web application by directly entering the user credentials. Optionally, you can also have the user credentials stored inside the wallet for each desired service. If you choose to store the user credentials in the wallet, then see Storing User Credentials in a Wallet for more information.

The following describes the steps to create a wallet data source:

  1. Click Wallet in Figure 14-11.
    Create Wallet Data source dialog opens as shown:

    Figure 14-20 Wallet Data Source from cloud zip

    Wallet Data Source from cloud zip
  2. Click the upload icon and select the wallet zip file.
    The zip file gets uploaded to the server.
  3. Enter the data source Name.
  4. Optionally, enter the Description.
  5. Select the required Wallet Service name.
  6. Provide the user credentials using one of the following options as it applies to you.
    • Enable Use wallet credentials if you have stored the user credentials in the wallet.
    • Otherwise, enter directly the User and Password credentials.
  7. Optionally, enter the proxy details.

14.3.1.3.1 Storing User Credentials in a Wallet

The following steps describe the process for adding the credentials to the wallet zip file. It is important that you store this wallet file along with the credentials in a safe location for security reasons.

  1. Unzip the cloud wallet zip file in a temporary directory.
  2. Use the service name alias in the tnsnames.ora to store credentials by running the following command:

    For example, if the service name alias is db202002041627_medium:

    ${ORACLE_HOME}/bin/mkstore –wrl /tmp/cloudwallet
          –createCredential db202002041627_medium username password
  3. Zip the cloud wallet files into a new zip file.

14.3.1.4 Creating an Endpoint URL Data Source

External data sources are connected to the RDF data store using the endpoint URL.

You can execute SPARQL queries and updates to the RDF data store using a base URL. In some cases, such as Apache Jena Fuseki, there are specific URLs based on the dataset name. For example:

  • DBpedia Base URL: http://dbpedia.org/sparql

  • Apache Jena Fuseki (assuming a dataset name dset):

    • Query URL: http://localhost:8080/fuseki/dset/query

    • Update URL: http://localhost:8080/fuseki/dset/update

The RDF web application issues SPARQL queries to RDF datasets. These datasets can be retrieved from provider if a get capabilities request is available. For DBpedia, there is a single base URL to be used, and therefore a default single dataset is handled in application. For Apache Jena Fuseki, there is a request that returns the available RDF datasets in server: http://localhost:8080/fuseki/$/server. Using this request, the list of available datasets can be retrieved for specific use in an application.

You can perform the following steps to create an external RDF data source:

  1. Click Endpoint in Figure 14-11.

    Create Endpoint URL Datasource dialog opens as shown. The following figure shows an example for creating a Dbpedia data source.

    Figure 14-21 DBpedia Data Source

    DBpedia Data Source
  2. Enter the Name of the data source.
  3. Optionally, enter Description.
  4. Optionally, enter the Provider name.
  5. Enter the Base URL to access the RDF service.
  6. Optionally, enter the Query URL to run SPARQL queries.
    Note that if the Query URL is not defined, then the Base URL is used.
  7. Optionally, enter the Update URL to run SPARQL updates.
    Note that if the Update URL is not defined, then the Base URL is used.
  8. Provide the Capabilities Datasets parameter properties to retrieve the dataset information from the RDF server.
  9. Enter the Get URL address that should return a JSON response with information about the dataset.
  10. Enter the Datasets parameter property in JSON response that contains the dataset information.
  11. Enter the Dataset name parameter property in datasets parameter that contains the dataset name.

    Note:

    For Jena Fuseki, the expression ${DATASET} will be replaced by the dataset name at runtime when SPARQL queries or SPARQL updates are being executed.
  12. Click OK to create the data source.

    The following figure shows an example for creating an Apache Jena Fuseki data source.

    Figure 14-22 Apache Jena Fuseki Data Source

    Apache Jena Fuseki Data Source