Holger Knublauch

EPIM search progress

...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
9 @prefix html: <http://uispin.org/html#> . 9 @prefix html: <http://uispin.org/html#> .
10 @prefix let: <http://uispin.org/let#> . 10 @prefix let: <http://uispin.org/let#> .
11 @prefix letrs: <http://uispin.org/letrs#> . 11 @prefix letrs: <http://uispin.org/letrs#> .
12 +@prefix list: <http://jena.hpl.hp.com/ARQ/list#> .
12 @prefix owl: <http://www.w3.org/2002/07/owl#> . 13 @prefix owl: <http://www.w3.org/2002/07/owl#> .
13 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 14 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
14 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 15 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
...@@ -1324,7 +1325,6 @@ app:FormHeader ...@@ -1324,7 +1325,6 @@ app:FormHeader
1324 ui:prototype 1325 ui:prototype
1325 [ rdf:type html:Div ; 1326 [ rdf:type html:Div ;
1326 html:class "appHeader"^^xsd:string ; 1327 html:class "appHeader"^^xsd:string ;
1327 - html:id "content"^^xsd:string ;
1328 let:type 1328 let:type
1329 [ rdf:type app:resourceType ; 1329 [ rdf:type app:resourceType ;
1330 arg:resource 1330 arg:resource
...@@ -3695,6 +3695,13 @@ app:SearchForm ...@@ -3695,6 +3695,13 @@ app:SearchForm
3695 spl:predicate arg:resultsId ; 3695 spl:predicate arg:resultsId ;
3696 spl:valueType xsd:string 3696 spl:valueType xsd:string
3697 ] ; 3697 ] ;
3698 + spin:constraint
3699 + [ rdf:type spl:Argument ;
3700 + rdfs:comment "An optional graph that contains the schema (needed to determine whether an instance has a class that is the subclass of the resource type)."^^xsd:string ;
3701 + spl:optional "true"^^xsd:boolean ;
3702 + spl:predicate arg:schemaGraph ;
3703 + spl:valueType owl:Ontology
3704 + ] ;
3698 ui:prototype 3705 ui:prototype
3699 [ rdf:type ui:setContext ; 3706 [ rdf:type ui:setContext ;
3700 let:fid [ rdf:type sp:if ; 3707 let:fid [ rdf:type sp:if ;
...@@ -3760,6 +3767,26 @@ app:SearchForm ...@@ -3760,6 +3767,26 @@ app:SearchForm
3760 ui:child 3767 ui:child
3761 [ rdf:type ui:if ; 3768 [ rdf:type ui:if ;
3762 ui:child 3769 ui:child
3770 + [ rdf:type html:Input ;
3771 + html:name "schemaURI"^^xsd:string ;
3772 + html:type "hidden"^^xsd:string ;
3773 + html:value
3774 + [ rdf:type ui:encodeNode ;
3775 + sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
3776 + ]
3777 + ] ;
3778 + ui:childIndex 0
3779 + ] ;
3780 + ui:childIndex 2 ;
3781 + ui:condition
3782 + [ rdf:type sp:bound ;
3783 + sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
3784 + ]
3785 + ]
3786 + ] ;
3787 + ui:child
3788 + [ rdf:type ui:if ;
3789 + ui:child
3763 [ rdf:type ui:forEach ; 3790 [ rdf:type ui:forEach ;
3764 ui:child 3791 ui:child
3765 [ rdf:type html:Input ; 3792 [ rdf:type html:Input ;
...@@ -3784,19 +3811,10 @@ app:SearchForm ...@@ -3784,19 +3811,10 @@ app:SearchForm
3784 sp:resultVariables ([ sp:varName "keyProperty"^^xsd:string 3811 sp:resultVariables ([ sp:varName "keyProperty"^^xsd:string
3785 ]) ; 3812 ]) ;
3786 sp:where ([ rdf:type sp:NamedGraph ; 3813 sp:where ([ rdf:type sp:NamedGraph ;
3787 - sp:elements ([ rdf:type sp:TriplePath ; 3814 + sp:elements ([ sp:object
3788 - sp:object
3789 [ sp:varName "keyProperty"^^xsd:string 3815 [ sp:varName "keyProperty"^^xsd:string
3790 ] ; 3816 ] ;
3791 - sp:path [ rdf:type sp:SeqPath ; 3817 + sp:predicate list:member ;
3792 - sp:path1
3793 - [ rdf:type sp:ModPath ;
3794 - sp:modMax -2 ;
3795 - sp:modMin 0 ;
3796 - sp:subPath rdf:rest
3797 - ] ;
3798 - sp:path2 rdf:first
3799 - ] ;
3800 sp:subject 3818 sp:subject
3801 [ sp:varName "kp"^^xsd:string 3819 [ sp:varName "kp"^^xsd:string
3802 ] 3820 ]
...@@ -3805,7 +3823,7 @@ app:SearchForm ...@@ -3805,7 +3823,7 @@ app:SearchForm
3805 ]) 3823 ])
3806 ] 3824 ]
3807 ] ; 3825 ] ;
3808 - ui:childIndex 2 ; 3826 + ui:childIndex 3 ;
3809 ui:condition 3827 ui:condition
3810 [ rdf:type sp:bound ; 3828 [ rdf:type sp:bound ;
3811 sp:arg1 [ sp:varName "kp"^^xsd:string 3829 sp:arg1 [ sp:varName "kp"^^xsd:string
...@@ -3822,7 +3840,7 @@ app:SearchForm ...@@ -3822,7 +3840,7 @@ app:SearchForm
3822 [ rdf:type app:resourceType 3840 [ rdf:type app:resourceType
3823 ] 3841 ]
3824 ] ; 3842 ] ;
3825 - ui:childIndex 3 3843 + ui:childIndex 4
3826 ] ; 3844 ] ;
3827 ui:child 3845 ui:child
3828 [ rdf:type html:Div ; 3846 [ rdf:type html:Div ;
...@@ -3846,7 +3864,7 @@ app:SearchForm ...@@ -3846,7 +3864,7 @@ app:SearchForm
3846 html:value "Search"^^xsd:string ; 3864 html:value "Search"^^xsd:string ;
3847 ui:childIndex 0 3865 ui:childIndex 0
3848 ] ; 3866 ] ;
3849 - ui:childIndex 4 3867 + ui:childIndex 5
3850 ] ; 3868 ] ;
3851 ui:childIndex 0 ; 3869 ui:childIndex 0 ;
3852 ui:varName "createLinkFunction"^^xsd:string ; 3870 ui:varName "createLinkFunction"^^xsd:string ;
...@@ -6279,9 +6297,13 @@ app:createLoadSearchFormCall ...@@ -6279,9 +6297,13 @@ app:createLoadSearchFormCall
6279 [ rdf:type fn:concat ; 6297 [ rdf:type fn:concat ;
6280 sp:arg1 "appLoadSearchForm('" ; 6298 sp:arg1 "appLoadSearchForm('" ;
6281 sp:arg10 6299 sp:arg10
6300 + [ sp:varName "sg"^^xsd:string
6301 + ] ;
6302 + sp:arg11 "'" ;
6303 + sp:arg12
6282 [ sp:varName "nb"^^xsd:string 6304 [ sp:varName "nb"^^xsd:string
6283 ] ; 6305 ] ;
6284 - sp:arg11 ")" ; 6306 + sp:arg13 ")" ;
6285 sp:arg2 [ sp:varName "oldElementId"^^xsd:string 6307 sp:arg2 [ sp:varName "oldElementId"^^xsd:string
6286 ] ; 6308 ] ;
6287 sp:arg3 "', '" ; 6309 sp:arg3 "', '" ;
...@@ -6293,7 +6315,7 @@ app:createLoadSearchFormCall ...@@ -6293,7 +6315,7 @@ app:createLoadSearchFormCall
6293 sp:arg7 ", '" ; 6315 sp:arg7 ", '" ;
6294 sp:arg8 [ rdf:type ui:currentQueryGraph 6316 sp:arg8 [ rdf:type ui:currentQueryGraph
6295 ] ; 6317 ] ;
6296 - sp:arg9 "'" 6318 + sp:arg9 "', '"
6297 ] ; 6319 ] ;
6298 sp:varName "result"^^xsd:string 6320 sp:varName "result"^^xsd:string
6299 ]) ; 6321 ]) ;
...@@ -6309,6 +6331,17 @@ app:createLoadSearchFormCall ...@@ -6309,6 +6331,17 @@ app:createLoadSearchFormCall
6309 sp:variable 6331 sp:variable
6310 [ sp:varName "nb"^^xsd:string 6332 [ sp:varName "nb"^^xsd:string
6311 ] 6333 ]
6334 + ] [ rdf:type sp:Bind ;
6335 + sp:expression
6336 + [ rdf:type sp:coalesce ;
6337 + sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
6338 + ] ;
6339 + sp:arg2 [ rdf:type ui:currentQueryGraph
6340 + ]
6341 + ] ;
6342 + sp:variable
6343 + [ sp:varName "sg"^^xsd:string
6344 + ]
6312 ]) 6345 ])
6313 ] ; 6346 ] ;
6314 spin:constraint 6347 spin:constraint
...@@ -6334,6 +6367,13 @@ app:createLoadSearchFormCall ...@@ -6334,6 +6367,13 @@ app:createLoadSearchFormCall
6334 rdfs:comment "The results id."^^xsd:string ; 6367 rdfs:comment "The results id."^^xsd:string ;
6335 spl:predicate arg:resultsId ; 6368 spl:predicate arg:resultsId ;
6336 spl:valueType xsd:string 6369 spl:valueType xsd:string
6370 + ] ;
6371 + spin:constraint
6372 + [ rdf:type spl:Argument ;
6373 + rdfs:comment "The schema graph."^^xsd:string ;
6374 + spl:optional "true"^^xsd:boolean ;
6375 + spl:predicate arg:schemaGraph ;
6376 + spl:valueType owl:Ontology
6337 ] . 6377 ] .
6338 6378
6339 app:createNewTabLink 6379 app:createNewTabLink
...@@ -6498,7 +6538,7 @@ app:keyPropertiesFunctor ...@@ -6498,7 +6538,7 @@ app:keyPropertiesFunctor
6498 6538
6499 app:keyPropertyVarName 6539 app:keyPropertyVarName
6500 rdf:type spin:Function ; 6540 rdf:type spin:Function ;
6501 - rdfs:comment "Creates a SPARQL variable name from a property. The algorithm simply takes the qname and then replaces the : with 'VAR_'. Note that SPARQL variable names should not begin with '_' and therefore the default namespace would be mapped to a blank node otherwise."^^xsd:string ; 6541 + rdfs:comment "Creates a SPARQL variable name from a property. The algorithm simply takes the qname and then replaces the ':' with '_'."^^xsd:string ;
6502 rdfs:label "key property var name"^^xsd:string ; 6542 rdfs:label "key property var name"^^xsd:string ;
6503 rdfs:subClassOf app:Functions ; 6543 rdfs:subClassOf app:Functions ;
6504 spin:body 6544 spin:body
...@@ -6510,7 +6550,7 @@ app:keyPropertyVarName ...@@ -6510,7 +6550,7 @@ app:keyPropertyVarName
6510 ] 6550 ]
6511 ] ; 6551 ] ;
6512 sp:arg2 ":" ; 6552 sp:arg2 ":" ;
6513 - sp:arg3 "VAR_" 6553 + sp:arg3 "_"
6514 ] ; 6554 ] ;
6515 sp:varName "result"^^xsd:string 6555 sp:varName "result"^^xsd:string
6516 ]) ; 6556 ]) ;
...@@ -6878,6 +6918,11 @@ arg:rowIndex ...@@ -6878,6 +6918,11 @@ arg:rowIndex
6878 rdfs:label "row index"^^xsd:string ; 6918 rdfs:label "row index"^^xsd:string ;
6879 rdfs:subPropertyOf sp:arg . 6919 rdfs:subPropertyOf sp:arg .
6880 6920
6921 +arg:schemaGraph
6922 + rdf:type rdf:Property ;
6923 + rdfs:label "schema graph"^^xsd:string ;
6924 + rdfs:subPropertyOf sp:arg .
6925 +
6881 arg:script 6926 arg:script
6882 rdf:type rdf:Property ; 6927 rdf:type rdf:Property ;
6883 rdfs:label "script"^^xsd:string ; 6928 rdfs:label "script"^^xsd:string ;
......
...@@ -148,8 +148,8 @@ a:active.appFormHeaderLink { ...@@ -148,8 +148,8 @@ a:active.appFormHeaderLink {
148 background-color: darkGray; 148 background-color: darkGray;
149 color: white; 149 color: white;
150 padding-left: 4px; 150 padding-left: 4px;
151 - padding-top: 1px; 151 + padding-top: 2px;
152 - padding-bottom: 1px; 152 + padding-bottom: 2px;
153 padding-right: 4px; 153 padding-right: 4px;
154 } 154 }
155 155
......
...@@ -186,17 +186,21 @@ function appLoadEditForm(parentId, resourceType) { ...@@ -186,17 +186,21 @@ function appLoadEditForm(parentId, resourceType) {
186 * @param resultsId the id of the element to display the search results 186 * @param resultsId the id of the element to display the search results
187 * @param resourceTypeURI the type of resources to search for 187 * @param resourceTypeURI the type of resources to search for
188 * @param queryGraphURI the query graph URI 188 * @param queryGraphURI the query graph URI
189 + * @param schemaGraphURI (optional) the URI of the schema graph
189 * @param noBorder (optional) to suppress the border 190 * @param noBorder (optional) to suppress the border
190 */ 191 */
191 -function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphURI, noBorder) { 192 +function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphURI, schemaGraphURI, noBorder) {
192 var data = { 193 var data = {
193 formId: oldElementId, 194 formId: oldElementId,
194 resourceType: '<' + resourceTypeURI + '>', 195 resourceType: '<' + resourceTypeURI + '>',
195 resultsId: resultsId, 196 resultsId: resultsId,
196 _base : '<' + queryGraphURI + '>', 197 _base : '<' + queryGraphURI + '>',
197 - _viewClass: 'app:SearchForm', 198 + _viewClass : 'app:SearchForm',
198 - _snippet: true 199 + _snippet : true
199 }; 200 };
201 + if(schemaGraphURI) {
202 + data.schemaGraph = '<' + schemaGraphURI + '>';
203 + }
200 if(noBorder) { 204 if(noBorder) {
201 data.noBorder = true; 205 data.noBorder = true;
202 } 206 }
......
...@@ -2,34 +2,32 @@ ...@@ -2,34 +2,32 @@
2 let:keyProperties="{= app:getKeyProperties(?type) }" 2 let:keyProperties="{= app:getKeyProperties(?type) }"
3 let:pagerId="{= ui:uniqueId() }" 3 let:pagerId="{= ui:uniqueId() }"
4 let:tableId="{= ui:uniqueId() }"> 4 let:tableId="{= ui:uniqueId() }">
5 - <table id="{= ?tableId }" style="width: 100%"/> 5 + <table id="{= ?tableId }"/>
6 <div id="{= ?pagerId }" /> 6 <div id="{= ?pagerId }" />
7 <script> 7 <script>
8 $("#{= ?tableId }").jqGrid({ 8 $("#{= ?tableId }").jqGrid({
9 <swon:NameValuePair arg:name="url" arg:value="{= fn:concat('getSearchResults?', ?params) }" />, 9 <swon:NameValuePair arg:name="url" arg:value="{= fn:concat('getSearchResults?', ?params) }" />,
10 <swon:NameValuePair arg:name="datatype" arg:value="json" />, 10 <swon:NameValuePair arg:name="datatype" arg:value="json" />,
11 colNames:[ 11 colNames:[
12 - 'Resource' 12 + <ui:if ui:condition="{= bound(?keyProperties) }">
13 - <ui:if ui:condition="{= bound(?keyProperties) }">,
14 <ui:forEach ui:resultSet="{# 13 <ui:forEach ui:resultSet="{#
15 SELECT ?colName 14 SELECT ?colName
16 WHERE { 15 WHERE {
17 GRAPH ui:graph { 16 GRAPH ui:graph {
18 - ?keyProperties (rdf:rest*)/rdf:first ?keyProperty . 17 + ?keyProperties list:member ?keyProperty .
19 - BIND (spif:titleCase(ui:label(?keyProperty) AS ?colName)) . 18 + BIND (spif:titleCase(ui:label(?keyProperty)) AS ?colName) .
20 } 19 }
21 } 20 }
22 }" ui:separator=","> 21 }" ui:separator=",">
23 '{= ?colName }' 22 '{= ?colName }'
24 </ui:forEach> 23 </ui:forEach>
25 </ui:if> 24 </ui:if>
25 + <ui:else>
26 + 'Resource'
27 + </ui:else>
26 ], 28 ],
27 colModel:[ 29 colModel:[
28 - { 30 + <ui:if ui:condition="{= bound(?keyProperties) }">
29 - name : 'result',
30 - width: 200
31 - }
32 - <ui:if ui:condition="{= bound(?keyProperties) }">,
33 <ui:forEach ui:resultSet="{# 31 <ui:forEach ui:resultSet="{#
34 SELECT ?varName 32 SELECT ?varName
35 WHERE { 33 WHERE {
...@@ -44,6 +42,11 @@ ...@@ -44,6 +42,11 @@
44 } 42 }
45 </ui:forEach> 43 </ui:forEach>
46 </ui:if> 44 </ui:if>
45 + <ui:else>
46 + {
47 + name : 'label'
48 + }
49 + </ui:else>
47 ], 50 ],
48 rowNum: 10, 51 rowNum: 10,
49 rowList:[5,10,20], 52 rowList:[5,10,20],
...@@ -51,7 +54,7 @@ ...@@ -51,7 +54,7 @@
51 viewrecords: true, 54 viewrecords: true,
52 sortorder: "desc", 55 sortorder: "desc",
53 height: "100%", 56 height: "100%",
54 - width: "500" 57 + width: "100%"
55 }).jqGrid('navGrid', '#{= ?pagerId }', { add:false, edit:false, del:false}); 58 }).jqGrid('navGrid', '#{= ?pagerId }', { add:false, edit:false, del:false});
56 </script> 59 </script>
57 </ui:group> 60 </ui:group>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -21,17 +21,19 @@ ...@@ -21,17 +21,19 @@
21 21
22 log:LogBrowser 22 log:LogBrowser
23 rdf:type ui:NodeClass ; 23 rdf:type ui:NodeClass ;
24 - rdfs:comment "A complex element with a tree of log event classes in the upper left corner, a search form in the upper center area, and a list of results in the main center area."^^xsd:string ; 24 + rdfs:comment "A complex element with a tree of log event classes in the upper left corner, a search form in the upper center area, and a grid of results in the main center area."^^xsd:string ;
25 rdfs:label "Log browser"^^xsd:string ; 25 rdfs:label "Log browser"^^xsd:string ;
26 rdfs:subClassOf ui:Element ; 26 rdfs:subClassOf ui:Element ;
27 ui:prototype 27 ui:prototype
28 [ rdf:type html:Div ; 28 [ rdf:type html:Div ;
29 - html:style "width:950px"^^xsd:string ; 29 + html:style "width:900px"^^xsd:string ;
30 ui:child 30 ui:child
31 [ rdf:type app:VSplitLayout ; 31 [ rdf:type app:VSplitLayout ;
32 - arg:height "600px"^^xsd:string ; 32 + arg:height "500px"^^xsd:string ;
33 arg:topHeight "30%"^^xsd:string ; 33 arg:topHeight "30%"^^xsd:string ;
34 ui:child 34 ui:child
35 + [ rdf:type ui:setContext ;
36 + ui:child
35 [ rdf:type app:HSplitLayout ; 37 [ rdf:type app:HSplitLayout ;
36 arg:height "200px"^^xsd:string ; 38 arg:height "200px"^^xsd:string ;
37 ui:child 39 ui:child
...@@ -42,8 +44,6 @@ log:LogBrowser ...@@ -42,8 +44,6 @@ log:LogBrowser
42 ui:childIndex 0 44 ui:childIndex 0
43 ] ; 45 ] ;
44 ui:child 46 ui:child
45 - [ rdf:type ui:setContext ;
46 - ui:child
47 [ rdf:type app:Tree ; 47 [ rdf:type app:Tree ;
48 arg:dataProvider log:LogEventClassTreeDataProvider ; 48 arg:dataProvider log:LogEventClassTreeDataProvider ;
49 arg:id "classTree"^^xsd:string ; 49 arg:id "classTree"^^xsd:string ;
...@@ -53,12 +53,10 @@ log:LogBrowser ...@@ -53,12 +53,10 @@ log:LogBrowser
53 arg:oldElementId "searchForm" ; 53 arg:oldElementId "searchForm" ;
54 arg:resourceTypeCode 54 arg:resourceTypeCode
55 "resource" ; 55 "resource" ;
56 - arg:resultsId "results" 56 + arg:resultsId "results" ;
57 - ] ; 57 + arg:schemaGraph <http://www.reportinghub.no/system/schema/logging>
58 - ui:childIndex 0
59 ] ; 58 ] ;
60 - ui:childIndex 1 ; 59 + ui:childIndex 1
61 - ui:queryGraph <http://www.reportinghub.no/system/schema/logging>
62 ] ; 60 ] ;
63 ui:childIndex 0 61 ui:childIndex 0
64 ] ; 62 ] ;
...@@ -71,12 +69,16 @@ log:LogBrowser ...@@ -71,12 +69,16 @@ log:LogBrowser
71 arg:noBorder "true"^^xsd:boolean ; 69 arg:noBorder "true"^^xsd:boolean ;
72 arg:resourceType log:LogEvent ; 70 arg:resourceType log:LogEvent ;
73 arg:resultsId "results"^^xsd:string ; 71 arg:resultsId "results"^^xsd:string ;
72 + arg:schemaGraph <http://www.reportinghub.no/system/schema/logging> ;
74 ui:childIndex 0 73 ui:childIndex 0
75 ] ; 74 ] ;
76 ui:childIndex 1 75 ui:childIndex 1
77 ] ; 76 ] ;
78 ui:childIndex 0 77 ui:childIndex 0
79 ] ; 78 ] ;
79 + ui:childIndex 0 ;
80 + ui:queryGraph <http://www.reportinghub.no/system/schema/logging>
81 + ] ;
80 ui:child 82 ui:child
81 [ rdf:type html:Div ; 83 [ rdf:type html:Div ;
82 ui:child 84 ui:child
......