Amazon Neptune
User Guide (API Version 2017-11-29)

Accessing the Neptune Graph with SPARQL

SPARQL is a query language for the Resource Description Framework (RDF), which is a graph data format designed for the web. Amazon Neptune is compatible with SPARQL 1.1. This means that you can connect to a Neptune DB instance and query the graph using the query language described in the SPARQL 1.1 Query Language specification.

A query in SPARQL consists of a SELECT clause to specify the variables to return and a WHERE clause to specify which data to match in the graph. If you are unfamiliar with SPARQL queries, see Writing Simple Queries in the SPARQL 1.1 Query Language.


Neptune does not support SPARQL UPDATE LOAD from URI. For small datasets, SPARQL UPDATE INSERT might be an option. If you need to load data from a file, see Loading Data into Amazon Neptune.

SPARQL XPath Constructor Functions Supported by Neptune

The SPARQL standard allows SPARQL engines to support an extensible set of XPath constructor functions. Neptune currently supports the following constructor functions, where the xsd prefix is defined as

  • xsd:boolean

  • xsd:integer

  • xsd:double

  • xsd:float

  • xsd:decimal

  • xsd:long

  • xsd:unsignedLong

Before you begin, you must have the following:

  • A Neptune DB instance. For information about creating a Neptune DB instance, see Getting Started with Neptune.

  • An Amazon EC2 instance in the same virtual private cloud (VPC) as your Neptune DB instance.