Holger Knublauch

EPIM search progress

......@@ -9,6 +9,7 @@
@prefix html: <http://uispin.org/html#> .
@prefix let: <http://uispin.org/let#> .
@prefix letrs: <http://uispin.org/letrs#> .
@prefix list: <http://jena.hpl.hp.com/ARQ/list#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
......@@ -1324,7 +1325,6 @@ app:FormHeader
ui:prototype
[ rdf:type html:Div ;
html:class "appHeader"^^xsd:string ;
html:id "content"^^xsd:string ;
let:type
[ rdf:type app:resourceType ;
arg:resource
......@@ -3695,6 +3695,13 @@ app:SearchForm
spl:predicate arg:resultsId ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
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 ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:schemaGraph ;
spl:valueType owl:Ontology
] ;
ui:prototype
[ rdf:type ui:setContext ;
let:fid [ rdf:type sp:if ;
......@@ -3760,6 +3767,26 @@ app:SearchForm
ui:child
[ rdf:type ui:if ;
ui:child
[ rdf:type html:Input ;
html:name "schemaURI"^^xsd:string ;
html:type "hidden"^^xsd:string ;
html:value
[ rdf:type ui:encodeNode ;
sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
]
] ;
ui:childIndex 0
] ;
ui:childIndex 2 ;
ui:condition
[ rdf:type sp:bound ;
sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
]
]
] ;
ui:child
[ rdf:type ui:if ;
ui:child
[ rdf:type ui:forEach ;
ui:child
[ rdf:type html:Input ;
......@@ -3784,19 +3811,10 @@ app:SearchForm
sp:resultVariables ([ sp:varName "keyProperty"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:TriplePath ;
sp:object
sp:elements ([ sp:object
[ sp:varName "keyProperty"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:ModPath ;
sp:modMax -2 ;
sp:modMin 0 ;
sp:subPath rdf:rest
] ;
sp:path2 rdf:first
] ;
sp:predicate list:member ;
sp:subject
[ sp:varName "kp"^^xsd:string
]
......@@ -3805,7 +3823,7 @@ app:SearchForm
])
]
] ;
ui:childIndex 2 ;
ui:childIndex 3 ;
ui:condition
[ rdf:type sp:bound ;
sp:arg1 [ sp:varName "kp"^^xsd:string
......@@ -3822,7 +3840,7 @@ app:SearchForm
[ rdf:type app:resourceType
]
] ;
ui:childIndex 3
ui:childIndex 4
] ;
ui:child
[ rdf:type html:Div ;
......@@ -3846,7 +3864,7 @@ app:SearchForm
html:value "Search"^^xsd:string ;
ui:childIndex 0
] ;
ui:childIndex 4
ui:childIndex 5
] ;
ui:childIndex 0 ;
ui:varName "createLinkFunction"^^xsd:string ;
......@@ -6279,9 +6297,13 @@ app:createLoadSearchFormCall
[ rdf:type fn:concat ;
sp:arg1 "appLoadSearchForm('" ;
sp:arg10
[ sp:varName "sg"^^xsd:string
] ;
sp:arg11 "'" ;
sp:arg12
[ sp:varName "nb"^^xsd:string
] ;
sp:arg11 ")" ;
sp:arg13 ")" ;
sp:arg2 [ sp:varName "oldElementId"^^xsd:string
] ;
sp:arg3 "', '" ;
......@@ -6293,7 +6315,7 @@ app:createLoadSearchFormCall
sp:arg7 ", '" ;
sp:arg8 [ rdf:type ui:currentQueryGraph
] ;
sp:arg9 "'"
sp:arg9 "', '"
] ;
sp:varName "result"^^xsd:string
]) ;
......@@ -6309,6 +6331,17 @@ app:createLoadSearchFormCall
sp:variable
[ sp:varName "nb"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:coalesce ;
sp:arg1 [ sp:varName "schemaGraph"^^xsd:string
] ;
sp:arg2 [ rdf:type ui:currentQueryGraph
]
] ;
sp:variable
[ sp:varName "sg"^^xsd:string
]
])
] ;
spin:constraint
......@@ -6334,6 +6367,13 @@ app:createLoadSearchFormCall
rdfs:comment "The results id."^^xsd:string ;
spl:predicate arg:resultsId ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The schema graph."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:schemaGraph ;
spl:valueType owl:Ontology
] .
app:createNewTabLink
......@@ -6498,7 +6538,7 @@ app:keyPropertiesFunctor
app:keyPropertyVarName
rdf:type spin:Function ;
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 ;
rdfs:comment "Creates a SPARQL variable name from a property. The algorithm simply takes the qname and then replaces the ':' with '_'."^^xsd:string ;
rdfs:label "key property var name"^^xsd:string ;
rdfs:subClassOf app:Functions ;
spin:body
......@@ -6510,7 +6550,7 @@ app:keyPropertyVarName
]
] ;
sp:arg2 ":" ;
sp:arg3 "VAR_"
sp:arg3 "_"
] ;
sp:varName "result"^^xsd:string
]) ;
......@@ -6878,6 +6918,11 @@ arg:rowIndex
rdfs:label "row index"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:schemaGraph
rdf:type rdf:Property ;
rdfs:label "schema graph"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:script
rdf:type rdf:Property ;
rdfs:label "script"^^xsd:string ;
......
......@@ -148,8 +148,8 @@ a:active.appFormHeaderLink {
background-color: darkGray;
color: white;
padding-left: 4px;
padding-top: 1px;
padding-bottom: 1px;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 4px;
}
......
......@@ -186,17 +186,21 @@ function appLoadEditForm(parentId, resourceType) {
* @param resultsId the id of the element to display the search results
* @param resourceTypeURI the type of resources to search for
* @param queryGraphURI the query graph URI
* @param schemaGraphURI (optional) the URI of the schema graph
* @param noBorder (optional) to suppress the border
*/
function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphURI, noBorder) {
function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphURI, schemaGraphURI, noBorder) {
var data = {
formId: oldElementId,
resourceType: '<' + resourceTypeURI + '>',
resultsId: resultsId,
_base : '<' + queryGraphURI + '>',
_viewClass: 'app:SearchForm',
_snippet: true
_viewClass : 'app:SearchForm',
_snippet : true
};
if(schemaGraphURI) {
data.schemaGraph = '<' + schemaGraphURI + '>';
}
if(noBorder) {
data.noBorder = true;
}
......
......@@ -2,34 +2,32 @@
let:keyProperties="{= app:getKeyProperties(?type) }"
let:pagerId="{= ui:uniqueId() }"
let:tableId="{= ui:uniqueId() }">
<table id="{= ?tableId }" style="width: 100%"/>
<table id="{= ?tableId }"/>
<div id="{= ?pagerId }" />
<script>
$("#{= ?tableId }").jqGrid({
<swon:NameValuePair arg:name="url" arg:value="{= fn:concat('getSearchResults?', ?params) }" />,
<swon:NameValuePair arg:name="datatype" arg:value="json" />,
colNames:[
'Resource'
<ui:if ui:condition="{= bound(?keyProperties) }">,
<ui:if ui:condition="{= bound(?keyProperties) }">
<ui:forEach ui:resultSet="{#
SELECT ?colName
WHERE {
GRAPH ui:graph {
?keyProperties (rdf:rest*)/rdf:first ?keyProperty .
BIND (spif:titleCase(ui:label(?keyProperty) AS ?colName)) .
?keyProperties list:member ?keyProperty .
BIND (spif:titleCase(ui:label(?keyProperty)) AS ?colName) .
}
}
}" ui:separator=",">
'{= ?colName }'
</ui:forEach>
</ui:if>
<ui:else>
'Resource'
</ui:else>
],
colModel:[
{
name : 'result',
width: 200
}
<ui:if ui:condition="{= bound(?keyProperties) }">,
<ui:if ui:condition="{= bound(?keyProperties) }">
<ui:forEach ui:resultSet="{#
SELECT ?varName
WHERE {
......@@ -44,6 +42,11 @@
}
</ui:forEach>
</ui:if>
<ui:else>
{
name : 'label'
}
</ui:else>
],
rowNum: 10,
rowList:[5,10,20],
......@@ -51,7 +54,7 @@
viewrecords: true,
sortorder: "desc",
height: "100%",
width: "500"
width: "100%"
}).jqGrid('navGrid', '#{= ?pagerId }', { add:false, edit:false, del:false});
</script>
</ui:group>
\ No newline at end of file
......
......@@ -21,28 +21,28 @@
log:LogBrowser
rdf:type ui:NodeClass ;
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 ;
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 ;
rdfs:label "Log browser"^^xsd:string ;
rdfs:subClassOf ui:Element ;
ui:prototype
[ rdf:type html:Div ;
html:style "width:950px"^^xsd:string ;
html:style "width:900px"^^xsd:string ;
ui:child
[ rdf:type app:VSplitLayout ;
arg:height "600px"^^xsd:string ;
arg:height "500px"^^xsd:string ;
arg:topHeight "30%"^^xsd:string ;
ui:child
[ rdf:type app:HSplitLayout ;
arg:height "200px"^^xsd:string ;
[ rdf:type ui:setContext ;
ui:child
[ rdf:type html:Div ;
[ rdf:type app:HSplitLayout ;
arg:height "200px"^^xsd:string ;
ui:child
[ rdf:type app:Header ;
arg:label "Event Type"^^xsd:string ;
ui:childIndex 0
] ;
ui:child
[ rdf:type ui:setContext ;
[ rdf:type html:Div ;
ui:child
[ rdf:type app:Header ;
arg:label "Event Type"^^xsd:string ;
ui:childIndex 0
] ;
ui:child
[ rdf:type app:Tree ;
arg:dataProvider log:LogEventClassTreeDataProvider ;
......@@ -53,29 +53,31 @@ log:LogBrowser
arg:oldElementId "searchForm" ;
arg:resourceTypeCode
"resource" ;
arg:resultsId "results"
arg:resultsId "results" ;
arg:schemaGraph <http://www.reportinghub.no/system/schema/logging>
] ;
ui:childIndex 0
ui:childIndex 1
] ;
ui:childIndex 1 ;
ui:queryGraph <http://www.reportinghub.no/system/schema/logging>
ui:childIndex 0
] ;
ui:childIndex 0
] ;
ui:child
[ rdf:type html:Div ;
html:id "formHolder"^^xsd:string ;
ui:child
[ rdf:type app:SearchForm ;
arg:formId "searchForm"^^xsd:string ;
arg:noBorder "true"^^xsd:boolean ;
arg:resourceType log:LogEvent ;
arg:resultsId "results"^^xsd:string ;
ui:childIndex 0
[ rdf:type html:Div ;
html:id "formHolder"^^xsd:string ;
ui:child
[ rdf:type app:SearchForm ;
arg:formId "searchForm"^^xsd:string ;
arg:noBorder "true"^^xsd:boolean ;
arg:resourceType log:LogEvent ;
arg:resultsId "results"^^xsd:string ;
arg:schemaGraph <http://www.reportinghub.no/system/schema/logging> ;
ui:childIndex 0
] ;
ui:childIndex 1
] ;
ui:childIndex 1
ui:childIndex 0
] ;
ui:childIndex 0
ui:childIndex 0 ;
ui:queryGraph <http://www.reportinghub.no/system/schema/logging>
] ;
ui:child
[ rdf:type html:Div ;
......