Re: [topbraid-users] SPARQLMotion IterateOnSelect examples

2019-07-24 Thread Holger Knublauch
If a magic property is not resolving, have you tried renaming its file 
to something like .spin.ttl - this should have the system register all 
SPIN functions and magic properties globally.


Holger


On 25/07/2019 04:25, Jack Hodges wrote:
I was debugging this problem with Steve and we found that the 
IterateOverSelect is not executing because it has two magic property 
calls referenced and they are not being resolved. Their graphs 'are' 
being imported, and everything in them can be seen in the 'query' tab 
in SPARQL MOTION and, even though I use their prefixes in the select 
statement, in the SM query tab they have been converted to their full 
namespaces. Interestingly, they do not resolve from their namespaces 
in that query tab, but if I retype their prefixes they do resolve and 
execute in that tab just fine. So I am confused about this and hope 
that you know what is going on and I might then move forward...I 
should add that all of the graphs that are needed are imported into 
the SM script and resolve in the imported graphs tab in SM.


Jack

On Tuesday, July 23, 2019 at 3:42:18 PM UTC-7, Holger Knublauch wrote:

I am attaching a script that looks as in the screenshot:

You need to make sure that the PerformUpdate specifies the target
graphs, using the GRAPH keyword. Otherwise it doesn't know where
the triples shall go.

The Merge step is just there as a dummy placeholder for some
module that handles the result graph.

Depending on your setup, SWP might be a better choice for such
SPARQL-based transformation scripts.

HTH
Holger


On 24/07/2019 05:40, Jack Hodges wrote:

I have a question. Does anyone have an example of an
IterateOverSelect that has a body that performs an insert on the
results of the IterateOverSelect variables?

My Intent: execute a IterateOnSelect SELECT that produces
multiple rows of several bindings, use body of IterateOnSelect to
INSERT each row

sml:selectQuery:

SELECT ?a ?b ?c
WHERE {
    something related to input argument .
}

sm:body:

INSERT {
    qname, label, and properties of qname
}
WHERE {
   something using ?a, ?b, and ?c
   create unique qname and labels
}


sm:next:

Do something with the items that were inserted by the sm:body

