Closed goodmami closed 8 years ago
Update: referents and referrers are no longer axes, but functions (node tests). This is a little more verbose, but is better in that we can make XQuery functions that do the same thing (so the resulting XPaths would look about the same).
tier/item/referents()
//item/referrers("alignment")[../@type="glosses"]
EDIT: additional axes like /following-sibling::node
have been moved to issue #42
XPath itself works on the XigtXML, but it doesn't resolve references, nor does it work for potential non-XML serializations of Xigt data. We need functionality like this:
igt
"find Igt objects"igt/tier
"find tier objects under igts"//item
"find item objects under the context object (whether corpus, igt, or tier)"//item/text()
"find the text (in-situ content) of items"//item/value()
"find the value (resolved content) of items"//tier[@type]
"find the type attribute of tiers"//tier[@type="words"]/item
"find the items of tiers with typewords
"//item[../@type="words"]
(same as previous)igt[metadata//dc:subject/@olac:code="tur"]
"find IGTs whose OLAC metadata say they are about Turkish (iso-639-3 codetur
)"//items[../@type="glosses"][value()="NOM"]
"find items in tiers of typeglosses
whose value isNOM
"So far this is the same as XPath (except for the value() function). But resolving expressions will require a new axis specifier or two (or more). These are only tentative:
//items[../@type="glosses"]/>
"find objects referenced by items in aglosses
tier (by default using either thealignment
orsegmentation
attribute)"//items[../@type="glosses"]/>@alignment
"find objects referenced by items in aglosses
tier (via thealignment
attribute)"//items[../@type="words"]/<
"find objects referring to items in awords
tier (by default using either thealignment
orsegmentation
attribute)"//items[../@type="words"]/<@segmentation
"find objects referring to items in awords
tier (via thesegmentation
attribute)"