Part B1: Shorthand: Paths and Lists
DanC, Sandro, and TimBLAn N3 expression for George's mother's assistant's home's address' zipcode:
[is con:zipcode of [ is con:address of [ is con:home of [ is off:assistant of [ is rel:mother of :George]]]]]
Shorter version of George's mother's assistant's home's address' zipcode using N3 path syntax:
:George.rel:mother .off:assistant .con:home .con:address .con:zipcode
kinda like javascript, python, and other object-oriented programming langauges
You can do backward traversal, using "^" instead of "." as punctuation. For example, if we know Dan's mailbox...
:dan con:mailbox <mailto:connolly@w3.org>
then we can write this expression for Dan:
<mailto:connolly@w3.org>^con:mailbox
Note: This is rather unlike javascript, python, and other object-oriented programming langauges
Joe, Joe's mother, and somebody whose boss is Joe's mother:
If somebody has a mailbox whose URI ends with w3.org, then they're a W3C person:
{ ?x a con:Person. ?x.con:mailbox.log:uri.str:endsWith "@w3.org" } => { ?x a :W3CPerson}
Note that there isn't necessarily only one match for a path - often there are many, when it is used on the left side of a rule.
:me.rel:parent
would be "Some x such that I have parent x", and
:me.rel:parent^rel:parent
would mean "Some y such that for some x, I had parent x and y had parent x", or loosely, some sibling of mine.
The dot must be immediately followed by the next thing, with no whitespace. Like this:
:joe.rel:mother has :hairColor :brown.
or this:
:joe .rel:mother has :hairColor :brown.
but not like this:
:joe . rel:mother has :hairColor :brown.
Cwm doesn't currently use paths on output, so getting cwm to input and output a file will turn it into the form of N3 you already know.
(:x :y) ( :cust.bus:order.bus:number :cust.bus:order .bus:referncedPurchaseOrder .bus:number )
()
rdf:nil
("y")
[ rdf:first "a"; rdf:rest () ]
("x" "y")
[ rdf:first "x"; rdf:rest ("y") ]
( "Monday" "Tuesday" "Wednesday" )
short for
especially cwm built-ins:
( "Dear " ?name " "," ) string:conatenation ?salutation.