- Timestamp:
- 03/18/10 17:20:35 (14 years ago)
- Location:
- MDService/trunk/xquery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService/trunk/xquery/cmd-model.xql
r247 r254 13 13 14 14 declare function local:cmd-model() as item()* { 15 let $ action := request:get-parameter("operation", ""),15 let $operation := request:get-parameter("operation", $cmd-model:queryModel), 16 16 $cmd-index := request:get-parameter("q", "MDGroup/Actors/Actor"), 17 17 $cmd-index-path := … … 23 23 $collection := fn:concat("/db/cmdi-mirror/", request:get-parameter("collection", "silang_data")), 24 24 $max-depth as xs:integer := xs:integer(request:get-parameter("maxdepth", 1)) 25 26 25 return 26 if ($operation eq $cmd-model:getCollections) then 27 (: cmd-model:get-collections() :) 28 else if ($operation eq $cmd-model:queryModel) then 27 29 if ($format eq "json") then 28 30 let $option := util:declare-option("exist:serialize", "method=text media-type=application/json") 29 31 return 30 32 (: json:xml-to-json( :) cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth) (:) :) 31 else 32 cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth) 33 else 34 cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth) 35 else if ($operation eq $cmd-model:searchRetrieve) then 36 (: cmd-model:search-retrieve() :) 37 else 38 <error>Unknown operation</error> 39 33 40 }; 34 41 -
MDService/trunk/xquery/cmd-model.xqm
r251 r254 12 12 declare variable $cmd-model:commonFreqsPath as xs:string := "/db/common/clarin/freqs"; 13 13 declare variable $cmd-model:cmdiMirrorPath as xs:string := "/db/cmdi-mirror"; 14 15 declare variable $cmd-model:getCollections as xs:string := "getCollections"; 16 declare variable $cmd-model:queryModel as xs:string := "queryModel"; 17 declare variable $cmd-model:searchRetrieve as xs:string := "searchRetrieve"; 14 18 15 19 declare variable $cmd-model:typeActorPath as xs:string := "MDGroup/Actors/Actor"; … … 31 35 let $text-count-distinct := count(distinct-values($text-nodes)) 32 36 return 33 <Term path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}"> 34 {if ($depth > 0) then37 <Term path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}" count_distinct_text="{$text-count-distinct}">{ 38 if ($depth > 0) then 35 39 for $elname in $subs[. != ''] 36 40 return
Note: See TracChangeset
for help on using the changeset viewer.