- From: Jones, David H <david.h.jones@boeing.com>
- Date: Tue, 7 Sep 2004 17:40:06 -0700
- To: <public-cwm-talk@w3.org>
I'd like to be able to look up arbitrary values in a table-like structure of rdf properties, but haven't been able figure out how to do it using n3. Can some one show an example of how to do this. Below is my attempt. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix log: <http://www.w3.org/2000/10/swap/log#>. @prefix math: <http://www.w3.org/2000/10/swap/math#>. @prefix string: <http://www.w3.org/2000/10/swap/string#>. # Lookup table [:letterGrade "A"; :numberGrade 10]. [:letterGrade "B"; :numberGrade 7]. [:letterGrade "C"; :numberGrade 5]. [:letterGrade "D"; :numberGrade 3]. [:letterGrade "F"; :numberGrade 1]. :Dave :myLetterGrade "B". :Kathy :myLetterGrade "A". #Attempts at table lookup #{?y. ?x. :temp :val ?x.:numberGrade. ?y.:myLetterGrade string:equalIgnoringCase ?x.:letterGrade } => {?y :myNumberGrade :temp.:val}. {?y.:myLetterGrade string:equalIgnoringCase ?x.:letterGrade } => {?y :myNumberGrade ?x.:numberGrade}. #Intended inferred properties #:Dave :myNumberGrade 5. #:Kathy :myNumberGrade 7. Regards, David H. Jones Boeing Phantom Works, Mathematics & Computing Technology 425-865-6924 425-865-2964 (FAX) david.h.jones@boeing.com
Received on Wednesday, 8 September 2004 00:40:39 UTC