SPARQL Sparql Graph API
The Sparql Graph API from SPARQL — 1 operation(s) for sparql graph.
The Sparql Graph API from SPARQL — 1 operation(s) for sparql graph.
openapi: 3.1.0
info:
title: SPARQL 1.1 Protocol Query Sparql Graph API
description: 'SPARQL 1.1 Protocol is a W3C Recommendation that defines how to convey
SPARQL queries and updates between clients and SPARQL processors over
HTTP. It defines two operations — `query` and `update` — each of which
can be invoked over HTTP with several encodings of the SPARQL string.
This OpenAPI description models only the protocol operations explicitly
defined in https://www.w3.org/TR/sparql11-protocol/. It does not model
any vendor-specific authentication scheme; the spec leaves authentication
to implementations ("implementations may choose to use HTTP authentication
mechanisms or other implementation-defined mechanisms"). The example
server is the public DBpedia SPARQL endpoint which accepts query
requests without authentication.
The Graph Store HTTP Protocol (a sibling specification at
https://www.w3.org/TR/sparql11-http-rdf-update/) is not modeled here.
'
version: '1.1'
contact:
name: W3C SPARQL Working Group
url: https://www.w3.org/TR/sparql11-protocol/
license:
name: W3C Document License
url: https://www.w3.org/Consortium/Legal/2015/doc-license
servers:
- url: https://dbpedia.org
description: Public DBpedia SPARQL endpoint (no auth)
- url: https://{host}
description: Generic SPARQL 1.1 endpoint
variables:
host:
default: example.org
description: Hostname of a SPARQL 1.1 endpoint
tags:
- name: Sparql Graph
paths:
/sparql-graph:
get:
operationId: graphStoreGet
summary: SPARQL Retrieve Graph (Graph Store Protocol)
description: Retrieves an RDF graph from the SPARQL Graph Store using HTTP GET. Part of the SPARQL 1.1 Graph Store HTTP Protocol for managing named graphs and the default graph.
parameters:
- name: graph
in: query
description: URI of the named graph to retrieve. If omitted, the default graph is returned.
schema:
type: string
format: uri
- name: default
in: query
description: Set to empty string to request the default graph
schema:
type: string
- name: Accept
in: header
schema:
type: string
enum:
- text/turtle
- application/rdf+xml
- application/ld+json
- application/n-triples
- application/n-quads
default: text/turtle
responses:
'200':
description: Graph returned successfully
content:
text/turtle:
schema:
type: string
application/rdf+xml:
schema:
type: string
application/ld+json:
schema:
type: object
'404':
description: Named graph not found
tags:
- Sparql Graph
put:
operationId: graphStorePut
summary: SPARQL Replace Graph (Graph Store Protocol)
description: Replaces the contents of a graph with the provided RDF data. Creates the graph if it does not exist.
parameters:
- name: graph
in: query
description: URI of the named graph to replace
schema:
type: string
format: uri
- name: default
in: query
description: Set to empty string to target the default graph
schema:
type: string
requestBody:
required: true
content:
text/turtle:
schema:
type: string
application/rdf+xml:
schema:
type: string
application/ld+json:
schema:
type: object
responses:
'200':
description: Graph replaced successfully
'201':
description: Graph created successfully
'204':
description: Graph replaced successfully (no content)
'400':
description: Malformed RDF payload
tags:
- Sparql Graph
post:
operationId: graphStorePost
summary: SPARQL Merge into Graph (Graph Store Protocol)
description: Merges the provided RDF data into the specified graph, adding triples without removing existing ones.
parameters:
- name: graph
in: query
description: URI of the named graph to merge into
schema:
type: string
format: uri
- name: default
in: query
description: Set to empty string to target the default graph
schema:
type: string
requestBody:
required: true
content:
text/turtle:
schema:
type: string
application/rdf+xml:
schema:
type: string
application/ld+json:
schema:
type: object
responses:
'200':
description: Triples merged successfully
'204':
description: Triples merged successfully (no content)
'400':
description: Malformed RDF payload
tags:
- Sparql Graph
delete:
operationId: graphStoreDelete
summary: SPARQL Delete Graph (Graph Store Protocol)
description: Deletes a named graph or clears the default graph.
parameters:
- name: graph
in: query
description: URI of the named graph to delete
schema:
type: string
format: uri
- name: default
in: query
description: Set to empty string to clear the default graph
schema:
type: string
responses:
'200':
description: Graph deleted successfully
'204':
description: Graph deleted successfully (no content)
'404':
description: Named graph not found
tags:
- Sparql Graph