Occurrence (query directive)

From WandoraWiki
Revision as of 11:36, 21 August 2009 by Olli (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Description

Gets the occurrence with specified type and version from the active column value of input.

Constructor

Occurrence(String type,String version)

Notes

The version is usually one of the standard language topics. You can get these using the getLang method in XTMPSI class. To use this you need to include org.wandora.topicmap package. See examples on how to do this.

Examples

Following example gets all instances of the input topic which have an occurrence with the value of a string literal "Test". Note the use of XTMPSI.getLang method to get the language topic subject identifier. This method can also be given null as a parameter to get the language independent topic.

importPackage(org.wandora.query2);
importPackage(org.wandora.topicmap);
new Occurrence("http://www.wandora.org/occurrence",XTMPSI.getLang("en"))
.as("#occ")
.from(new Instances())
.where("#occ","=","\"Test\"")
Personal tools