Occurrence (query directive)
From WandoraWiki
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\"")