0

The following Python script executes a SPARQL CONSTRUCT query returning the contents of the named graph <urn:x-evn-master:named_graph> as text/turtle

import os
import getpass

import requests  # pip install requests

username = os.environ.get('USERNAME')
password = getpass.getpass()
sparql_endpoint = "https://example.com/edg/tbl/sparql"

response = requests.post(
    sparql_endpoint,
    headers={ "Accept": "text/turtle" },
    params={ "default-graph-uri": "urn:x-evn-master:named_graph" },
    data={ "query": "CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}" },
    auth=requests.auth.HTTPBasicAuth(username, password)
)

print(response.text)

Does anyone know how I should format a SPARQL Update query?

I'm having trouble finding documentation on Topbraid EDG's HTTP API.

Neil Graham
  • 593
  • 1
  • 5
  • 17

0 Answers0