-
How to create a SPARQL enpoint using Apache Jena Fuseki & Heroku
- Prerequistes:- Basic understanding of Git, Heroku & command line or powershell or terminal
-
Step 1:- Clone this repo in your local system using command
git clone https://github.com/swinton/fuseki-heroku(make sure to install git in your system from here )
- Step 2:- Copy your RDF / Knowledge graph in the
/Data/folder (make sure to delete all other extra RDFs from that folder) for reference check below screenshot, I have addedproduct.ttlfile into the/Data/folder.
-
Step 3:- Download Procfile from the current report and delete the old
Procfilefrom thefuseki-herokufolder and replace it with the one I have provided. -
Step 4:- Open
Procfileusing any text editor and make changes according to your rdf file. As in below screenshot you can see my file name isproduct.ttlmake sure to changes according to your rdf file name.
- Example of Procfile:-
Let's say your rdf name is
record.ttlthen your required Procfile will be
web: ./fuseki-server --update --port=$PORT --file=Data/record.ttl /record
private: ./fuseki-server --port=56276 --file=Data/record.ttl /record
- Step 5:- Create a new account (If you haven't already) on Heroku & create a new app with any name you want, for this tutorial I've used
procut-sparql
-
Step 6:- Install Heroku Cli in your system from this link
-
Step 7:- Now open terminal / Powershell / command Line in
fuseki-herokufolder and type commandheroku login(make sure to add heroku in your system varaible) & login with your account.
-
Step 8:- Now be in the same folder
fuseki-herokuand typeheroku git:remote -a your-app-namemake sure to change your-app-name to your app's name. Example - Since my app name is product-sparql the required command will be
heroku git:remote -a product-sparql
- Step 9:- Now run these command one by one in your terminal
```
git add .
git commit -am "make it better"
git push heroku master
```
Now, open your app like this https://your-app-name.herokuapp.com/.
In my case it's
https://product-sparql.herokuapp.com/
Now go to control panel and select your rdf name and run sparql query.









