# $Id: pimP.n3 1295 2007-05-11 16:52:51Z josd $

@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix str: <http://www.w3.org/2000/10/swap/string#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix : <http://eulersharp.sourceforge.net/2003/01calt/pimP#>.

<> :forYear 1999, 2000, 2001, 2002, 2003.

:johnDoe a :Contact;
          :bornYear 1946; :bornMonth 11; :bornDay 1;
          :diedYear 2001; :diedMonth 11; :diedDay 3.
:janeDoe a :Contact; a :LivePerson;
          :bornYear 2000; :bornMonth 4; :bornDay 13.

{?p a :LivePerson; :bornYear ?by; :bornMonth ?bm; :bornDay ?bd.
          <> :forYear ?y. ?y math:notLessThan ?by.
          (?y "-" ?bm "-" ?bd)  str:concatenation ?s} => {?p :happyBirthDay ?s}.
{?p :bornYear ?by; :bornMonth ?bm; :bornDay ?bd; :diedYear ?dy.
          <> :forYear ?y. ?y math:notLessThan ?by; math:lessThan ?dy.
          (?y "-" ?bm "-" ?bd)  str:concatenation ?s} => {?p :happyBirthDay ?s}.
{?p :bornYear ?by; :bornMonth ?bm; :bornDay ?bd; :diedYear ?dy; :diedMonth ?dm.
          <> :forYear ?dy. ?bm math:lessThan ?dm.
          (?dy "-" ?bm "-" ?bd)  str:concatenation ?s} => {?p :happyBirthDay ?s}.
{?p :bornYear ?by; :bornMonth ?bm; :bornDay ?bd; :diedYear ?dy; :diedMonth ?bm; :diedDay ?dd.
          <> :forYear ?dy. ?bd math:lessThan ?dd.
          (?dy "-" ?bm "-" ?bd)  str:concatenation ?s} => {?p :happyBirthDay ?s}.
