Introduction to RDF Graph Server and Query UI

The RDF Graph Server and Query UI consists of RDF RESTful services and a Java EE client application called RDF Graph Query UI. This client serves as an administrative console for Oracle RDF and can be deployed to a Java EE container.

The RDF Graph Server and RDF RESTful services can be used to create a SPARQL endpoint for RDF graphs in Oracle AI Database.

The following figure shows the RDF Graph Server and Query UI architecture:

Figure: RDF Graph Server and Query UI

Description of the illustration architecture.png

The Oracle RDF Graph Query UI is an Oracle JET based client that can be used to manage RDF objects from different data sources, and to perform SPARQL queries and updates. This Java EE application helps to build application web pages that query and display RDF graphs. It supports queries across multiple data sources. The salient features of the RDF Graph Query UI are as follows:

The following topics describe the key concepts when working with RDF Graph Server and Query UI.

Data Sources

Data sources are repositories of RDF objects.

A data source can refer to an Oracle AI Database, or to an external RDF service that can be accessed by an endpoint URL such as Dbpedia. The data source can be defined by generic and as well as specific parameters. Some of the generic parameters are name, type, and description. Specific parameters are JDBC properties (for database data sources) and endpoint base URL (for external data sources).

Oracle Data Sources

Oracle data sources are defined using JDBC connections. Three types of Oracle JDBC data sources can be defined:

The parameters that define an Oracle AI Database data source include:

The following example shows the JSON representation of a JDBC URL data source.

{
    "name" : "rdfuser_jdbc_sid",
    "type" : "DATABASE",
    "description" : "",
    "properties" : {
	"host" : "127.0.0.1"
	"sid" : "orcl193"
	"port" : "1524",
	"user" : "rdfuser",
        "password" : "<password>"
    }
}

The following example shows the JSON representation of a container data source:

{
   "name": "rdfuser_ds_ct",
   "type": "DATABASE",
   "description": "Database Container connection",
   "properties": {
       "jndiName": "jdbc/RDFUSER193c"
   }
}

The following example shows the JSON representation of a wallet data source where the credentials are stored in the wallet:

{
   "name": "rdfuser_ds_wallet",
   "type": "DATABASE",
   "description": "Database wallet connection",
   "properties": {
       "walletService": "db202002041627_medium"
   }
}

Endpoint URL Data Sources

External RDF data sources are defined using an endpoint URL. In general, each RDF store has a generic URL that accepts SPARQL queries and SPARQL updates. Depending on the RDF store service, it may also provide some capabilities request to retrieve available datasets.

Table: External Data source Parameters

Parameters Description
name A generic name of the data source.
type The type of the data source. For external data sources, the type must be ‘ENDPOINT’.
description A generic description of the data source.
properties

Specific mapping parameters with values for data source properties:

  • base URL: the base URL to issue SPARQL queries to RDF store. This is the default URL.
  • query URL (optional): the URL to execute SPARQL queries. If defined, it will overwrite the base URL value.
  • update URL (optional): the URL to execute SPARQL updates. If defined, it will overwrite the base URL value.
  • capabilities (optional): Some RDF stores may provide a capabilities URL that returns the datasets available in service. A JSON response is expected in this case.
  • get URL: the get capabilities URL.
  • datasets parameter: defines the JSON parameter that contains the RDF datasets information.
  • dataset parameter name: defines the JSON parameter that contains the RDF dataset name.

The following example shows the JSON representation of a Dbpedia external data source :

{
  "name": "dbpedia",
  "type": "ENDPOINT",
  "description": "Dbpedia RDF data - Dbpedia.org",
  "properties": {
      "baseUrl": "http://dbpedia.org/sparql",
      "provider": "Dbpedia"
   }
}

RDF Datasets

Each RDF data source contains metadata information that describe the avaliable RDF objects.

The following describes the metadata information defined by each provider.

RDF datasets point to one or more RDF objects available in the RDF data source. A dataset definition is used in SPARQL query requests. Each provider has its own set of properties to describe the RDF dataset.

The following example shows the JSON representation of a dataset.

[
   {
     "networkOwner": "RDFUSER",
     "networkName": "MYNET",
     "models": ["M1"]
   }
]

For RDF stores that do not have a specific dataset, a simple JSON {} or a default name can be used.

REST Services

An RDF REST API allows communication between client and backend RDF data stores.

The REST services can be divided into the following groups:

Assuming the deployment of RDF web application with context-root set to orardf, on localhost machine and port number 7101, the base URL for REST requests is http://localhost:7101/orardf/api/v1.

Most of the REST services are protected with Form-based authentication. Administrator users can define a public RDF data source using the RDF Graph Server and Query UI web application. The public REST endpoints will then be available to perform SPARQL queries on published datasets.

Note: The examples in this section and throughout this chapter reference host machine as localhost and port number as 7101. These values can vary depending on your application deployment.

The following are some RDF REST examples:

A detailed list of available REST services can be found in the Swagger json file, orardf_swagger.json, which is packaged in the application documentation directory.