RDFLib / sparqlwrapper

A wrapper for a remote SPARQL endpoint
https://sparqlwrapper.readthedocs.io/
Other
520 stars 122 forks source link

Inserting entire turtle file to endpoint with query #170

Closed PR0CK0 closed 2 years ago

PR0CK0 commented 3 years ago

Hello. This is not an issue but a question. I apologize for posting here, but I have never had any luck on StackOverflow with smaller topics like SPARQL.

I am trying to take a serialized turtle file of ~2M triples and INSERT all of them into a new named graph on a GraphDB store. I am following this example, but the creation of a string 2M triples long takes several hours.

Is it possible to place a serialized turtle file into a new GraphDB named graph programatically using SPARQLWrapper?

Again, apologies for posting here; please feel free to delete the issue if it is deemed inappropriate.

nicholascar commented 2 years ago

There are indeed more efficient ways of loading data into triplestores than using the example linked to in the description.

Many triplestores, including GraphDB, support additional APIs for this, including the SPARQL Graph Store Protocol and GraphDB does this by implementing the RDF4J APIs.

So there is a non SPARQLWrapper way to do this, however SPARQL Wrapper could be extended to handle other protocols. That would be a reasonably detailed change but it wouldn't be too hard: just RESTful methods!