\chapter{Model Using the AIR Policy Language}
\label{appa}

%\begin{table}
%\caption{Armadillos}
%\label{arm:table}
%\begin{center}
%\begin{tabular}{||l|l||}\hline
%Armadillos & are \\\hline
%our	   & friends \\\hline
%\end{tabular}
%\end{center}
%\end{table}

%\clearpage
%\newpage

\section{Introduction}

This appendix describes expression of the CC-BY policy using the Accountability In RDF (AIR) policy language \cite{air}, and demonstrates a scenario in which this policy is used to generate a proof which indicates a person has violated somebody else's CC-BY policy.

The CC license violations validator service mentioned in Chapter \ref{validator} will help an honest user to remain honest by validating the user's work. But imagine a situation in which the content transfers from one individual to another individual, and then on to another individual. During the whole transfer process, the content may be altered in some way, and a new set of policies could be added. In such a scenario, the original content creator may be interested in following the trail of transactions involving the work that she created, and figure out if her work is used in any way that she did not intended it to be used. Also, it would be useful for her to see if any policy violations have taken place to take any corrective action, if necessary. To realize such a system, we need to use more expressive policy languages. The new CC recommendation, ccREL, has an expanded set of license options. AIR policy language supports explanations for policy decisions and provides efficient and expressive reasoning. By combining ccREL and AIR, we are able to express the policies that represent rules stating how content should be reused. Given that we have a transaction log indicating how the content was used, we can reason over it using the AIR policy which describes the associated CC license.

\section{Scenario}

\begin{figure}[!h]
  \centerline{\epsfig{file=images/scenario.jpg, width=1\linewidth}}
  \caption{Illustration of Inappropriate Usage of CC Licensed Content}
  \label{fig-cc-scenario}
\end{figure}

As an example, consider the scenario given in Figure \ref{fig-cc-scenario}, where Alice, a content creator, takes a photograph and uploads it to Flickr under the CC-BY license. Then Bob comes along and uses that photo in a derivative work without attributing Alice. This is clearly a violation of Alice's original CC-BY attribution license. Assuming that all the transactions composing this event get logged, we can use the AIR policy given in Figure \ref{fig-air-policy} against the transaction log to derive a conclusion and a set of justifications for that conclusion. 

The AIR policy for CC-BY given in Figure \ref{fig-air-policy} first defines several prefixes such as `cc', `xhtml', `dc' and `air'. These prefixes are merely notational conveniences to refer to concepts defined in other documents. Several variables such as `:EVENT', `:P1' are introduced using the @forAll directive. Then the policy description specifies a rule which indicates that upon matching a pattern where the `cc:attributionName' is not present in the log of an instance of content reuse, then there is a CC-BY license violation.

\begin{figure}[!h]
  \centerline{\epsfig{file=images/non_compliant.jpg, width=1\linewidth}}
  \caption{Creative Commons Attribution License Violations Scenario Output from the AIR Reasoner using the Justification UI in the Tabulator}
  \label{fig-cc-tab}
\end{figure}

\subsection{CC-BY Policy Expressed in AIR}

\begin{figure}[!h]
\begin{alltt}
\singlespace{
@prefix cc: <http://creativecommons.org/licenses/by/3.0>. 
@prefix xhtml: <http://www.w3.org/1999/xhtml/vocab#>. 
@prefix dc: <http://purl.org/dc/elements/1.1>. 
@prefix air: <http://dig.csail.mit.edu/TAMI/2007/amord/air#>. 

@forAll :EVENT, :P1, :P2, :WORK, :LICENSE, :DERIVATIVE. 
 
:CC_BY_Policy a air:Policy; 
   air:rule [ 
      air:pattern { 
         :EVENT a air:UseEvent; 
             cc:work :WORK. 
         :P1 a foaf:Person. 
         :WORK dc:creator :P1; 
             xhtml:license :LICENSE. 
         :LICENSE cc:requires cc:AttributionName. }; 
    air:rule [ 
      air:pattern { 
	        :DERIVATIVE cc:derivativework 
	        :WORK; 
	        dc:creator :P2 . }; 
          air:rule [ 
              air:pattern { 
                :DERIVATIVE cc:attributionName :P1 . }; 
             air:assert { 
                :EVENT air:compliant-with 
                :CC_BY_Policy. }; 
             air:alt [ 
                air:assert { 
                :EVENT air:non-compliant-with 
                :CC_BY_Policy. }; 
            ]; 
         ]; 
      ]; 
  ]. 
}
\end{alltt}
  \caption{Sample AIR Policy}
  \label{fig-air-policy}
\end{figure}

\subsection{Results}

When this policy is run against the log of events collected from Alice's and Bob's transactions using the AIR reasoner, it would indicate if there were any policy violations and provide the justifications behind them. When viewed in the Tabulator's `Justifications' pane, the final conclusion of the outcome will be given first, followed by the reasons behind the conclusion which ensures that the user can view the annotated transaction log in a meaningful manner. This is shown in Figure \ref{fig-cc-tab}.


