%ex3.3

\begin{enumerate}[label=(\alph*)]
	\item\textbf{Two basic queries to start with:}
	\begin{itemize}
		\item\textbf{List all the distinct countries for which addresses are
			registered in the database.}
			\begin{lstlisting}[style=command]
MATCH (n:Address) RETURN DISTINCT n.countries AS countries
			\end{lstlisting}
			This returns 222 different countries. We chose ''Austria''.
		\item\textbf{Choose one of these countries and list 5 entities which
			are based in that country.}
			\begin{lstlisting}[style=command]
MATCH (n:Address {countries: 'Austria'})<-[r:REGISTERED_ADDRESS]-(e:Entity)
	RETURN DISTINCT e AS entity LIMIT 5
			\end{lstlisting}
			\input{results/result_3a.tex}
	\end{itemize}
	\item
		\begin{enumerate}[label=\theenumiii]
			\item\textbf{First, find the 10 \texttt{top intermediaries} , i.e.
				those 10 intermediaries that have the most outgoing
				\texttt{INTERMEDIARY\_OF} edges. Output the name of the
				intermediary as well as the number of relevant edges.}
				\begin{lstlisting}[style=command]
MATCH (n:Intermediary)-[r:INTERMEDIARY_OF]->()
	RETURN n.name AS name, COUNT(r) AS count ORDER BY count DESC LIMIT 10
				\end{lstlisting}
				\input{results/result_3b1.tex}
			\item\textbf{Extend the query of \texttt{i} to also count outgoing
				\texttt{OFFICER\_OF} edges to determine the top intermediaries.
				Output the name of the intermediary as well as the number of
				relevant edges.}
				\begin{lstlisting}[style=command]
MATCH (n:Intermediary)-[r:INTERMEDIARY_OF|OFFICER_OF]->()
	RETURN n.name AS name, COUNT(r) AS count ORDER BY count DESC LIMIT 10
				\end{lstlisting}
				\input{results/result_3b2.tex}
			\item\textbf{For the top intermediary from query \texttt{ii},
				output all the outgoing edges, except for those that have type
				either \texttt{OFFICER\_OF} or \texttt{INTERMEDIARY\_OF}. Also
				output the respective nodes at the other side of the edges.}
				\begin{lstlisting}[style=command]
MATCH (n:Intermediary {node_id: "54662"})-[r]->(t)
	WHERE NOT (n)-[r:INTERMEDIARY_OF|OFFICER_OF]->(t)
	RETURN type(r) AS relation, t.node_id AS node
				\end{lstlisting}
				\input{results/result_3b3.tex}
		\end{enumerate}
\end{enumerate}
