# # Items (and their price) belonging to closed auctions with potential annotations # Annotated nodes: item, auction, (item, auction), itemref # Card: xmark_0=0, xmark_1=1, xmark_10=0 # Q1_1 := <$itemref, $price, $y> :- triple($x, $p, $y) tree(//closed_auction[$x:URI]( /itemref/@item[$itemref:VAL], /quantity, /type{VAL="Featured"}, /price[$price:VAL])) ; # # Items (and their seller) belonging to open auctions with potential annotations # Annotated nodes: item, auction, (item, auction), seller, itemref, (auction, seller, itemref) # Card: xmark_0=1, xmark_1=0, xmark_10=2 # Q2_1 := <$itemref, $seller, $y> :- triple($x, , $y) triple($x, $p, $y) tree(//open_auction[$x:URI]( /type, /interval/start{VAL="04/06/2000"}, /seller/@person[$seller:VAL], /itemref/@item[$itemref:VAL])) ; # # People and items they are interested in. # Remark: Suggested selection: //person//country{VAL="Germany"} => Card = 2292 # Annotated nodes: item, incategory, person, interest, (item, incategory, person, interest) # Card: xmark_0=0, xmark_1=1, xmark_10=3 # Q3_1 := <$item, $name, $y> :- triple($x, $p, $y) tree(//item[$x:URI]( /@id[$item:VAL], /location, //incategory/@category[$cat:VAL])) tree(//person( /name[$name:VAL], //country{VAL="Germany"}, //interest/@category[$cat:VAL])) ; # # Names of people who have bid on items they were selling # Annotated nodes: none # Card: xmark_0=0, xmark_1=0, xmark_10=0 # Q4_1 := <$y, $email, $z> :- triple($x, , $y) triple($x, $p, $z) tree(//open_auction( /type, /bidder(/personref/@person[$bidder:VAL]), /seller/@person[$seller:VAL], /itemref[$x:URI]/@item)) tree(//person( /@id[$seller:VAL], //country{VAL="United States"}, //age, /emailaddress[$email:VAL], /name)) ; # # People that have been bidder, seller and buyer. # Annotated nodes: person, bidder, seller, buyer, personref, interest, (person, bidder, seller, buyer, personref, interest) # Card: xmark_0=0, xmark_1=443, xmark_10=? # Q5_1 := <$person, $y> :- triple($x, $p, $y) tree(//person( /@id[$person:VAL], //country, /name[$name:VAL])) tree(//bidder[$x:URI](/date{VAL="10/14/2000"} ,/personref/@person[$person:VAL])) tree(//seller/@person[$person:VAL]) ; # # People watching auctions on item in africa and the exact location of the item. # Annotated nodes: (item, open_auction, person, watch) # Card: xmark_0=0, xmark_1=0, xmark_10=0 # Q6_1 := <$item, $person, $location> :- triple($x, , $y) triple($y, $p, $z) tree(//person[$x:URI]( /name[$person:VAL], //country[$location:VAL], //watch/@open_auction[$auction:VAL])) tree(//open_auction( /@id[$auction:VAL], /type{VAL="Regular"}, /itemref/@item[$item:VAL])) tree(//site//africa/item( /@id[$item:VAL], /location)) ; # # Authors (and their homepage) of comments on items sold in closed auctions. # Remark: Suggested selection: //happiness{VAL="6"} => Card = 1817 # Remark: Extra join possible on //interest/@category => Card = 25, but that yields no result on xmark_0 # Annotated nodes: (item, incategory, closed_auction, annotation, author, itemref, interest) # Card: xmark_0=0, xmark_1=0, xmark_10=? # Q7_3 := <$auction, $y, $z> :- triple($x, $p, $y) triple($y, , $z) tree(//interest[$x:URI]) tree(//watch[$y:URI]/@open_auction[$auction:VAL]) ; # # Items whose categories are linked in the property graph # Annotated nodes: (item, incategory, edge) # Card: xmark_0=0, xmark_1=?, xmark_10=? # Q8_1 := <$item, $x, $y> :- triple($x, $p, $o1) triple($y, , $o2) tree(//item[$x:URI]( /@id[$item:VAL], /location, /quantity{VAL="1"}, //incategory[$y:URI]/@category[$cat1:VAL])) ;