(: nom propre + verb + det + nom commun :)
{
for $p in collection("sortieTalismane-3208.xml")//p
for $item in $p//item
let $nextitem := $item/following-sibling::item[1]
let $nextitem2 := $item/following-sibling::item[2]
let $nextitem3 := $item/following-sibling::item[3]
where $item/a[4]/text()[matches(., "NPP")] and $nextitem/a[4]/text()[matches(., "V")] and $nextitem2/a[4]/text()[matches(., "DET")] and $nextitem3/a[4]/text()[matches(., "NC")]
return
{$item/a[2]/text(), " ", $nextitem/a[2]/text(), " ", $nextitem2/a[2]/text(), " ", $nextitem3/a[2]/text()}
}
(: nom commun + prep + nom commun :)
{
for $p in collection("sortieTalismane-3208.xml")//p
for $item in $p//item
let $nextitem := $item/following-sibling::item[1]
let $nextitem2 := $item/following-sibling::item[2]
where $item/a[4]/text()[matches(., "NC")] and $nextitem/a[4]/text()[matches(., "^P$")] and $nextitem2/a[4]/text()[matches(., "NC")]
return
{$item/a[2]/text(), " ", $nextitem/a[2]/text(), " ", $nextitem2/a[2]/text()}
}
(: nom commun + adj :)
{
for $p in collection("sortieTalismane-3208.xml")//p
for $item in $p//item
let $nextitem := $item/following-sibling::item[1]
where $item/a[4][contains(text(), "NC")] and $nextitem/a[4][contains(text(), "ADJ")]
return
{concat($item/a[2]/text(), " ", $nextitem/a[2]/text())}
}