Skip to content

Commit a70d7c4

Browse files
committed
new manual
1 parent c3d0a17 commit a70d7c4

2 files changed

Lines changed: 190 additions & 187 deletions

File tree

docs/antora/modules/ROOT/pages/user_manual.adoc

Lines changed: 0 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,190 +1336,3 @@ these with the new user. After this just click Done.
13361336

13371337
image: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-
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
= Using procurement data
2+
3+
4+
5+
6+
This page explains how to use procurement data accessed from Cellar with Excel, Python, R
7+
and Power BI.
8+
There are different ways to access TED notices in CELLAR
9+
and use the data. As scenarios, each method presented in this page
10+
will take over the list of European countries and shows them in one
11+
column.
12+
13+
*Note:* Jupyter Notebook samples are explained with assumption that a
14+
code editor is already prepared. For example VS Code or Pycharm, or
15+
Jupyter server. Examples are explained using
16+
https://code.visualstudio.com/docs[[.underline]#Visual Studio Code#].
17+
18+
=== Excel
19+
20+
This chapter shows an example using Excel. Microsoft Excel is a
21+
spreadsheet developed by Microsoft through which we will use the
22+
interface to query CELLAR repository to see an example.
23+
24+
[arabic]
25+
. Prepare link with necessary query:
26+
27+
* Access:
28+
https://publications.europa.eu/webapi/rdf/sparql[[.underline]#https://publications.europa.eu/webapi/rdf/sparql#]
29+
30+
* Insert query
31+
32+
Example query:
33+
[source, sparql]
34+
prefix cdm: <http://publications.europa.eu/ontology/cdm#>
35+
select distinct ?Countries
36+
where {
37+
?Countries a cdm:country .
38+
}
39+
40+
* Push the “Run Query” button
41+
42+
image:user_manual/media/image6.png[image,width=407,height=466]
43+
44+
* Copy entire link of the result
45+
46+
image:user_manual/media/image47.png[image,width=601,height=281]
47+
48+
[arabic, start=2]
49+
. Access result table via Excel:
50+
51+
* Click on Data -> From Web button
52+
53+
54+
image:user_manual/media/image58.png[image,width=601,height=264]
55+
56+
* In appeared window insert result link then press OK:
57+
58+
image:user_manual/media/image88.png[image,width=601,height=320]
59+
60+
* In result window select necessary table, press load:
61+
62+
image:user_manual/media/image41.png[image,width=601,height=464]
63+
64+
=== Jupyter Notebook - Python
65+
66+
This chapter shows an example using the Jupyter Notebook in Python. The
67+
Jupyter Notebook is an application for creating and sharing
68+
computational documents. Python represents a programming language for
69+
writing computational documents. To realize the proposed scenario, it is
70+
necessary to install the special tools and use the Python code that will
71+
perform a query to the cellar and display the results in tabular
72+
form (xref:references[Working with Jupyter Notebook]).
73+
74+
To run Python sample:
75+
76+
[arabic]
77+
. Download Jupyter Notebook file:
78+
79+
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#]
80+
81+
[arabic, start=2]
82+
. Download & Install Python 3.8:
83+
[loweralpha]
84+
.. Windows 64bit:
85+
https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe[[.underline]#download#]
86+
87+
.. Windows 86bit:
88+
https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe[[.underline]#download#]
89+
90+
. Open Jupyter Notebook file with code editor (VS Code):
91+
92+
. In code editor, select interpreter for Python that was installed
93+
94+
Example in VS Code:
95+
96+
image:user_manual/media/image8.png[image,width=617,height=204]
97+
98+
[arabic, start=5]
99+
. Install dependencies:
100+
101+
* Use OS command line and type:
102+
[source,python]
103+
pip install ipykernel sparqlwrapper pandas
104+
105+
[arabic, start=6]
106+
. Run Cells (example in VS Code):
107+
108+
image:user_manual/media/image62.png[image,width=601,height=84]
109+
110+
If all works good, on last output cell we can see results:
111+
112+
image:user_manual/media/image2.png[image,width=387,height=420]
113+
114+
=== Jupyter Notebook - R
115+
116+
This chapter shows an example using Jupyter Notebook in R language. R is
117+
software environment for statistical computing and graphic
118+
representation. In this case, R represents the programming language for
119+
writing notebook documents. To realize the proposed scenario, it is
120+
necessary to install the special tools (xref:references[Running R Jupyter Notebooks]) and
121+
use the R code that will perform a query (xref:references[SPARQL with R]) to
122+
the cellar and display the results in tabular form.
123+
124+
To run R sample:
125+
126+
[arabic]
127+
. Install & install R language:
128+
129+
* Windows 64bit:
130+
https://cran.r-project.org/bin/windows/base/R-4.2.2-win.exe[[.underline]#download#]
131+
132+
[arabic, start=2]
133+
. Download Jupyter Notebook file:
134+
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#]
135+
136+
[arabic, start=3]
137+
. Download SPARQL package archive and put in same folder as Notebook file:
138+
https://cran.r-project.org/src/contrib/Archive/SPARQL/SPARQL_1.16.tar.gz[[.underline]#download SPARQL#]
139+
140+
[arabic, start=4]
141+
. Install IRKernel:
142+
143+
[loweralpha]
144+
.. Run R in OS command line and type:
145+
[source,bash]
146+
install.packages("IRkernel")
147+
install.packages('RCurl')
148+
install.packages('XML')
149+
150+
[loweralpha, start=2]
151+
. In appeared window, select first mirror and press OK:
152+
image:user_manual/media/image45.png[image,width=240,height=309]
153+
154+
[loweralpha, start=3]
155+
. After installation is completed, type:
156+
[source,bash]
157+
IRkernel::installspec()
158+
159+
160+
[arabic, start=5]
161+
. Open Jupyter Notebook file in code editor;
162+
163+
. Select R interpreter;
164+
165+
image:user_manual/media/image23.png[image,width=601,height=142]
166+
167+
168+
[arabic, start=7]
169+
. Run all cells
170+
171+
image:user_manual/media/image90.png[image,width=502,height=100]
172+
173+
[arabic, start=8]
174+
. After running, after last cell we can see results:
175+
176+
image:user_manual/media/image80.png[image,width=487,height=411]
177+
178+
== References [[references]]
179+
180+
[arabic]
181+
. “Working with Jupyter Notebooks in Visual Studio Code.” n.d. Visual
182+
Studio Code.
183+
https://code.visualstudio.com/docs/datascience/jupyter-notebooks[[.underline]#https://code.visualstudio.com/docs/datascience/jupyter-notebooks#]
184+
185+
. “Running R Jupyter Notebooks in VS Code.” n.d. Practical Data Science.
186+
https://www.practicaldatascience.org/html/jupyter_r_notebooks.html[[.underline]#https://www.practicaldatascience.org/html/jupyter_r_notebooks.html#]
187+
188+
. “SPARQL with R.” 2013. R-bloggers.
189+
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/#]
190+

0 commit comments

Comments
 (0)