On 10/03/2017 19:42, Ilya Ushakov wrote:
I am trying to implement sparqlmotion script that exports taxonomy to
RDF format (see sparqlMOtionGraph.png file in attachment).
I added an optional parameter nodeURI.
In sml:BranchByAsk module (IsExportAllTaxonomy box on
sparqlMOtionGraph.png) I determine if this parameter is empty, the
next step should be sml:ApplyConstruct module and sml:PerformUpdate
module in vice versa case (the code of that see in BranchByAsk.png in
attachemt).
The problem is that regardless of the value of the parameter nodeURI
the next step is always sml:PerformUpdate.
I don't see anything obvious in the script that looks like an error. If
you are indeed calling the service with no argument for nodeURI then the
ASK should branch into the Else case. So it depends on the service call
- what does the URL look like when you call it?
Moreover, I added
BIND (smf:trace("INFO: nodeURI {?1}", ?nodeURI) AS ?dummy) .
to the sml:askQuery of sml:BranchByAsk, but i see nothing in the
tomcat logs.
I assume you have tried running the service within TBC-ME first. You
should see the trace in the Error Log. That would be the first step to
determine if the step is called at all. On tomcat, smf:trace creates an
Info-level message - did you examine all the usual places where such
output could go to? And which version are you on, in case we need to
reproduce this here?
So, my questions are:
1. What i did wrong?
2. Inside of the sml:PerformUpdate module i need to execute update
script (add skos:hasTopConcept relation to exported taxonomy). As far
as I understand I should use sml:PerformUpdate (I added draft version
of sml:updateCode please see it in PerformUpdate.png file ).
so,
2.1. What is the best practice of building a temporal graph for update
inside sparqlmotion technology?
You can use sml:ApplyConstruct to produce a temp graph. Unlike
ui:tempGraph, such temp graphs cannot be updated further, so you'd
either need to create all its triples in a single CONSTRUCT query, or
chain multiple ApplyConstructs together, adding to ?s ?p ?o from the
previous step.
2.2. Must I use sml:applyQuery module for construct tempgraph from
item 2.1 first. If, yes how can i pass built graph from
sml:ApplyConstructmodule to sml:PerformUpdate?
2.3. Is it possible to use ui namespace (ui:tempGraph, ui:transaction
etc) inside sparqlmotion or i need to use swp technology for my case?
I think in general you may be better off with SWP instead of SM for this
scenario. SWP has better support for temp graphs and IMHO a more
maintainable syntax for if-then-else branching. If you do this, the only
thing to figure out is how to simulate the last step of your script,
which seems to be sml:ReturnRDF. For TTL output, this is simple - just
use ui:return:
returnRDF:ReturnTTL
rdf:type ui:Service ;
ui:prototype """
<ui:setContext ui:queryGraph=\"{=
<http://topbraid.org/examples/kennedys> }\">
<ui:return/>
</ui:setContext>
"""^^ui:Literal ;
ui:responseType ui:Turtle ;
rdfs:subClassOf ui:Services .
For the other serializations, you would need to define separate services
with different mime types, and ui:return would need to be substituted
with the SPARQL function smf:convertRDFToText(). Which other
serializations do you need?
(If you anticipate this will require more interactions with TQ
personnel, please use the TQ support email address instead of the public
mailing list, and provide an executable scenario so that we can
reproduce the issues).
Thanks,
Holger
--
You received this message because you are subscribed to the Google Group "TopBraid
Suite Users", the topics of which include the TopBraid Suite family of products and
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [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].
For more options, visit https://groups.google.com/d/optout.