@@ -1336,190 +1336,3 @@ these with the new user. After this just click Done.
13361336
13371337image:user_manual/media/image20.png[image,width=601,height=362]
13381338
1339- == Sample application
1340-
1341- This chapter explains how to use sample applications in Excel, Python, R
1342- and Power BI that shows how TED data can be accessed in Cellar. Sample
1343- applications represent different ways to access TED notices in CELLAR
1344- and how they can be used for simple scenarios. As scenarios, each method
1345- will take over the list of European countries and shows them in one
1346- column.
1347-
1348- *Note:* Jupyter Notebook samples are explained with assumption that a
1349- code editor is already prepared. For example VS Code or Pycharm, or
1350- Jupyter server. Examples are explained using
1351- https://code.visualstudio.com/docs[[.underline]#Visual Studio Code#].
1352-
1353- === Excel
1354-
1355- This chapter shows an example using Excel. Microsoft Excel is a
1356- spreadsheet developed by Microsoft through which we will use the
1357- interface to query CELLAR repository to see an example.
1358-
1359- [arabic]
1360- . Prepare link with necessary query:
1361-
1362- * Access:
1363- https://publications.europa.eu/webapi/rdf/sparql[[.underline]#https://publications.europa.eu/webapi/rdf/sparql#]
1364-
1365- * Insert query
1366-
1367- Example query:
1368- [source, sparql]
1369- prefix cdm: <http://publications.europa.eu/ontology/cdm#>
1370- select distinct ?Countries
1371- where {
1372- ?Countries a cdm:country .
1373- }
1374-
1375- * Push the “Run Query” button
1376-
1377- image:user_manual/media/image6.png[image,width=407,height=466]
1378-
1379- * Copy entire link of the result
1380-
1381- image:user_manual/media/image47.png[image,width=601,height=281]
1382-
1383- [arabic, start=2]
1384- . Access result table via Excel:
1385-
1386- * Click on Data -> From Web button
1387-
1388-
1389- image:user_manual/media/image58.png[image,width=601,height=264]
1390-
1391- * In appeared window insert result link then press OK:
1392-
1393- image:user_manual/media/image88.png[image,width=601,height=320]
1394-
1395- * In result window select necessary table, press load:
1396-
1397- image:user_manual/media/image41.png[image,width=601,height=464]
1398-
1399- === Jupyter Notebook - Python
1400-
1401- This chapter shows an example using the Jupyter Notebook in Python. The
1402- Jupyter Notebook is an application for creating and sharing
1403- computational documents. Python represents a programming language for
1404- writing computational documents. To realize the proposed scenario, it is
1405- necessary to install the special tools and use the Python code that will
1406- perform a query to the cellar and display the results in tabular
1407- form (xref:references[Working with Jupyter Notebook]).
1408-
1409- To run Python sample:
1410-
1411- [arabic]
1412- . Download Jupyter Notebook file:
1413-
1414- https://github.com/OP-TED/ted-rdf-conversion-pipeline/blob/main/notebooks/query_cellar_python.ipynb[[.underline]#https://github.com/OP-TED/ted-rdf-conversion-pipeline/blob/main/notebooks/query_cellar_python.ipynb#]
1415-
1416- [arabic, start=2]
1417- . Download & Install Python 3.8:
1418- [loweralpha]
1419- .. Windows 64bit:
1420- https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe[[.underline]#download#]
1421-
1422- .. Windows 86bit:
1423- https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe[[.underline]#download#]
1424-
1425- . Open Jupyter Notebook file with code editor (VS Code):
1426-
1427- . In code editor, select interpreter for Python that was installed
1428-
1429- Example in VS Code:
1430-
1431- image:user_manual/media/image8.png[image,width=617,height=204]
1432-
1433- [arabic, start=5]
1434- . Install dependencies:
1435-
1436- * Use OS command line and type:
1437- [source,python]
1438- pip install ipykernel sparqlwrapper pandas
1439-
1440- [arabic, start=6]
1441- . Run Cells (example in VS Code):
1442-
1443- image:user_manual/media/image62.png[image,width=601,height=84]
1444-
1445- If all works good, on last output cell we can see results:
1446-
1447- image:user_manual/media/image2.png[image,width=387,height=420]
1448-
1449- === Jupyter Notebook - R
1450-
1451- This chapter shows an example using Jupyter Notebook in R language. R is
1452- software environment for statistical computing and graphic
1453- representation. In this case, R represents the programming language for
1454- writing notebook documents. To realize the proposed scenario, it is
1455- necessary to install the special tools (xref:references[Running R Jupyter Notebooks]) and
1456- use the R code that will perform a query (xref:references[SPARQL with R]) to
1457- the cellar and display the results in tabular form.
1458-
1459- To run R sample:
1460-
1461- [arabic]
1462- . Install & install R language:
1463-
1464- * Windows 64bit:
1465- https://cran.r-project.org/bin/windows/base/R-4.2.2-win.exe[[.underline]#download#]
1466-
1467- [arabic, start=2]
1468- . Download Jupyter Notebook file:
1469- https://github.com/OP-TED/ted-rdf-conversion-pipeline/blob/main/notebooks/query_cellar_R.ipynb[[.underline]#https://github.com/OP-TED/ted-rdf-conversion-pipeline/blob/main/notebooks/query_cellar_R.ipynb#]
1470-
1471- [arabic, start=3]
1472- . Download SPARQL package archive and put in same folder as Notebook file:
1473- https://cran.r-project.org/src/contrib/Archive/SPARQL/SPARQL_1.16.tar.gz[[.underline]#download SPARQL#]
1474-
1475- [arabic, start=4]
1476- . Install IRKernel:
1477-
1478- [loweralpha]
1479- .. Run R in OS command line and type:
1480- [source,bash]
1481- install.packages("IRkernel")
1482- install.packages('RCurl')
1483- install.packages('XML')
1484-
1485- [loweralpha, start=2]
1486- . In appeared window, select first mirror and press OK:
1487- image:user_manual/media/image45.png[image,width=240,height=309]
1488-
1489- [loweralpha, start=3]
1490- . After installation is completed, type:
1491- [source,bash]
1492- IRkernel::installspec()
1493-
1494-
1495- [arabic, start=5]
1496- . Open Jupyter Notebook file in code editor;
1497-
1498- . Select R interpreter;
1499-
1500- image:user_manual/media/image23.png[image,width=601,height=142]
1501-
1502-
1503- [arabic, start=7]
1504- . Run all cells
1505-
1506- image:user_manual/media/image90.png[image,width=502,height=100]
1507-
1508- [arabic, start=8]
1509- . After running, after last cell we can see results:
1510-
1511- image:user_manual/media/image80.png[image,width=487,height=411]
1512-
1513- == References [[references]]
1514-
1515- [arabic]
1516- . “Working with Jupyter Notebooks in Visual Studio Code.” n.d. Visual
1517- Studio Code.
1518- https://code.visualstudio.com/docs/datascience/jupyter-notebooks[[.underline]#https://code.visualstudio.com/docs/datascience/jupyter-notebooks#]
1519-
1520- . “Running R Jupyter Notebooks in VS Code.” n.d. Practical Data Science.
1521- https://www.practicaldatascience.org/html/jupyter_r_notebooks.html[[.underline]#https://www.practicaldatascience.org/html/jupyter_r_notebooks.html#]
1522-
1523- . “SPARQL with R.” 2013. R-bloggers.
1524- https://www.r-bloggers.com/2013/01/sparql-with-r-in-less-than-5-minutes/[[.underline]#https://www.r-bloggers.com/2013/01/sparql-with-r-in-less-than-5-minutes/#]
1525-
0 commit comments