
# $Id: base-rules.ttl 7769 2007-12-06 02:14:47Z cph $
#
# Copyright (C) 2007 Massachusetts Institute of Technology
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.

# AIR base rules

@prefix : <http://dig.csail.mit.edu/TAMI/2007/amord/base-rules#> .
@prefix abr: <http://dig.csail.mit.edu/TAMI/2007/amord/base-rules#> .

@prefix air: <http://dig.csail.mit.edu/TAMI/2007/amord/air#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

air:base-rules a air:Policy;
    air:rule
	:transitive-property-implication,
	:symmetric-property-implication,
	:sub-class-implication,
	:sub-property-implication,
	:same-as-implication,
	:domain-implication,
	:range-implication.

:transitive-property-implication
    air:variable :P;
    air:pattern { :P a owl:TransitiveProperty. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N1, :N2;
	air:pattern { :N1 :P :N2. };
	air:rule [
	    air:variable :N3;
	    air:pattern { :N1 :P :N3. };
	    air:matched-graph :G2;
	    air:rule [
		air:variable :N4;
		air:pattern { :N3 :P :N4. };
		air:matched-graph :G3;
		air:assertion [
		    air:statement { :N1 :P :N4. };
		    air:justification [
			air:rule-id :transitive-property-implication;
			air:antecedent :G1, :G2, :G3;
		    ];
		];
	    ];
	];
	air:rule [
	    air:variable :N3;
	    air:pattern { :N3 :P :N2. };
	    air:matched-graph :G2;
	    air:rule [
		air:variable :N4;
		air:pattern { :N4 :P :N3. };
		air:matched-graph :G3;
		air:assertion [
		    air:statement { :N4 :P :N2. };
		    air:justification [
			air:rule-id :transitive-property-implication;
			air:antecedent :G1, :G2, :G3;
		    ];
		];
	    ];
	];
    ].

:symmetric-property-implication
    air:variable :P;
    air:pattern { :P a owl:SymmetricProperty. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N1, :N2;
	air:pattern { :N1 :P :N2. };
	air:rule [
	    air:pattern { :N2 :P :N1. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N1 :P :N2. };
		air:justification [
		    air:rule-id :symmetric-property-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].

:sub-class-implication
    air:variable :C1, :C2;
    air:pattern { :C1 rdfs:subClassOf :C2. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N;
	air:pattern { :N a :C2. };
	air:rule [
	    air:pattern { :N a :C1. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N a :C2. };
		air:justification [
		    air:rule-id :sub-class-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].

:sub-property-implication
    air:variable :P1, :P2;
    air:pattern { :P1 rdfs:subPropertyOf :P2. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N1, :N2;
	air:pattern { :N1 :P2 :N2. };
	air:rule [
	    air:pattern { :N1 :P1 :N2. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N1 :P2 :N2. };
		air:justification [
		    air:rule-id :sub-property-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].

:same-as-implication
    air:variable :N1, :N2;
    air:pattern { :N1 owl:sameAs :N2. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :P, :O;
	air:pattern { :N1 :P :O. };
	air:rule [
	    air:pattern { :N2 :P :O. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N1 :P :O. };
		air:justification [
		    air:rule-id :same-as-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ];
    air:goal-rule [
	air:variable :S, :O;
	air:pattern { :S :N1 :O. };
	air:rule [
	    air:pattern { :S :N2 :O. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :S :N1 :O. };
		air:justification [
		    air:rule-id :same-as-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ];
    air:goal-rule [
	air:variable :S, :P;
	air:pattern { :S :P :N1. };
	air:rule [
	    air:pattern { :S :P :N2. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :S :P :N1. };
		air:justification [
		    air:rule-id :same-as-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].

:domain-implication
    air:variable :P, :C;
    air:pattern { :P rdfs:domain :C. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N1;
	air:pattern { :N1 a :C. };
	air:rule [
	    air:variable :N2;
	    air:pattern { :N1 :P :N2. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N1 a :C. };
		air:justification [
		    air:rule-id :domain-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].

:range-implication
    air:variable :P, :C;
    air:pattern { :P rdfs:range :C. };
    air:matched-graph :G1;
    air:goal-rule [
	air:variable :N1;
	air:pattern { :N1 a :C. };
	air:rule [
	    air:variable :N2;
	    air:pattern { :N2 :P :N1. };
	    air:matched-graph :G2;
	    air:assertion [
		air:statement { :N1 a :C. };
		air:justification [
		    air:rule-id :range-implication;
		    air:antecedent :G1, :G2;
		];
	    ];
	];
    ].
