Scott, I have tried this a few ways

 PerformUpdate ---> ApplyTopSpin (sml:predicate = spin:constructor,
sml:replace = false, sml:singlePass = false)
 ApplyConstruct(sml:replace=true) ---> ApplyTopSpin (sml:predicate =
spin:constructor, sml:replace = false, sml:singlePass = false)
-->PerformUpdate

The constructor does not get triggered on these. If the constructor feature
does not trigger from ApplyTopSPIN, then I will move the constructors into
the sparql-motion scripts.

Regards
Arthur

This is the construct query on the ApplyConstruct variant

*CONSTRUCT* {

    ?newProject a <
http://www.objectreservoir.com/owl/2010/02/22/project#WellPhase1Project> .

    ?newProject rdfs:label ?projectLabel .

    ?selectedResource well:projects ?newProject .

}

*WHERE* {

    *LET* (?wellName := afn:localname(?selectedResource)) .

    *LET* (?ns := afn:namespace(?selectedResource)) .

    *LET* (?newProject := smf:buildURI("{?ns}{?wellName}_Phase_1_Project"))
.

    ?selectedResource rdfs:label ?wellLabel .

    *LET* (?projectLabel := fn:concat(?wellLabel, " Phase 1 Project")) .

}

Here is the Constructor

*CONSTRUCT* {

    _:b0 a :AcquireData .

    *?this* :tasks _:b0 .

    _:b1 a :ImportData .

    _:b0 :nextTask _:b1 .

    *?this* :tasks _:b1 .

    _:b2 a :CleanupData .

    _:b1 :nextTask _:b2 .

    *?this* :tasks _:b2 .

    _:b3 a :PromoteToReady .

    _:b2 :nextTask _:b3 .

    *?this* :tasks _:b3 .

    _:b4 a :Task_Perform_Diagnostics .

    _:b3 :nextTask _:b4 .

    *?this* :tasks _:b4 .

    _:b5 a :Task_LPPM_Fit .

    _:b4 :nextTask _:b5 .

    *?this* :tasks _:b5 .

    _:b6 a :Task_Develop_Stochastics .

    _:b5 :nextTask _:b6 .

    *?this* :tasks _:b6 .

    _:b7 a :Task_LPPM_Forecast .

    _:b6 :nextTask _:b7 .

    *?this* :tasks _:b7 .

    _:b8 a :Task_Analytics_Report .

    _:b7 :nextTask _:b8 .

    *?this* :tasks _:b8 .

    _:b9 a :ExportData .

    _:b2 :nextTask _:b9 .

    *?this* :tasks _:b9 .

}

*WHERE* {

}


This is the insert query on the PerformUpdate variant

*INSERT* *INTO* <http://tb-session> {

    ?newProject a <
http://www.objectreservoir.com/owl/2010/02/22/project#WellPhase1Project> .

    ?newProject rdfs:label ?projectLabel .

    ?selectedResource well:projects ?newProject .

}

*WHERE* {

    *LET* (?wellName := afn:localname(?selectedResource)) .

    *LET* (?ns := afn:namespace(?selectedResource)) .

    *LET* (?newProject := smf:buildURI("{?ns}{?wellName}_Phase_1_Project"))
.

    ?selectedResource rdfs:label ?wellLabel .

    *LET* (?projectLabel := fn:concat(?wellLabel, " Phase 1 Project")) .

}

On Wed, May 26, 2010 at 10:38 PM, Scott Henninger <
[email protected]> wrote:

> Arthur; Is there a specific event you want to trigger a constructor
> on?  If it is when a triple is created by a ApplyConstruct that has a
> rdf:type as the property, then you'll need to pass all of those
> triples to TopSPIN running on spin:constructor.  So you'd have an
> ApplyConstuct with replace=true with the query:
>
> CONSTRUCT {?uri rdf:type ?value}
> WHERE { ... }
>
> and sm:next is ApplyTopSPIN with sml:predicate set to
> spin:constructor.
>
> -- Scott
>
> On May 26, 5:42 pm, Arthur Keen <[email protected]> wrote:
> > I had tried running topspin on spin:constructor to see if it would work
> like
> > a spin:rule, but it did not trigger the constructor.
> > Thanks
> > Arthur
> >
> > On Wed, May 26, 2010 at 5:23 PM, Scott Henninger <
> [email protected]
> >
> > > wrote:
> > > <Is there a way to ensure the constructors
> > > > trigger when creating instances in sparqlmotion?>
> >
> > > Yes, you can run TopSPIN on the property spin:constructor.  Composer
> > > has specific triggers to run the constructors, and you need to tell
> > > the SPARQLMotion script when it should be executed.
> >
> > > -- Scott
> >
> > > On May 26, 4:58 pm, Arthur Keen <[email protected]> wrote:
> > > > I have a sparqlmotion script that creates instances of owl:class
> Project.
> > > >  Project and Tasve has a spin:constructor for creating a default task
> > > > network and assigning it to Project.  When I create a project using
> the
> > > > Composer instance form, the task network gets created and bound to
> the
> > > > project instance, however, when I use the sparqlmotion script, the
> > > > constructors do not trigger.  Is there a way to ensure the
> constructors
> > > > trigger when creating instances in sparqlmotion?
> >
> > > > Thanks
> > > > Arthur
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Group "TopBraid Suite Users", the topics of which include TopBraid
> > > Composer,
> > > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> > > To post to this group, send email to
> > > [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<topbraid-users%[email protected]>
> <topbraid-users%[email protected]<topbraid-users%[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
> Group "TopBraid Suite Users", the topics of which include TopBraid
> Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]<topbraid-users%[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
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion 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

Reply via email to