@prefix daml: <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2000/10/XMLSchema#> .
@prefix : <http://www.daml.org/2001/08/mdrules/rules.daml#> . # content negotiation fails

<> a daml:Ontology;
   daml:versionInfo "$Id: rules.n3,v 1.6 2001/08/03 19:13:12 mdean Exp $";
   rdfs:comment "DAML Rules Ontology".

:Rule a rdfs:Class;
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :if;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :then;
      daml:cardinality "1" ].

:Atom a rdfs:Class.

:Match a rdfs:Class;
  rdfs:subClassOf :Atom;
  rdfs:comment "true iff it matches against a triple in the model";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :p;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :s;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :o;
      daml:cardinality "1" ].

:Builtin a rdfs:Class;
  rdfs:subClassOf :Atom;
  rdfs:comment "a function defined in the language whose semantics is defined by this specification, but whose implementation is not".

:Type a rdfs:Class;
  rdfs:subClassOf :Builtin;
  rdfs:comment "true iff i is an instance of Class c (using rdf:type, rdfs:subClassOf, and/or computed classes";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :i;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :c;
      daml:cardinality "1" ].

:Test a rdfs:Class;
  rdfs:subClassOf :Atom;
  rdfs:comment "an external function that returns true or false";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :function;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :args;
      daml:cardinality "1" ].

:Call a rdfs:Class;
  rdfs:subClassOf :Atom;
  rdfs:comment "an external procedure that implicity returns true";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :function;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :args;
      daml:cardinality "1" ].

:NotEqual a rdfs:Class;
  rdfs:subClassOf :Atom;
  rdfs:comment "true iff v1 and v2 are not bound to the same value";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :v1;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :v2;
      daml:cardinality "1" ].
   
  
:SubClass a rdfs:Class;
  rdfs:subClassOf :Builtin;
  rdfs:comment "true iff sub is a subclass of Class super";
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :sub;
      daml:cardinality "1" ];
  rdfs:subClassOf
    [ a daml:Restriction;
      daml:onProperty :super;
      daml:cardinality "1" ].

:Variable a rdfs:Class.

:Term a rdfs:Class;
  daml:unionOf ( :Variable rdfs:Resource daml:Thing rdfs:Literal daml:Datatype ).

:PredicateTerm a rdfs:Class;
  daml:unionOf ( rdf:Property ). # might add :Variable later

:AnyClass a rdfs:Class;
  daml:unionOf ( rdfs:Class daml:Class ).

:AnyInstance a rdfs:Class;
  daml:unionOf ( rdfs:Resource daml:Thing ).

:args a rdf:Property;
   rdfs:comment "argument list";
   rdfs:range daml:List.
:c a daml:ObjectProperty;
   rdfs:comment "class";
   rdfs:range :AnyClass.
:function a daml:DatatypeProperty;
   rdfs:comment "an external function name";
   rdfs:range xsd:string.
:i a daml:ObjectProperty;
   rdfs:comment "instance";
   rdfs:range :AnyInstance.
:if a daml:ObjectProperty;
   rdfs:comment "antecedent/premise/body:  a list of Atom";
   rdfs:range daml:List.
:p a daml:ObjectProperty;
   rdfs:comment "predicate";
   rdfs:range :PredicateTerm.
:s a daml:ObjectProperty;
   rdfs:comment "subject";
   rdfs:range :Term.
:o a daml:ObjectProperty;
   rdfs:comment "subject";
   rdfs:range :Term.
:sub a daml:ObjectProperty;
   rdfs:comment "subclass";
   rdfs:range :AnyClass.
:super a daml:ObjectProperty;
   rdfs:comment "superclass";
   rdfs:range :AnyClass.
:then a daml:ObjectProperty;
   rdfs:comment "consequent/conclusion/head:  a list of Atom";
   rdfs:range daml:List.
:v1 a daml:ObjectProperty;
   rdfs:comment "variable 1";
   rdfs:range :Variable.
:v2 a daml:ObjectProperty;
   rdfs:comment "variable 2";
   rdfs:range :Variable.
