%\subsection{Introduction}

Below is a serialisation format mapping the Provenance data model into
VOTable. This format is useful to provide full serialisation of Provenance
metadata for an archive or data reduction workflow in VOTable. It can also be
used to build the TAP schema of a ProvTAP service.


\subsection{Tables in the VOTable serialisation or in the ProvTAP TAP schema}

The following table gives the full list of tables necessary to map the
IVOA Provenance data model. The contents of the `name' and `utype' columns
of this table are normative. 

\begin{table}[!ht]
\scriptsize
\begin{tabular}{l l p{5cm}l}
\sptablerule
\head{Name}&\head{utype}&\head{Description} \cr
\sptablerule

\hyperref[tab:TAP_entity]{Entity}&voprov:Entity&instances of \class{Entity} class \cr
\hyperref[tab:TAP_entitydesc]{EntityDescription}&voprov:EntityDescription&instances of \class{EntityDescription} class \cr
\hyperref[tab:TAP_activity]{Activity}&voprov:Activity&instances of actvity class \cr
\hyperref[tab:TAP_activitydesc]{ActivityDescription}&voprov:ActivityDescription& instances of \class{ActivityDescriptions}\cr
\hyperref[tab:TAP_agent]{Agent}&voprov:Agent&instances of \class{Agent} class& \cr
\hyperref[tab:TAP_parameter]{Parameter}&voprov:Parameter&instances of \class{Parameter} class& \cr
\hyperref[tab:TAP_parameterdesc]{ParameterDescription}&voprov:ParameterDescription&instances of \class{ParameterDescription}& \cr
\hyperref[tab:TAP_used]{Used}&voprov:Used&instances of \class{Used} relationships& \cr
\hyperref[tab:TAP_useddesc]{UsedDescription}&voprov:UsedDescription&instances of \class{UsedDescription} relationships& \cr
\hyperref[tab:TAP_wasgeneratedby]{WasGeneratedBy}&voprov:WasGeneratedBy&instances of \class{WasGeneratedBy relationships}& \cr
\hyperref[tab:TAP_wasgeneratedbydesc]{WasGeneratedByDescription}&voprov:WasGeneratedByDescription&instances of \class{WasGeneratedByDescription} relationships& \cr
\hyperref[tab:TAP_wasassociatedwith]{WasAssociatedWith}&voprov:WasAssociatedWith&instances of \class{WasAssociatedWith} relationships& \cr
\hyperref[tab:TAP_wasattributedto]{WasAttributedTo}&voprov:WasAttributedTo&instances of \class{WasAttributedTo} relationships & \cr

\sptablerule
\end{tabular}
\caption{List of tables in the TAP schema}
\label{tab:standardpars}
\end{table}

\subsection{Detailed table description}

Tables~\ref{tab:TAP_entity} to \ref{tab:TAP_wasattributedto} provide
full descriptions of the FIELDS of each of the mapping tables.
The contents of all these tables' columns are normative.
For convenience, in all these tables an arrow ($\rightarrow$) indicates columns that contain references (foreign keys) to other tables.
The column names are prefixed by a short-cut for the table name in order to 
ensure unique column names in queries with table joins for ProvTAP.

