BaseName (query directive)
From WandoraWiki
		(Difference between revisions)
		
		
| (One intermediate revision by one user not shown) | |||
| Line 1: | Line 1: | ||
== Description ==  | == Description ==  | ||
| − | Gets the base name of the active column value of input.    | + | Gets the base name of the active column value of input. Returns null if the input doesn't have a base name.  | 
== Constructor ==  | == Constructor ==  | ||
| Line 8: | Line 8: | ||
[[Category:Query directives]]  | [[Category:Query directives]]  | ||
| + | |||
| + | == Examples ==  | ||
| + | |||
| + | Following example gets the base names of the instances of the input topic.  | ||
| + | |||
| + |  importPackage(org.wandora.query2);  | ||
| + |  new BaseName().from(new Instances())  | ||
| + | |||
| + | Following example gets the base name of content type topic.  | ||
| + | |||
| + |  importPackage(org.wandora.query2);  | ||
| + |  new BaseName().from("http://www.wandora.org/core/contenttype")  | ||
| + | |||
| + | Following example finds all topics in the topic map which do not have a base name.  | ||
| + | |||
| + |  importPackage(org.wandora.query2);  | ||
| + |  new BaseName().from(new AllTopics().as("#topic"))  | ||
| + |  .where("#DEFAULT","=",null)  | ||
| + | |||
| + | Following example gets the base name of the input topic or the first subject identifier if it doesn't have a base name.  | ||
| + | |||
| + |  importPackage(org.wandora.query2);  | ||
| + |  new If(  | ||
| + |    new BaseName().where("#DEFAULT","!=",null),  | ||
| + |    new BaseName(),  | ||
| + |    new First(new SubjectIdentifiers())  | ||
| + |  )  | ||
Latest revision as of 13:10, 21 August 2009
[edit] Description
Gets the base name of the active column value of input. Returns null if the input doesn't have a base name.
[edit] Constructor
BaseName()
[edit] Examples
Following example gets the base names of the instances of the input topic.
importPackage(org.wandora.query2); new BaseName().from(new Instances())
Following example gets the base name of content type topic.
importPackage(org.wandora.query2);
new BaseName().from("http://www.wandora.org/core/contenttype")
Following example finds all topics in the topic map which do not have a base name.
importPackage(org.wandora.query2);
new BaseName().from(new AllTopics().as("#topic"))
.where("#DEFAULT","=",null)
Following example gets the base name of the input topic or the first subject identifier if it doesn't have a base name.
importPackage(org.wandora.query2);
new If(
  new BaseName().where("#DEFAULT","!=",null),
  new BaseName(),
  new First(new SubjectIdentifiers())
)