Re: How can I derive courses missing from courses taken and course required by Major?

 > Can I use owl/n3 rules to derive a field 'coursesMissing' [...]

Yes, using the following rules file:

[[[
$ cat courses.n3
@prefix : <#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix per: <http://www.nr.mil/2004/10/personnel#> .

# @@ "requiredCourse" would be a better propname, &c.

@forAll :s, :c .

{ :s a per:Student;
   per:major [ per:coursesRequired :c ] }
    => { :s :mustTake :c } .

{ :s :mustTake :c }
    => { { <requiredCourse.n3>.log:semantics
              log:notIncludes { :s per:coursesTaken :c } }
         => { :s per:coursesMissing :c } } .

# EOF
]]]

And command line:
    $ cwm requiredCourse.n3 courses.n3 --think

Output quote:

[[[
     m:Dave     a :Student;
          cou:mustTake m:c1,
                 m:c2,
                 m:c3;
          :coursesMissing m:c3;
          :coursesTaken m:c1,
                 m:c2;
          :major m:m1 .
]]]

Using CWM 0.8 [1].

Cheers,

[1] http://www.w3.org/2000/10/swap/cwm-0.8.tar.gz

-- 
Sean B. Palmer, http://inamidst.com/sbp/

Received on Saturday, 16 October 2004 18:32:07 UTC