Holger Knublauch

EPIM log 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
......@@ -3685,6 +3685,13 @@ app:SearchForm
] ;
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:queryGraph ;
spl:valueType owl:Ontology
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject type to display."^^xsd:string ;
spl:predicate arg:resourceType ;
spl:valueType rdfs:Class
......@@ -3758,6 +3765,36 @@ app:SearchForm
ui:childIndex 1
] ;
ui:child
[ rdf:type html:Input ;
html:name "_base"^^xsd:string ;
html:type "hidden"^^xsd:string ;
html:value
[ rdf:type ui:encodeNode ;
sp:arg1 [ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "queryGraph"^^xsd:string
]
] ;
sp:arg2 [ sp:varName "queryGraph"^^xsd:string
] ;
sp:arg3 [ rdf:type ui:currentQueryGraph
]
]
] ;
ui:childIndex 2
] ;
ui:child
[ rdf:type html:Input ;
html:name "schema"^^xsd:string ;
html:type "hidden"^^xsd:string ;
html:value
[ rdf:type ui:encodeNode ;
sp:arg1 [ rdf:type ui:currentQueryGraph
]
] ;
ui:childIndex 3
] ;
ui:child
[ rdf:type ui:if ;
ui:child
[ rdf:type ui:forEach ;
......@@ -3784,19 +3821,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 +3833,7 @@ app:SearchForm
])
]
] ;
ui:childIndex 2 ;
ui:childIndex 4 ;
ui:condition
[ rdf:type sp:bound ;
sp:arg1 [ sp:varName "kp"^^xsd:string
......@@ -3822,7 +3850,7 @@ app:SearchForm
[ rdf:type app:resourceType
]
] ;
ui:childIndex 3
ui:childIndex 5
] ;
ui:child
[ rdf:type html:Div ;
......@@ -3846,7 +3874,7 @@ app:SearchForm
html:value "Search"^^xsd:string ;
ui:childIndex 0
] ;
ui:childIndex 4
ui:childIndex 6
] ;
ui:childIndex 0 ;
ui:varName "createLinkFunction"^^xsd:string ;
......@@ -6279,9 +6307,13 @@ app:createLoadSearchFormCall
[ rdf:type fn:concat ;
sp:arg1 "appLoadSearchForm('" ;
sp:arg10
[ rdf:type ui:currentQueryGraph
] ;
sp:arg11 "'" ;
sp:arg12
[ sp:varName "nb"^^xsd:string
] ;
sp:arg11 ")" ;
sp:arg13 ")" ;
sp:arg2 [ sp:varName "oldElementId"^^xsd:string
] ;
sp:arg3 "', '" ;
......@@ -6291,9 +6323,9 @@ app:createLoadSearchFormCall
sp:arg6 [ sp:varName "resourceTypeCode"^^xsd:string
] ;
sp:arg7 ", '" ;
sp:arg8 [ rdf:type ui:currentQueryGraph
sp:arg8 [ sp:varName "queryGraph"^^xsd:string
] ;
sp:arg9 "'"
sp:arg9 "', '"
] ;
sp:varName "result"^^xsd:string
]) ;
......@@ -6325,6 +6357,13 @@ app:createLoadSearchFormCall
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The schema graph."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:queryGraph ;
spl:valueType owl:Ontology
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "A JavaScript expression that produces the URI of the resource type. When used in a Tree, this would be 'resource', while in other cases it might be a static URI string."^^xsd:string ;
spl:predicate arg:resourceTypeCode ;
spl:valueType xsd:string
......@@ -6853,6 +6892,11 @@ arg:property
rdfs:label "property"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:queryGraph
rdf:type rdf:Property ;
rdfs:label "query graph"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:range
rdf:type rdf:Property ;
rdfs:label "range"^^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;
}
......
......@@ -185,17 +185,19 @@ function appLoadEditForm(parentId, resourceType) {
* @param oldElementId the id of the element to replace - this will be the id of the new form.
* @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 queryGraphURI the (instance) query graph URI
* @param schemaGraphURI 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
formId : oldElementId,
resourceType : '<' + resourceTypeURI + '>',
resultsId : resultsId,
queryGraph : '<' + queryGraphURI + '>',
_base : '<' + schemaGraphURI + '>',
_viewClass : 'app:SearchForm',
_snippet : true
};
if(noBorder) {
data.noBorder = true;
......@@ -211,15 +213,13 @@ function appLoadSearchForm(oldElementId, resultsId, resourceTypeURI, queryGraphU
* a given id. Will replace the content of a given target element.
* @param formId the form id
* @param targetId the target id
* @param queryGraphURI the current query graph
* @returns false
*/
function appLoadSearchResultsGrid(formId, targetId, queryGraphURI) {
function appLoadSearchResultsGrid(formId, targetId) {
var params = $('#' + formId).serialize();
var escaped = '&params=' + escape(params);
$.get(uispinServlet + '?_viewClass=app:SearchResultsGrid&_snippet=true&' +
'_base=' + escape('<' + queryGraphURI + '>') +
'&' + params + escaped, function(data) {
params + escaped, function(data) {
$('#' + targetId).html(data);
});
return false;
......
......@@ -14,7 +14,7 @@
SELECT ?colName
WHERE {
GRAPH ui:graph {
?keyProperties (rdf:rest*)/rdf:first ?keyProperty .
?keyProperties list:member ?keyProperty .
BIND (spif:titleCase(ui:label(?keyProperty)) AS ?colName) .
}
}
......@@ -32,7 +32,7 @@
SELECT ?varName
WHERE {
GRAPH ui:graph {
?keyProperties (rdf:rest*)/rdf:first ?property .
?keyProperties list:member ?property .
BIND (app:keyPropertyVarName(?property) AS ?varName) .
}
}
......
# baseURI: http://www.reportinghub.no/examples/system/exampleLogEvents
# baseURI: http://www.reportinghub.no/graph/logging
# imports: http://www.reportinghub.no/system/schema/logging
@prefix : <http://www.reportinghub.no/examples/system/exampleLogEvents#> .
@prefix : <http://www.reportinghub.no/graph/logging#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix log: <http://www.reportinghub.no/system/schema/logging#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
......@@ -11,7 +11,7 @@
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/examples/system/exampleLogEvents>
<http://www.reportinghub.no/graph/logging>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/system/schema/logging> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
......
......@@ -22,27 +22,27 @@
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 grid of results in the main center area."^^xsd:string ;
rdfs:label "Log browser"^^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 "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 ;
......@@ -51,31 +51,33 @@ log:LogBrowser
[ rdf:type app:createLoadSearchFormCall ;
arg:noBorder "true"^^xsd:boolean ;
arg:oldElementId "searchForm" ;
arg:queryGraph <http://www.reportinghub.no/graph/logging> ;
arg:resourceTypeCode
"resource" ;
arg:resultsId "results"
] ;
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:queryGraph <http://www.reportinghub.no/graph/logging> ;
arg:resourceType log:LogEvent ;
arg:resultsId "results"^^xsd:string ;
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 ;
......