@prefix rules: <http://www.daml.org/2001/08/mdrules/rules.daml#> . # content negotiation fails
@prefix gedcom: <http://www.daml.org/2001/01/gedcom/gedcom#> .
@prefix daml: <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix : <http://www.daml.org/2001/08/mdrules/gedcom-relations.daml#> . # content negotiation fails

<> daml:versionInfo "$Id: gedcom-relations.n3,v 1.5 2001/08/03 19:52:22 mdean Exp $";
   rdfs:comment "example showing gedcom-relations in proposed rule ontology";
   rdfs:comment "see also http://www.daml.org/2001/02/gedcom-ruleml/".

:child a rules:Variable. 
:child1 a rules:Variable.
:child2 a rules:Variable.
:family a rules:Variable.
:parent a rules:Variable.
:sibling a rules:Variable.

:parentRule a rules:Rule;
  rdfs:comment "a simple rule, operating on ground DAML+OIL statements";
  rules:if ( [a rules:Match;
              rules:p gedcom:childIn;
              rules:s :child;
              rules:o :family]
             [a rules:Match;
              rules:p gedcom:spouseIn;
              rules:s :parent;
     	      rules:o :family] );
  rules:then ( [a rules:Match;
                rules:p gedcom:parent;
                rules:s :child;
                rules:o :parent ]).

:siblingRule a rules:Rule;
  rdfs:comment "shows need for NotEqual";
  rules:if ( [a rules:Match;
              rules:p gedcom:childIn;
              rules:s :child1;
              rules:o :family]
             [a rules:Match;
              rules:p gedcom:childIn;
              rules:s :child2;
              rules:o :family]
             [a rules:NotEqual;
              rules:v1 :child1;
              rules:v2 :child2] );
  rules:then ( [a rules:Match;
                rules:p gedcom:sibling;
                rules:s :child1;
                rules:o :child2] ).

:brotherRule a rules:Rule;
  rdfs:comment "uses another rule; uses a literal";
  rules:if ( [a rules:Match;
              rules:p gedcom:sibling;
              rules:s :child;
              rules:o :sibling]
             [a rules:Match;
              rules:p gedcom:sex;
              rules:s :sibling;
              rules:o "M"] );
  rules:then ( [a rules:Match;
                rules:p gedcom:brother;
                rules:s :child;
                rules:o :sibling] ).

# XXX -- rest of relations
