Fuseki provides a standard SPARQL endpoint, i.e. accessible via standard HTTP protocol. Just use a Python API like SPARQLWrapper [1] to query the data in the Fuseki endpoint and you're done.
By the way, not sure what you mean by "RDFLib slow" - if you mean loading the data into the in-memory module, ok. But otherwise, SPARQLWrapper provides remote SPARQL endpoint access via HTTP. That's the way to go. [1] https://rdflib.github.io/sparqlwrapper/ On 01.11.19 15:52, Anandh Perumal Konar wrote: > Hello Everyone, > > I'm new to Apache Jena, > I'm doing some experiments with DBpedia database. > I have uploaded the DBpedia data into the apache Jena Fuseki server. > Now I want to know is there a way to connect to the Apache server from > python. > > I found the below code in some forum but I don't understand what is > /path/to/tdbstore and moreover without specifying anything about my apache > server how can it connect to my server. > > import jaydebeapi > jclass = "org.apache.jena.jdbc.JenaJDBC" > conn_string = "jdbc:jena:tdb:location=/path/to/tdbstore" > conn = jaydebeapi.connect(jclass, conn_string) > cursor = conn.cursor() > query = """ > SELECT DISTINCT ?a > WHERE { > ?a ?b ?b . > } > """ > cursor.execute(query)# do something with the results > cursor.close() > conn.close() > > > I have read about RDFLib for python but that would be very slow when the > data is big. > > Any leads will be appreciated. > > Thanks, >
