BaseName (query directive)

From WandoraWiki
(Difference between revisions)
Jump to: navigation, search
 
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())
 +
)

Revision as of 12:17, 21 August 2009

Description

Gets the base name of the active column value of input.

Constructor

BaseName()

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())
)
Personal tools