Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARQLConnector does not work with AWS Neptune #1231

Closed
zednis opened this issue Jan 20, 2021 · 1 comment
Closed

SPARQLConnector does not work with AWS Neptune #1231

zednis opened this issue Jan 20, 2021 · 1 comment

Comments

@zednis
Copy link

zednis commented Jan 20, 2021

summary

  • using rdflib 5.0.0 SPARQLUpdateStore to connect to AWS Neptune SPARQL endpoint
  • programmatic reads work
  • add( ) does not work
  • query( ) does not work

versions

  • Python 3.9.1
  • rdflib 5.0.0

code:

from rdflib.resource import Resource
from rdflib.namespace import SKOS, DCTERMS, XSD, RDFS

from rdflib.plugins.stores import sparqlstore

SPARQL_ENDPOINT = "https://dev-taxonomy-neptune-cluster.cluster-cab44ucmi0fe.us-east-1.neptune.amazonaws.com:8182/sparql"

store = sparqlstore.SPARQLUpdateStore(returnFormat='application/rdf+xml')
store.open((SPARQL_ENDPOINT, SPARQL_ENDPOINT))
store.bind("dcterms", DCTERMS)
ds = Dataset(store, default_union=True)

ds.add((DCTERMS.source, RDF.type, OWL.DatatypeProperty))

error:

  File "/Users/stephan.zednik/Projects/dhi/dhi-taxonomy-knowledge-graph-editor/example.py", line 15, in <module>
    ds.add((DCTERMS.source, RDF.type, OWL.DatatypeProperty))
  File "/usr/local/lib/python3.9/site-packages/rdflib/graph.py", line 1396, in add
    self.store.add((s, p, o), context=c, quoted=False)
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 551, in add
    self.commit()
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 527, in commit
    self._update('\n;\n'.join(self._edits))
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 606, in _update
    SPARQLConnector.update(self, update)
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlconnector.py", line 124, in update
    res.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://dev-taxonomy-neptune-cluster.cluster-cab44ucmi0fe.us-east-1.neptune.amazonaws.com:8182/sparql
@nicholascar
Copy link
Member

@ghost ghost locked and limited conversation to collaborators Dec 26, 2021
@ghost ghost converted this issue into discussion #1600 Dec 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants