Dejan;  A couple of other things to note with SWP files.  First is that if the ui:responseType is set to ui:JSON, then it will return a JSON mime type.

Also see swon:object and swon:Array in http://uispin.org/swon.html

Also, SWP is a text formatting templating language, so you can simply put you own JSON strings in the ui:prototype.  I.e. SWON is just a set of convenience funcitons.

In addition, you can also create a standalone .swp file that returns json and of the name ends with .json.swp it will return the JSON mime type (see Composer Help > TopBraid Composer > TopBraid Live Integration > SWP with TopBraid Live).

Between these, it seems possible to create JSON in the form you want.  And as stated the JSON version of a SPARQL Endpoint result set is supported in SPIN Template, SPARQL Endpoint, and SPARQLMotion, all out-of-the-box.

-- Scott

On 8/18/2014, 5:09 PM, Scott Henninger wrote:
Dejan, have you looked into SPIN Templates (Composer Help > TopBraid Composer > TopBraid Live Integration > SPIN Template Service), which are services for SPARQL queries can be returned as standard SPARQL result sets in JSON by setting the parameter _format to 'json'?

- Scott

On 8/18/2014, 4:33 PM, Dejan Veselinovic wrote:
As the subject states, I want to return only a single JSON object, not an array of JSON objects or a single JSON object where one of the values is another JSON object.  This has to be done from a SINGLE SPARQL query being placed within the ui:JSONServices subclass (from the documentation I read, the place to place the query is within the ui:prototype property) then defining name-value pairs.  An argument is defined; the SPARQL query gets more info on this argument.  I have read online that this can be achieved as follows: <swon:Value arg:name="Name_To_Give" arg:value="{= spl:object(?argument, schema:argumentHasRandomValue) }" />.  THIS IS NOT THE ANSWER I AM LOOKING FOR since I have never seen that in any SPARQL query leading me to believe that it is not something based on standards but something proprietary that might not work with anything but TopBraid Composer AND the same value can be obtained as follows: SELECT ?randomValue WHERE { ?argument schema:argumentHasRandomValue ?randomValue . }, the assumption being that the value only appears once is valid in my case.  I have a feeling this can be achieved by defining a property within the <swon:Object> tag but I haven't found any documentation that tells me what this property is.  Any advice?
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.


--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to