\begin{table}[!ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule

\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
e\_id&meta.id& voprov:Entity.id&char \cr
e\_name&meta.title& voprov:Entity.name&char \cr
e\_type&meta.code.class&voprov:Entity.type&char \cr
e\_rights&meta.code.class&voprov:Entity.rights&char \cr
e\_annotation&meta.description&voprov:Entity.annotation& char \cr
%\sptablerule
%references&& \cr
%\sptablerule
$\rightarrow$ e\_hadMember&meta.code.member&voprov:Entity.hadMember&char \cr
$\rightarrow$ e\_description&meta.id& voprov:Entity.description & char\cr
%$\rightarrow$ e\_generatedEntity&meta.id& voprov:Entity.wasDerivedFrom.generatedEntity & char\cr
$\rightarrow$ e\_usedEntity&meta.id& voprov:Entity.wasDerivedFrom.usedEntity & char\cr
\sptablerule
\end{tabular}
\caption{Column description for Entity table }
\label{tab:TAP_entity}
\end{table}

\begin{table}[!ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule

\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
ed\_id&meta.id& voprov:EntityDescription.id&char \cr
ed\_name&meta.title& voprov:EntityDescription.name&char \cr
ed\_annotation&meta.description&voprov:EntityDescription.annotation& char \cr
ed\_category&meta.code.class&voprov:EntityDescription.category& char \cr
ed\_doculink&meta.ref.url& voprov:EntityDescription.doculink & char\cr
\sptablerule
\end{tabular}
\caption{Column description for EntityDescription table }
\label{tab:TAP_entitydesc}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
a\_id&meta.id& voprov:Activity.id&char \cr
a\_name&meta.title& voprov:Activity.name&char \cr
a\_startTime&time.start&voprov:Activity.startTime& char\cr
a\_endTime&time.stop&voprov:Activity.endTime& char\cr
a\_annotation&meta.description&voprov:Activity.annotation& char \cr
a\_votype&meta.code.class&voprov:Activity.votype& char\cr
%\sptablerule
%references& \cr
%\sptablerule
$\rightarrow$ a\_hadStep&meta.code.member&voprov:Activity.hadStep&char \cr
$\rightarrow$ a\_description&meta.id& voprov:Activity.description & char\cr
$\rightarrow$ a\_informant&meta.id& voprov:Activity.wasInformedBy.informant & char\cr
\sptablerule
\end{tabular}
\caption{Column description for Activity table }
\label{tab:TAP_activity}
\end{table}



\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
ad\_id&meta.id& voprov:ActivityDescription.id&char \cr
ad\_name&meta.title& voprov:ActivityDescription.name&char \cr
ad\_type&meta.code.class&voprov:ActivityDescription.type&char \cr
ad\_subtype&meta.code.class&voprov:ActivityDescription.subtype&char \cr
ad\_annotation&meta.description&voprov:ActivityDescription.annotation& char \cr
ad\_doculink&meta.ref.url&voprov:ActivityDescription.doculink& char\cr
%\sptablerule
%references& \cr
%\sptablerule

\sptablerule
\end{tabular}
\caption{Column description for ActivityDescription table }
\label{tab:TAP_activitydesc}
\end{table}


\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
ag\_id&meta.id& voprov:Agent.id&char \cr
ag\_name&meta.title& voprov:Agent.name&char \cr
ag\_type&meta.code.class&voprov:Agent.type&char OPTIONS \cr
%\sptablerule
ag\_address&meta.address&voprov:Agent.address&char \cr
ag\_email&meta.email&voprov:Agent.email&char \cr

\sptablerule
\end{tabular}
\caption{Column description for agent table }
\label{tab:TAP_agent}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
p\_isaParamOf&meta.id&voprov:Parameter.Activity&char \cr
p\_id&meta.id& voprov:Parameter.id&char \cr
p\_value&stat.value& voprov:Parameter.value& param dependent \cr
$\rightarrow$ p\_description&meta.id&voprov:Parameter.description& reference to parameter description \cr

\sptablerule
\end{tabular}
\caption{Column description for Parameter table }
\label{tab:TAP_parameter}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l p{6cm} p{4cm}}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
pd\_isaParamOf&meta.id&voprov:ParameterDescription.ActivityDescription&char \cr
pd\_id&meta.id& voprov:ParameterDescription.id&char \cr
pd\_name&meta.title& voprov:ParameterDescription.name& param dependent \cr
pd\_annotation&meta.description&voprov:ParameterDescription.annotation& char \cr
pd\_datatype&meta&voprov:ParameterDescription.datatype& char \cr
pd\_unit&meta.unit&voprov:ParameterDescription.unit& char \cr
pd\_ucd&meta.ucd&voprov:ParameterDescription.ucd& char \cr
pd\_utype&meta&voprov:ParameterDescription.utype& char \cr
pd\_min&stat.min&voprov:ParameterDescription.min& param dependent \cr
pd\_max&stat.max&voprov:ParameterDescription.max& param dependent \cr
pd\_options&meta&voprov:ParameterDescription.options& param dependent \cr
\sptablerule
\end{tabular}
\caption{Column description for ParameterDescription table }
\label{tab:TAP_parameterdesc}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ u\_entity\_id&meta.id&voprov:Used.entity&char \cr
$\rightarrow$ u\_activity\_id&meta.id&voprov:Used.activity& char \cr
$\rightarrow$ u\_usedDescription\_id&meta.id&voprov:Used.usedDescription& char \cr
u\_time&time.start&voprov:Used.time& char\cr
\sptablerule
\end{tabular}
\caption{Column description for Used relationship table}
\label{tab:TAP_used}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l p{5cm} p{3cm}}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ ud\_id&meta.id&voprov:UsedDescription.\newline id&char \cr
$\rightarrow$ ud\_entityDescription\_id&meta.id&voprov:UsedDescription.\newline entityDescription&char \cr
$\rightarrow$ ud\_activityDescription\_id&meta.id&voprov:UsedDescription.\newline activityDescription& char \cr
ud\_role&meta.code.class&voprov:UsedDescription.role& char OPTION \cr
\sptablerule
\end{tabular}
\caption[Column description for UsedDescription relationship table]{Column description for UsedDescription relationship table. The value of a role string belongs to a set of possible literal values given for instance using the VOTable OPTION element. }
\label{tab:TAP_useddesc}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ wgb\_entity\_id&meta.id&voprov:WasGeneratedBy.entity&char \cr
$\rightarrow$ wgb\_activity\_id&meta.id&voprov:WasGeneratedBy.activity& char \cr
$\rightarrow$ wgb\_wasGeneratedByDescription\_id&meta.id&voprov:WasGeneratedBy.wasGeneratedByDescription& char \cr
wgb\_role&meta.code.class&voprov:WasGeneratedBy.role& char OPTION \cr
wgb\_time&time.stop&voprov:WasGeneratedBy.time& char\cr
\sptablerule
\end{tabular}
\caption{Column description for WasGeneratedBy relationship table }
\label{tab:TAP_wasgeneratedby}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l p{5cm} p{3cm}}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ wgbd\_id&meta.id&voprov:WasGeneratedByDescription.\newline id&char \cr
$\rightarrow$ wgbd\_entityDescription\_id&meta.id&voprov:WasGeneratedByDescription.\newline entityDescription&char \cr
$\rightarrow$ wgbd\_activityDescription\_id&meta.id&voprov:WasGeneratedByDescription.\newline activityDescription& char \cr
wgbd\_role&meta.code.class&voprov:WasGeneratedByDescription.role& char OPTION \cr
\sptablerule
\end{tabular}
\caption{Column description for WasGeneratedByDescription relationship table }
\label{tab:TAP_wasgeneratedbydesc}
\end{table}


\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ waw\_agent\_id&meta.id&voprov:WasAssociatedWith.agent&char \cr
$\rightarrow$ waw\_activity\_id&meta.id&voprov:WasAssoatciatedWith.activity& char \cr
waw\_role&meta.code.class&voprov:WasAssociatedWith.agentRole& char OPTION \cr
\sptablerule
\end{tabular}
\caption{Column description for WasAssociatedWith relationship table }
\label{tab:TAP_wasassociatedwith}
\end{table}

\begin{table}[ht]
\scriptsize
\begin{tabular}{l l l l}
\sptablerule
\textbf{Name  }&\textbf{ucd }&\textbf{utype  }&\textbf{datatype } \cr
\sptablerule
$\rightarrow$ wat\_entity\_id&meta.id&voprov:WasAttributedTo.entity&char \cr
$\rightarrow$ wat\_agent\_id&meta.id&voprov:WasAttributedTo.agent& char \cr
wat\_role&meta.code.class&voprov:WasAttributedTo.agentRole& char OPTION \cr
\sptablerule
\end{tabular}
\caption{Column description for WasAttributedTo relationship table }
\label{tab:TAP_wasattributedto}
\end{table}
\clearpage
