\chapter{Supporting Code}
\begin{singlespace}

\section{MIT Prox Card Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=mit-pcp,}
\lstinputlisting{mit-pcp.n3}

\section{SSN Policy - Original Ontology}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=ssn-old,}
\lstinputlisting{ssn-policy.n3}

\section{SSN Policy - Current Ontology}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=ssn-new,}
\lstinputlisting{ssn-policy-new.n3}

% Don't include code examples - just link to SVN!!
%%upquote=true doesn't work.
%%basicstyle=\ttfamily\footnotesize does but I'm not sure I like it.
%\section{sparql2n3.cpp}
%\lstset{language=C++,numbers=left, stepnumber=1,breaklines=true,basicstyle=\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sparql2n3.cpp,}
%\lstinputlisting{sparql2n3.cpp}
%
%\section{sparql2n3.py}
%\lstset{language=Python,numbers=left, stepnumber=1,breaklines=true,basicstyle=\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sparql2n3.py,}
%\lstinputlisting{sparql2n3.py}
%
%\section{check-compliance.py}
%\lstset{language=Python,numbers=left, stepnumber=1,breaklines=true,basicstyle=\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=check-compliance.py,}
%\lstinputlisting{check-compliance.py}

\section{A sample SPARQL Query}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=a-sample-query,}
\begin{lstlisting}
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?s ?id ?n WHERE {
  ?s foaf:ssn ?n.
  ?s foaf:age ?a.
  ?s foaf:openid ?id.
  FILTER (?a > 18)
}
\end{lstlisting}

\section{Abstract SPARQL to N3 Ontology}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=abstract-sparql,}
\lstinputlisting{abstract-sparql.n3}

% Some automation is helpful in case these need regeneration.
% python template-restriction.py >> ../jsoltren-thesis/sample-restriction.n3
% python template-inclusion.py >> ../jsoltren-thesis/sample-inclusion.n3
% python template-exclusion.py >> ../jsoltren-thesis/sample-exclusion.n3
% python template-chaining.py >> ../jsoltren-thesis/sample-chaining.n3
% python template-exclusion+history.py >> ../jsoltren-thesis/sample-exclusion-history.n3
% python template-defaultdeny.py >> ../jsoltren-thesis/sample-defaultdeny.n3

\section{Sample Restriction Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-restriction,}
\lstinputlisting{sample-restriction.n3}

\section{Sample Inclusion Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-inclusion,}
\lstinputlisting{sample-inclusion.n3}

\section{Sample Exclusion Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-exclusion,}
\lstinputlisting{sample-exclusion.n3}

\section{Sample History-Aware Exclusion Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-exclusion-history,}
\lstinputlisting{sample-exclusion-history.n3}

\section{Sample Chaining Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-chaining,}
\lstinputlisting{sample-chaining.n3}

\section{Sample Default Deny Policy}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=sample-defaultdeny,}
\lstinputlisting{sample-defaultdeny.n3}

\section{No-Address Restriction Policy for Sample Scenario}
\lstset{language=,numbers=left, stepnumber=1,breaklines=true,basicstyle=\ttfamily\footnotesize,showspaces=false,showstringspaces=false,showtabs=false,tabsize=4,label=no-address,}
\lstinputlisting{no-address.n3}

% The end of the chapter.
\end{singlespace}