1
0
mirror of https://github.com/gsi-upm/sitc synced 2026-02-19 12:48:16 +00:00
Files
sitc/lod/01_1_SPARQL_Server.ipynb
2026-02-18 17:20:14 +01:00

158 lines
4.9 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<header style=\"width:100%;position:relative\">\n",
" <div style=\"width:80%;float:right;\">\n",
" <h1>Course Notes for Learning Intelligent Systems</h1>\n",
" <h2>Department of Telematic Engineering Systems</h2>\n",
" <h3>Universidad Politécnica de Madrid. © Carlos A. Iglesias </h3>\n",
" </div>\n",
" <img style=\"width:15%;\" src=\"https://github.com/gsi-upm/sitc/blob/9844820e6653b0e169113a06538f8e54554c4fbc/images/EscUpmPolit_p.gif?raw=true\" alt=\"UPM\" />\n",
"</header>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introduction\n",
"\n",
"This lecture explains how to run the SPARQL Server Fuseki using Docker."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Installing Fuseki with Docker\n",
"This section is taken from [[1](#1), [2](#2)].\n",
"\n",
"## Install Docker if not installed\n",
"You should have installed **Docker**. If not, refer to the [docker install guide](https://docs.docker.com/engine/install/).\n",
"\n",
"## Install fuseki image\n",
"In a terminal, run\n",
"```\n",
"docker run -p 3030:3030 --name fuseki -e ADMIN_PASSWORD=fuseki -it stain/jena-fuseki\n",
"```\n",
"You can change the admin password to anyone that you want, or the ports.\n",
"\n",
"You should see the logs in the terminal.\n",
"\n",
"![alt text](docker-run-jena-fuseki.jpg \"Fuseki running in Docker\")\n",
"\n",
"## Access admin UI\n",
"Now open a browser to [http://localhost:3030](http://localhost:3030) and log in as user *admin* with password *fuseki* (or the password you set earlier).\n",
"\n",
"![alt text](fuseki-running.jpg \"UI Admin Fuseki\")\n",
"\n",
"## Load data\n",
"Download this dataset to your computer.\n",
"\n",
"[Beatles dataset](https://github.com/gsi-upm/sitc/blob/master/lod/BeatlesMusicians.ttl).\n",
"\n",
"At the bottom of the UI, you can see 'No datasets created - add one'. Click on *add one*. Set *beatles* as the dataset name and in-memory as the dataset type.\n",
"\n",
"![alt text](new-dataset.jpg \"create dataset\")\n",
"\n",
"\n",
"Click the *create dataset* button.\n",
"\n",
"![alt text](created-dataset.jpg \"created dataset\")\n",
"\n",
"Click the *add data* button. In the new screen, select the button *select files* and click on the file you have previously downloaded, and click on the *upload now* button.\n",
"\n",
"![alt text](upload-data.jpg \"upload data\")\n",
"\n",
"Now the *query* tab.\n",
"\n",
"![alt text](query-ui.jpg \"query ui\")\n",
"\n",
"You see a generic query to list triples, click on the *Play* button (a triangle on the SPARQL query's right).\n",
"\n",
"Scroll down to see the query results.\n",
"\n",
"![alt text](query-results.jpg \"query results\")\n",
"\n",
"\n",
"Congratulations! You have a SPARQL server running, serving a dataset!!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## References"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* <a id=\"1\">[1]</a> [SPARQL by Example. A Tutorial. Lee Feigenbaum. W3C, 2009](https://hub.docker.com/r/stain/jena-fuseki)\n",
"* <a id=\"2\">[2]</a> [SPARQL queries of Beatles recording sessions](http://www.snee.com/bobdc.blog/2017/11/sparql-queries-of-beatles-reco.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Licence\n",
"The notebook is freely licensed under the [Creative Commons Attribution Share-Alike license](https://creativecommons.org/licenses/by/2.0/). \n",
"\n",
"© Carlos A. Iglesias, Universidad Politécnica de Madrid."
]
}
],
"metadata": {
"datacleaner": {
"position": {
"top": "50px"
},
"python": {
"varRefreshCmd": "try:\n print(_datacleaner.dataframe_metadata())\nexcept:\n print([])"
},
"window_display": false
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}