But the IterateOverSelect never seems to get executed (at least,
I cannot see it binding ?a, ?b, or ?c and no insertions are
performed.

The SPARQL MOTION library reference has no examples.

Thank you...

Jack
-- 
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 topbrai...@googlegroups.com .
To view this discussion on the web visit

https://groups.google.com/d/msgid/topbraid-users/87db2c97-5c2a-4b2e-8723-8e543e0ad221%40googlegroups.com

.


--
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-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/b677db84-80cb-467f-86a5-2d53093a588d%40googlegroups.com 
.


--
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/510f0838-5977-faf7-d1d0-4c0a7b018a90%40topquadrant.com.


Re: [topbraid-users] SPARQLMotion IterateOnSelect examples

2019-07-24 Thread Jack Hodges
I was debugging this problem with Steve and we found that the 
IterateOverSelect is not executing because it has two magic property calls 
referenced and they are not being resolved. Their graphs 'are' being 
imported, and everything in them can be seen in the 'query' tab in SPARQL 
MOTION and, even though I use their prefixes in the select statement, in 
the SM query tab they have been converted to their full namespaces. 
Interestingly, they do not resolve from their namespaces in that query tab, 
but if I retype their prefixes they do resolve and execute in that tab just 
fine. So I am confused about this and hope that you know what is going on 
and I might then move forward...I should add that all of the graphs that 
are needed are imported into the SM script and resolve in the imported 
graphs tab in SM.

Jack

On Tuesday, July 23, 2019 at 3:42:18 PM UTC-7, Holger Knublauch wrote:
>
> I am attaching a script that looks as in the screenshot:
>
> You need to make sure that the PerformUpdate specifies the target graphs, 
> using the GRAPH keyword. Otherwise it doesn't know where the triples shall 
> go.
>
> The Merge step is just there as a dummy placeholder for some module that 
> handles the result graph.
>
> Depending on your setup, SWP might be a better choice for such 
> SPARQL-based transformation scripts.
>
> HTH
> Holger
>
>
> On 24/07/2019 05:40, Jack Hodges wrote:
>
> I have a question. Does anyone have an example of an IterateOverSelect 
> that has a body that performs an insert on the results of the 
> IterateOverSelect variables? 
>
> My Intent: execute a IterateOnSelect SELECT that produces multiple rows of 
> several bindings, use body of IterateOnSelect to INSERT each row 
>
> sml:selectQuery:
>
> SELECT ?a ?b ?c
> WHERE {
> something related to input argument .
> }
>
> sm:body:
>
> INSERT {
> qname, label, and properties of qname
> }
> WHERE {
>something using ?a, ?b, and ?c
>create unique qname and labels
> }
>
>
> sm:next:
>
> Do something with the items that were inserted by the sm:body
>
> But the IterateOverSelect never seems to get executed (at least, I cannot 
> see it binding ?a, ?b, or ?c and no insertions are performed.
>
> The SPARQL MOTION library reference has no examples.
>
> Thank you...
>
> Jack
> -- 
> 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 topbrai...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/87db2c97-5c2a-4b2e-8723-8e543e0ad221%40googlegroups.com
>  
> 
> .
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/b677db84-80cb-467f-86a5-2d53093a588d%40googlegroups.com.


Re: [topbraid-users] SPARQLMotion IterateOnSelect examples

2019-07-23 Thread Holger Knublauch

I am attaching a script that looks as in the screenshot:

You need to make sure that the PerformUpdate specifies the target 
graphs, using the GRAPH keyword. Otherwise it doesn't know where the 
triples shall go.


The Merge step is just there as a dummy placeholder for some module that 
handles the result graph.


Depending on your setup, SWP might be a better choice for such 
SPARQL-based transformation scripts.


HTH
Holger


On 24/07/2019 05:40, Jack Hodges wrote:
I have a question. Does anyone have an example of an IterateOverSelect 
that has a body that performs an insert on the results of the 
IterateOverSelect variables?


My Intent: execute a IterateOnSelect SELECT that produces multiple 
rows of several bindings, use body of IterateOnSelect to INSERT each row


sml:selectQuery:

SELECT ?a ?b ?c
WHERE {
    something related to input argument .
}

sm:body:

INSERT {
    qname, label, and properties of qname
}
WHERE {
   something using ?a, ?b, and ?c
   create unique qname and labels
}


sm:next:

Do something with the items that were inserted by the sm:body

But the IterateOverSelect never seems to get executed (at least, I 
cannot see it binding ?a, ?b, or ?c and no insertions are performed.


The SPARQL MOTION library reference has no examples.

Thank you...

Jack
--
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-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/87db2c97-5c2a-4b2e-8723-8e543e0ad221%40googlegroups.com 
.


--
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/00944167-65ac-dab2-8c38-5b396d2d24cd%40topquadrant.com.
# baseURI: http://example.org/iterateOverInsert
# imports: http://topbraid.org/sparqlmotionfunctions
# imports: http://topbraid.org/sparqlmotionlib-tb
# prefix: iterateOverInsert

@prefix iterateOverInsert:  .
@prefix owl:  .
@prefix rdf:  .
@prefix rdfs:  .
@prefix sm:  .
@prefix sml:  .
@prefix sp:  .
@prefix spin:  .
@prefix xsd:  .


  a owl:Ontology ;
  owl:imports  ;
  owl:imports  ;
  owl:versionInfo "Created with TopBraid Composer" ;
.

  a sml:ImportRDFFromWorkspace ;
  sm:next iterateOverInsert:IterateOverSelect_1 ;
  sml:baseURI "http://topbraid.org/examples/kennedys; ;
  rdfs:label "Import kennedys.ttl" ;
.
iterateOverInsert:IterateOverSelect_1
  a sml:IterateOverSelect ;
  sm:body iterateOverInsert:PerformUpdate_1 ;
  sm:next iterateOverInsert:Merge_1 ;
  sm:nodeX 454 ;
  sm:nodeY 182 ;
  sml:selectQuery [
  a sp:Select ;
  sp:where (
  [
sp:object owl:Class ;
sp:predicate rdf:type ;
sp:subject [
sp:varName "class" ;
  ] ;
  ]
) ;
] ;
  rdfs:label "Iterate over select 1" ;
.
iterateOverInsert:Merge_1
  a sml:Merge ;
  sm:nodeX 881 ;
  sm:nodeY 221 ;
  rdfs:label "Merge 1" ;
.
iterateOverInsert:PerformUpdate_1
  a sml:PerformUpdate ;
  sm:nodeX 518 ;
  sm:nodeY 319 ;
  sml:updateQuery [
  a sp:Modify ;
  sp:insertPattern (
  [
a sp:NamedGraph ;
sp:elements (
[
  sp:object "Comment added" ;
  sp:predicate rdfs:comment ;
  sp:subject [
  sp:varName "class" ;
] ;
]
  ) ;
sp:graphNameNode  ;
  ]
) ;
  sp:where () ;
] ;
  rdfs:label "Perform update 1" ;
.


[topbraid-users] SPARQLMotion IterateOnSelect examples

2019-07-23 Thread Jack Hodges
I have a question. Does anyone have an example of an IterateOverSelect that 
has a body that performs an insert on the results of the IterateOverSelect 
variables?

My Intent: execute a IterateOnSelect SELECT that produces multiple rows of 
several bindings, use body of IterateOnSelect to INSERT each row

sml:selectQuery:

SELECT ?a ?b ?c
WHERE {
something related to input argument .
}

sm:body:

INSERT {
qname, label, and properties of qname
}
WHERE {
   something using ?a, ?b, and ?c
   create unique qname and labels
}


sm:next:

Do something with the items that were inserted by the sm:body

But the IterateOverSelect never seems to get executed (at least, I cannot 
see it binding ?a, ?b, or ?c and no insertions are performed.

The SPARQL MOTION library reference has no examples.

Thank you...

Jack

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/87db2c97-5c2a-4b2e-8723-8e543e0ad221%40googlegroups.com.