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,

Reply via email to