]> git.somenet.org - pub/jan/adbs.git/blob - ex3/main_3.tex
update main_3.tex
[pub/jan/adbs.git] / ex3 / main_3.tex
1 %ex3.3
2
3 \begin{enumerate}[label=(\alph*)]
4         \item\textbf{Two basic queries to start with:}
5         \begin{itemize}
6                 \item\textbf{List all the distinct countries for which addresses are
7                         registered in the database.}
8                         \begin{verbatim}
9                                 MATCH (n:Address) RETURN DISTINCT n.countries
10                         \end{verbatim}
11                         This returns 222 different countries. We chose ''Austria''.
12                 \item\textbf{Choose one of these countries and list 5 entities which
13                         are based in that country.}
14                         \begin{verbatim}
15                                 MATCH (n:Address {countries: 'Austria'})<-[r:REGISTERED_ADDRESS]-(e:Entity)
16                                         RETURN DISTINCT e LIMIT 5
17                         \end{verbatim}
18         \end{itemize}
19         \item
20                 \begin{enumerate}[label=\theenumiii]
21                         \item\textbf{First, find the 10 \texttt{top intermediaries} , i.e.
22                                 those 10 intermediaries that have the most outgoing
23                                 \texttt{INTERMEDIARY\_OF} edges. Output the name of the
24                                 intermediary as well as the number of relevant edges.}
25                         \item\textbf{Extend the query of i to also count outgoing
26                                 \texttt{OFFICER\_OF} edges to determine the top intermediaries.
27                                 Output the name of the intermediary as well as the number of
28                                 relevant edges.}
29                         \item\textbf{For the top intermediary from query ii, output all the
30                                 outgoing edges, except for those that have type either
31                                 \texttt{OFFICER\_OF} or \texttt{INTERMEDIARY\_OF}. Also output
32                                 the respective nodes at the other side of the edges.}
33                 \end{enumerate}
34 \end{enumerate}