Changes

695 bytes added ,  16:30, 3 October 2007
Adding another example of a powerful ASK query
Line 3: Line 3:  
'''ASK''' is perhaps [[Directory:Centiare|Centiare's]] most powerful tool for searching for information in the directory. It can be used in conjunction with or as an alternative to the [[Centiare:Search Triple|Search Triple]] form-based search tool.  Only [[Centiare:Registration|registered users]] may create these ASK queries.
 
'''ASK''' is perhaps [[Directory:Centiare|Centiare's]] most powerful tool for searching for information in the directory. It can be used in conjunction with or as an alternative to the [[Centiare:Search Triple|Search Triple]] form-based search tool.  Only [[Centiare:Registration|registered users]] may create these ASK queries.
   −
===Example===
+
----
Suppose you were interested in displaying all of the Centiare articles where a ''[[Latitude]]'' [[Help:Semantic_Tags#Attributes|attribute]] between 39 degrees and 40 degrees North has been tagged.  The following example ASK query...  
+
 
 +
===Example 1===
 +
Suppose you were interested in displaying all of the Centiare articles where a ''[[Latitude]]'' [[Help:Semantic_Tags#Attributes|attribute]] between 36 degrees and 42 degrees North has been tagged by an editor.  The following example ASK query...
 +
 
 +
<pre>
 +
<ask>
 +
[[City:=*]]
 +
[[State Code:=*|State]]
 +
[[Zip:=*]]
 +
[[Latitude:=>36.0]][[Latitude:=<40.0]][[Latitude:=*|Latitude]]
 +
</ask>
 +
</pre>
 +
 
 +
...instantaneously produces this report when the page is saved:
 +
 
 +
<ask>
 +
[[City:=*]]
 +
[[State Code:=*|State]]
 +
[[Zip:=*]]
 +
[[Latitude:=>36.0]][[Latitude:=<40.0]][[Latitude:=*|Latitude]]
 +
</ask>
 +
 
 +
<br>
 +
 
 +
===Example 2===
 +
Suppose you wanted to find all the Centiare articles that identify something in Canada (Country Code is "CA"), but only those that indicate that the subject is incorporated in the state of New York (Incorporation State is "NY").  You also want the phone number of any of the matches.  The following example ASK query...  
    
<pre>
 
<pre>
Line 11: Line 36:  
[[State Code:=*|State]]
 
[[State Code:=*|State]]
 
[[Zip:=*]]
 
[[Zip:=*]]
[[Latitude:=>39.0]][[Latitude:=<40.0]][[Latitude:=*|Latitude]]
+
[[Phone:=*]]
 +
[[Country Code:=CA]]
 +
[[Incorporation State:=NY]]
 
</ask>
 
</ask>
 
</pre>
 
</pre>
   −
...instantaneously produces this report when the page is Saved:
+
...instantaneously produces this report when the page is saved:
    
<ask>
 
<ask>
Line 21: Line 48:  
[[State Code:=*|State]]
 
[[State Code:=*|State]]
 
[[Zip:=*]]
 
[[Zip:=*]]
[[Latitude:=>39.0]][[Latitude:=<40.0]][[Latitude:=*|Latitude]]
+
[[Phone:=*]]
 +
[[Country Code:=CA]]
 +
[[Incorporation State:=NY]]
 
</ask>
 
</ask>
 +
    
<br>
 
<br>
Of course, this is just an example, and ASK queries may be written to be as inclusive or restrictive of qualifying attributes as the author wishes.  We recommend that you experiment with your own ASK queries on your User page (or sub-page) before you implement them in Directory or Main Space pages.
+
----
 +
Of course, these are just examples, and ASK queries may be written to be as inclusive or restrictive of qualifying attributes as the author wishes.  We recommend that you experiment with your own ASK queries on your User page (or sub-page) before you implement them in Directory or Main Space pages.