Hi Steve,

it depends on how you invoke this. In order to have it appear in a browser, you need to wrap the script into a SPARQLMotion function, as shown in the attached file. Then call it using

http://localhost:8083/tbl/sparqlmotion?id=returnSPARQLTest:Function_1

If you just execute the module from the graph view in TBC, the result will be displayed in a TBC window.

HTH
Holger


On 24/08/2017 4:45, Steve Ray (CMU) wrote:

Hi,

I have a SPARQLMotion script that runs fine, which ends with sml:ReturnText. I can invoke it from a browser using the SPARQL endpoint at localhost and it indeed sends me back the text string that is hard-coded in the sml:ReturnText module.

I made a very similar script that differs only in that it ends with sml:ReturnSPARQLResults, where I was hoping/expecting that when invoking it, I would get a JSON-serialized result of a SELECT query where I am requesting the value of three variables. When I run it, the three variables show up in a TBC pane, but I’m not getting the results at the browser. Am I thinking of this wrong?

- Steve

Steven R. Ray, Ph.D.

Distinguished Research Fellow

Carnegie Mellon University

NASA Research Park

Building 23 (MS 23-11)

P.O. Box 1
Moffett Field, CA 94305-0001

Email: [email protected]

Phone: (650) 587-3780

Cell: (202) 316-6481

Skype: steverayconsulting

cid:[email protected]

--
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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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.
# baseURI: http://example.org/returnSPARQLTest
# imports: http://topbraid.org/sparqlmotionfunctions
# imports: http://topbraid.org/sparqlmotionlib-tbc
# prefix: returnSPARQLTest

@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#> .
@prefix returnSPARQLTest: <http://example.org/returnSPARQLTest#> .
@prefix sm: <http://topbraid.org/sparqlmotion#> .
@prefix sml: <http://topbraid.org/sparqlmotionlib#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/returnSPARQLTest>
  rdf:type owl:Ontology ;
  owl:imports <http://topbraid.org/sparqlmotionfunctions> ;
  owl:imports <http://topbraid.org/sparqlmotionlib-tbc> ;
  owl:versionInfo "Created with TopBraid Composer" ;
.
returnSPARQLTest:Function_1
  rdf:type sm:Function ;
  sm:returnModule returnSPARQLTest:Function_1_Return ;
  rdfs:subClassOf sm:Functions ;
.
returnSPARQLTest:Function_1_Return
  rdf:type sml:ReturnSPARQLResults ;
  sml:selectQuery [
      rdf:type sp:Select ;
      sp:where (
          [
            rdf:type sp:Bind ;
            sp:expression [
                rdf:type sp:now ;
              ] ;
            sp:variable [
                sp:varName "time" ;
              ] ;
          ]
        ) ;
    ] ;
  sml:serialization sm:JSON ;
.

Reply via email to