Using RDF4J Workbench to connect to a Neptune DB instance
This section walks you through connecting to an Amazon Neptune DB instance using RDF4J Workbench and RDF4J Server. RDF4J Server is required because it acts as a proxy between the Neptune SPARQL HTTP REST endpoint and RDF4J Workbench.
RDF4J Workbench provides an easy interface for experimenting with a graph, including
loading local files. For information, see the Add section
Prerequisites
Before you begin, do the following:
Install Java 1.8 or later.
Install RDF4J Server and RDF4J Workbench. For information, see Installing RDF4J Server and RDF4J Workbench
.
To use RDF4J Workbench to connect to Neptune
-
In a web browser, navigate to the URL where the RDF4J Workbench web app is deployed. For example, if you are using Apache Tomcat, the URL is: https://
ec2_hostname
:8080/rdf4j-workbench/. -
If you are asked to Connect to RDF4J Server, verify that RDF4J Server is installed, running, and that the server URL is correct. Then, proceed to the next step.
-
In the left pane, choose New repository.
In New repository:
In the Type drop-down list, choose SPARQL endpoint proxy.
For ID, type neptune.
For Title, type Neptune DB instance.
Choose Next.
-
In New repository:
For SPARQL query endpoint URL, type
https://
.your-neptune-endpoint
:port
/sparqlFor SPARQL update endpoint URL, type
https://
.your-neptune-endpoint
:port
/sparql
For information about finding the address of your Neptune DB instance, see the Connecting to Amazon Neptune Endpoints section.
Choose Create.
-
The neptune repository now appears in the list of repositories. It might take a few minutes before you can use the new repository.
-
In the Id column of the table, choose the neptune link.
-
In the left pane, choose Query.
Note
If the menu items under Explore are disabled, you might need to reconnect to the RDF4J Server and choose the neptune repository again.
You can do this by using the [change] links in the upper-right corner.
-
In the query field, type the following SPARQL query, and then choose Execute.
select ?s ?p ?o where {?s ?p ?o} limit 10
The preceding example returns up to 10 of the triples (subject-predicate-object) in the
graph by using the ?s ?p ?o
query with a limit of 10.