How to get path variable ?graph in ui:Services? [SWP]

32 views
Skip to first unread message

Elise Lustenhouwer

unread,
Aug 23, 2019, 7:06:24 AM8/23/19
to TopBraid Suite Users
For an SWP website I try to set the query graph with a path variable in the URL. For the ui:Element defined in the same URL (viewClass=) there is no problem, but for ui:Element subclasses and ui:Services classes indirectly involved in loading parts of the webpage it is. E.g. when a ui:Service class is called by a JavaScript.

I tried two different ways of solving this problem, but with no avail.

Solution 1 I tried:
Use a JavaScript which interacts with a ui:Service (subClass of ui:JSONServices) to collect all the URL path variables  In the JSON service there is a SPARQL query which needs to search (ui:setcontext) in a graph defined in the URL (&graph= variable) of the specific page. 

Solution 2 I tried:
Set a global var for ?graph in the viewClass to use in the other classes their querycontext. But it seems the globalVar doesn.t 'live' long enough. The variable isn't bound anymore.

Is there any other way or maybe I do something wrong in one of the mentioned solutions?

Best regards, Elise

Lieke Verhelst

unread,
Aug 30, 2019, 11:17:52 AM8/30/19
to TopBraid Suite Users
Has this post reached you at all? My colleague Elise experienced email bouncing from this group when she posted this message, so maybe you have not seen it..?
Thanks, Lieke

Richard Cyganiak

unread,
Aug 30, 2019, 12:37:48 PM8/30/19
to topbraid-users list
The post has reached the list. Personally I had trouble understanding the question and was hoping somebody else would answer. An example might help.

Richard


--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/53abd84d-f86b-42c0-93d8-852dff6d0488%40googlegroups.com.

Elise Lustenhouwer

unread,
Sep 6, 2019, 5:46:50 AM9/6/19
to TopBraid Suite Users
Thank you, Richard, apologies that it has not been clear.
We are building a webinterface with SWP on top of a series of graphs. Some graphs contain the content that must be published, other graphs deliver parts of the design of the webpage. The main engine behind this is one ui.ttlx file (this we call the plugin) with additional JavaScript.​
The aim is to make this all as configurable as possible in order to develop a framework for publication of graph content. ​
The end user needs to call the webinterface with a URL like this (entries between <> are configurable) http://servername.com/edg/tbl?swp_viewClass=<instance-of-ui:Element>&graph=<urn:x-evn-master:name-of-querygraph>​
that consists of:​
a ui:Element that is the main container of the plugin​
a graph variabele that is the query graph context (ui:setContext ui:queryGraph) of the web design
The values for ui:Element and graph variable that are specified in the URL are passed on to parts in the HTML page that is created following the call. This works fine. 
At the end of the page load a JavaScript is triggered by the function document.addEventListener('DOMContentLoaded'). This JS needs the value of the ui:queryGraph but -here comes the problem- the value of graph variable is not contained and can not be passed onto the JS. ​
What is the method for passing the graph variable declared in the URL to JS and between SWP and JS (both ways)?
Reply all
Reply to author
Forward
0 new messages