Hi Irene,

   You already understood what I am trying to do.

   I have already created a save script like you mention, however my
difficult as you probably know is to identify which triples from the
tb-session should go into that graph. I also have created a Script
that removes the triples from a particular file, in this way I can
leave just the created triples to be saved.

  All scripts make use of a class that stores all the BaseURI and File
name of the triples loaded.

  Unfortunately, even removing the triples from the base Graph and the
meta-model, the output file has still many triples that are not
relevant.

  I am trying to solve this problem by querying only all triples that
are instantiation of the data model (eg. query below), however I am
afraid I can miss some triples. Is there any default ways of querying
this?


SELECT DISTINCT ?subject ?predicate ?object
WHERE {{
 ?subject ?predicate ?object.
 {
 SELECT ?predicate
    WHERE {
     ?subject ?predicate ?object .
     LET (?suri := afn:namespace (?predicate) )
     FILTER (?suri ="Meta-model")
}}
}
 UNION
{
 { ?subject ?predicate ?object.
 {
SELECT ?subject
WHERE {
   ?subject rdf:type ?object .
   LET (?suri := afn:namespace (?object) )
   FILTER (?suri ="Meta-model")
}}}
}
}

 I will let you know how it goes.

Thanks,
Guil


On Apr 10, 1:42 pm, "Irene Polikoff" <[email protected]> wrote:
> Hi Guil,
>
> If you insert into tb-session, new triples will go into the graph your
> application is working with, similarly to how any new triples you add when
> editing in TBC will go into the current model. When you edit in TBE, all new
> triples will go into tb-session and on save will be written into the graph
> the app works with.
>
> You could insert triples into some other graph, but then you need to specify
> the graph  you want to insert to instead of using tb-session.
>
> What I think you may need to do is to keep your SM script and continue
> inserting into tb-session as you "load" the graph you intend to edit, then
> on save, save into the graph you have loaded. To do so, you need to create a
> custom save script instead of using the standard save button. But you would
> need to figure out which triples from the tb-session should go into that
> graph. I suppose these would be all triples that do not exist in the data
> graph the application is working with - your metamodel graph. You would also
> need to somehow keep the information that identifies which graph was loaded.
> This is just an idea, you need to try out to see how well it will work.
>
> Regards,
>
> Irene Polikoff
>
> -----Original Message-----
> From: [email protected]
>
> [mailto:[email protected]] On Behalf Of Guilherme Scomparim
> Sent: Saturday, April 09, 2011 10:57 PM
> To: TopBraid Suite Users
> Subject: [topbraid-users] Re: Help withhttp://tb-sessionusing Ensemble and
> SPARQL Motion Scripts
>
> Hi Scott,
>
> Thank you for your email but I am still not able to make this work
>
> When I open a Data Graph in Ensemble and then import any baseURI via a
> SPARQL Motion script using sml:ImportRDFFromWorkspace or/and then
> create another triples using Ensemble, it seams that all the imported
> triples or any new Triple I create are in the same smf:definedIn URI
> that is the Ensemble Data Graph I am using.
>
> I can see this pattern  by running queries in Ensemble and also in
> composer when debugging the script, however when I import the files in
> Composer using the imports Tab the smf:definedIn(?s) works fine.
>
> Any other thing I could try?
>
> Am I using Ensemble properly?
>
> Thanks in advance,
> Guil
>
> On Apr 8, 1:02 am, Scott Henninger <[email protected]> wrote:
> > Guil; you can use smf:definedIn() to find where a triple is defined.
> > E.g.:
> >   LET (?x := smf:definedIn(?s))
>
> > The triples view will display triples in the data store currently
> > loaded in Composer.  Since <http://tb-session> is the session graph, I
> > don't believe there is a way to view it in the Triples view.  If you
> > save the session graph to a file, the triples in the session are then
> > defined in that file/data store.  You could explicitly introduce
> > owl:imports statements, if that is useful to you.
>
> > -- Scott
>
> > On Apr 7, 6:02 am, Guilherme Scomparim <[email protected]> wrote:
>
> > > Hi All,
>
> > >    I have build an Ensemble Application that is a Framework tool used
> > > to build different business domain vocabulary models based on an
> > > imported meta-model. The new models are then saved in different files
> > > with a defined base URI using SPARQL Motion scripts keeping the open
> > > data graph empty because I disabled the save button.
>
> > >    This application has also a SPARQL Motion script that imports
> > > models previously saved (using sml:ImportRDFFromWorkspace) and then
> > > inserts them in thehttp://tb-session(usingsml:PerformUpdatewith
> > > the sml:updatequery below) to be able to manipulate the data in
> > > Ensemble.
>
> > > MODIFY GRAPH <http://tb-session>
> > > DELETE  {}
>
> > > INSERT  {
> > >     ?s ?p ?o .}
>
> > > WHERE {
> > >     ?s ?p ?o .
>
> > > }
>
> > >    After the files are imported, the user can add definitions and
> > > create the junctions between the imported models. Later I want to be
> > > able to save only the new triples and junctions in a broader domain
> > > vocabulary URI (File) without changing the imported models.
>
> > >   Using SPARQL Motion How can I identify triples that have been
> > > imported inside <http://tb-session> from a particular file with a
> > > particular domain base URI and also how to search the new created
> > > triples to save in a different file (Base URI).
>
> > >  I have tried all the methods below with lots of different query
> > > combinations and I have not being able to understand how to deal with
> > > different files and new triples in the <http://tb-session>
>
> > >  sml:FilterByFilterGraph
>
> > > ?s  ?p ?o
>
> > > ?baseURI
>
> > > WHERE {
> > >     ?o a owl:Ontology .
> > >     ?o ?p ?s .
>
> > > }
>
> > > SELECT ?subject ?predicate ?object
> > > WHERE {
> > >     ?arg1 tops:definesStatements ( ?subject ?predicate ?object ) .
>
> > > }
>
> > > I also cannot see the imported files separated in the Triples View, Is
> > > there a way to insert the imported files as a separate URI in the
> > > Triples view?
>
> > > Thanks in advance,
>
> > > Guil
>
> --
> 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 
> athttp://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