John; You should be able to just define the variable for graph.  Using
the kennedysSPIN example, if you change the age rule as follows, the
triples will be inserted into the graph named in the binding to the ?
myg variable:

INSERT
{    GRAPH ?myg
     {   ?this kspin:age ?age .
     } .
}
WHERE
{    ?this kennedys:birthYear ?birthYear .
    BIND (kspin:getCurrentYear() AS ?currentYear) .
    BIND ((?currentYear - ?birthYear) AS ?age) .
    BIND (<http://support.tq.com/unnamed> AS ?myg) .
}

It should work the same for you, and if not let us know what issues
you have.

An alternative strategy, which could be more flexible is to call
TopSPIN in a SPARQLMotion script.  Set replace=true in
sml:ApplyTopSPIN so the triple stream has only the triples created by
TopSPIN.  Then you can use a PerformUpdate to insert the data to any
graph you need.

-- Scott

On Sep 3, 3:43 pm, John Perdoni <johnperd...@gmail.com> wrote:
> Hello all,
>
> Apologies if this is just lack of Sparql knowledge.
>
> I have a spin:rule
>
> CONSTRUCT {
>     ?uri a ?classToBePop .
>     ?uri rdfs:label ?def .}
>
> WHERE {
>     ?this coreModel:isDefinitionFor ?def .
>     ?this publishedBooks:parentBookClassificationType ?type .
>     ?type rdfs:label ?typeLbl .
>     BIND (UCASE(?typeLbl) AS ?typeLblUCase) .
>     ?class rdfs:subClassOf definition_master:Definition .
>     ?class rdfs:label ?classLbl .
>     BIND (UCASE(?classLbl) AS ?classLblUCase) .
>     BIND (smf:if((?classLblUCase = ?typeLblUCase), ?class) AS
> ?classToBePop) .
>     FILTER bound(?classToBePop) .
>     BIND (afn:namespace(?classToBePop) AS ?nameSpace) .
>     BIND (smf:buildURI("{?nameSpace}{?def}") AS ?uri) .
>
> }
>
> But what i want to do is populate another graph with these results, I can
> sucessfully do this by changing the above to something like
>
> INSERT {
>     GRAPH <http://quadBooks.com/definition_master/electrical> {
>         ?uri a ?classToBePop .
>         ?uri rdfs:label ?def .
>     } .}
>
> WHERE {
>    .............................(as above)
>
> }
>
> The ?uri variable is built from a combination of queries (if thats the
> right terminology) from two separate graphs and works but the data
> "inserted" is inserted into the default graph or via the GRAPH
> <http://quadBooks.com/definition_master/electrical> statememt, so my
> queston is this
>
> How do make the GRAPH statement a variable ie INSERT INTO ?graph{...} WHERE
> GRAPH ?graph{...} where ?graph is ?namespace without the #
>
> Ive searched the group and the closest I can come up with is this 
> questionhttps://groups.google.com/forum/?fromgroups=#!searchin/topbraid-users...
> which has a solution but for spaql motion which i dont particulary want to
> have to import in this model, although I use it elsewhere.
>
> Regards and thanks again for the above board support
>
> John

-- 
-- 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 Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbraid-users@googlegroups.com
To unsubscribe from this group, send email to
topbraid-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en


Reply via email to