     @prefix : <http://dig.csail.mit.edu/2009/IARPA-PIR/query1#> .
    @prefix air: <http://dig.csail.mit.edu/TAMI/2007/amord/air#> .
    @prefix log: <http://www.w3.org/2000/10/swap/log#> .
    @prefix s: <http://dig.csail.mit.edu/2009/IARPA-PIR/sparql#> .
    @prefix ssn: <http://dig.csail.mit.edu/2009/IARPA-PIR/ssn-policy#> .
    @prefix tms: <http://dig.csail.mit.edu/TAMI/2007/amord/tms#> .
    
    :Query-3     air:non-compliant-with ssn:SSNPolicy,
                ssn:SSNPolicy_FilterRule,
                ssn:SSNPolicy_OutputRule,
                ssn:SSNPolicy_WhereClause .
    
    ssn:SSN_FR01     tms:justification tms:premise .
    
    ssn:SSN_OR01     tms:justification tms:premise .
    
    ssn:SSN_RULE1     tms:justification tms:premise .
    
    ssn:SSN_WC01     tms:justification tms:premise .
    {
        :Query-3     air:non-compliant-with ssn:SSNPolicy .
        
        }     tms:description  (
        "The query, "
        :Query-3
        ", uses SSN values in the where clause, as a filter and retrieves SSN values as well" );
         tms:justification  [
             tms:antecedent-expr  [
                 a tms:And-justification;
                 tms:sub-expr  [
                     air:instanceOf ssn:SSN_RULE2;
                     tms:description  (
                    :Query-3
                    " is a SPARQL query" );
                     tms:justification  [
                         tms:antecedent-expr  [
                             a tms:And-justification;
                             tms:sub-expr ssn:SSN_RULE1,
                                    {:Query-3     a s:Select;
                                 s:POSList <#_g0>;
                                 s:WhereClause :WHERE .
                            } ];
                         tms:rule-name ssn:SSN_RULE1 ] ],
                        {:WHERE     s:Filter <#_g1>;
                     s:TriplePattern {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                ssn:S     log:includes { @forSome s:AgeOfConsent,
                                s:BooleanGT .
                    :N     s:BooleanGT s:AgeOfConsent .
                    } .
                ssn:T     log:includes {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                <#_g0>     s:variable :N .
                <#_g1>     s:TriplePattern {:N     s:BooleanGT s:AgeOfConsent .
                    } .
                } ];
             tms:rule-name ssn:SSN_RULE2 ] .
    {
        :Query-3     air:non-compliant-with ssn:SSNPolicy_FilterRule .
        
        }     tms:description  (
        "The query, "
        :Query-3
        ", filters on SSN variables" );
         tms:justification  [
             tms:antecedent-expr  [
                 a tms:And-justification;
                 tms:sub-expr  [
                     air:instanceOf ssn:SSN_FR02;
                     tms:description  (
                    :Query-3
                    " is a SPARQL query" );
                     tms:justification  [
                         tms:antecedent-expr  [
                             a tms:And-justification;
                             tms:sub-expr ssn:SSN_FR01,
                                    {:Query-3     a s:Select;
                                 s:POSList <#_g0>;
                                 s:WhereClause :WHERE .
                            } ];
                         tms:rule-name ssn:SSN_FR01 ] ],
                        {:WHERE     s:Filter <#_g1>;
                     s:TriplePattern {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                ssn:S     log:includes { @forSome s:AgeOfConsent,
                                s:BooleanGT .
                    :N     s:BooleanGT s:AgeOfConsent .
                    } .
                ssn:T     log:includes {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                <#_g0>     s:variable :N .
                <#_g1>     s:TriplePattern {:N     s:BooleanGT s:AgeOfConsent .
                    } .
                } ];
             tms:rule-name ssn:SSN_FR02 ] .
    {
        :Query-3     air:non-compliant-with ssn:SSNPolicy_OutputRule .
        
        }     tms:description  (
        "The query, "
        :Query-3
        ", tries to output a variable "
        <#_g0>
        " that is an SSN" );
         tms:justification  [
             tms:antecedent-expr  [
                 a tms:And-justification;
                 tms:sub-expr  [
                     air:instanceOf ssn:SSN_OR02;
                     tms:description  (
                    :Query-3
                    " is a SPARQL query" );
                     tms:justification  [
                         tms:antecedent-expr  [
                             a tms:And-justification;
                             tms:sub-expr ssn:SSN_OR01,
                                    {:Query-3     a s:Select;
                                 s:POSList <#_g0>;
                                 s:WhereClause :WHERE .
                            } ];
                         tms:rule-name ssn:SSN_OR01 ] ],
                        {:WHERE     s:TriplePattern {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                ssn:T     log:includes { @forSome :S .
                    :S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                <#_g0>     s:variable :N .
                } ];
             tms:rule-name ssn:SSN_OR02 ] .
    {
        :Query-3     air:non-compliant-with ssn:SSNPolicy_WhereClause .
        
        }     tms:description  (
        "The query, "
        :Query-3
        ", includes reference to SSN number in the where clause" );
         tms:justification  [
             tms:antecedent-expr  [
                 a tms:And-justification;
                 tms:sub-expr  [
                     air:instanceOf ssn:SSN_WC02;
                     tms:description  (
                    :Query-3
                    " is a SPARQL query" );
                     tms:justification  [
                         tms:antecedent-expr  [
                             a tms:And-justification;
                             tms:sub-expr ssn:SSN_WC01,
                                    {:Query-3     a s:Select;
                                 s:POSList <#_g0>;
                                 s:WhereClause :WHERE .
                            } ];
                         tms:rule-name ssn:SSN_WC01 ] ],
                        {:WHERE     s:TriplePattern {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                ssn:T     log:includes {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
                    } .
                <#_g0>     s:variable :S .
                } ];
             tms:rule-name ssn:SSN_WC02 ] .
    {
        :Query-3     a s:Select;
             s:POSList <#_g0>;
             s:WhereClause :WHERE .
        :WHERE     s:Filter <#_g1>;
             s:TriplePattern {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
            } .
        ssn:S     log:includes { @forSome s:AgeOfConsent,
                        s:BooleanGT .
            :N     s:BooleanGT s:AgeOfConsent .
            },
                    { @forSome s:AgeOfConsent,
                        s:BooleanGT .
            :N     s:BooleanGT s:AgeOfConsent .
            } .
        ssn:T     log:includes {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
            },
                    {:S     <http://xmlns.com/foaf/0.1/ssn> :N .
            },
                    { @forSome :S .
            :S     <http://xmlns.com/foaf/0.1/ssn> :N .
            } .
        <#_g0>     s:variable :N,
                    :S .
        <#_g1>     s:TriplePattern {:N     s:BooleanGT s:AgeOfConsent .
            } .
        
        }     tms:justification tms:premise .
    
