Occurrence (query directive)

From WandoraWiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Gets the occurrence with specified type and version from the active column value of input.  
+
Gets the occurrence with specified type and version from the active column value of input. Returns null if the input doesn't have the specified occurrence.
  
 
== Constructor ==
 
== Constructor ==

Revision as of 13:10, 21 August 2009

Contents

Description

Gets the occurrence with specified type and version from the active column value of input. Returns null if the input doesn't have the specified occurrence.

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