I am writing a sparqlmotion script that processes services requests
stored in a d2rq-exposed relational database.  The script constructs a
series of triples that assigns search terms to the service request
based upon data attached to the request within the relational
database.  The net result of the sparqlmotion script will be to
generate 2 rdf data sets: (1) an rdf file containing the triples
associating the identified search terms to the service request and (2)
an rdf file containing the distinct list of identified search terms so
that they can be categorized into an existing skos-based taxonomy of
search terms.  The taxonomy represents search terms that have been
identified across a number of data sources.

I originally wrote the sparqlmotion script to import both the d2rq
data source as well as the search term taxonomy and then execute a
series of sparql construct statements to create the desired triples.
However, I noticed an interesting behavior during the script execution
in that the script was executing queries against the d2rq source for
the taxonomy search terms (which exist in the taxonomy source and NOT
the d2rq source).  I then modified the sparql construct statements in
the script to use named graphs so that it would only "sparql" into
each source based upon the data I know exists in that source (i.e.
when querying for existing search terms, I specify the taxonomy source
as the named graph; when querying for terms used on a service request,
I use the d2rq source as the named graph).  This greatly improved the
performance of the sparqlmotion script, which begged the following
questions:

- Do I need to use the "smf:ImportRDF..." modules at all?
- What is the difference in behavior of the smf:import modules as
compared to simply referencing a named graph?
- Am I adding (or eliminating) any overhead or additional processing
by only using the named graphs?

I actually test this out by removing all of the smf:Import... modules
from the script; the script simply starts off by executing the
ApplyConstruct modules that utilized the named graphs and it appears
to have worked just fine and performed better.

Along the same lines ... when I find a new search term that I've not
seen before, I need to write into the taxonomy under an existing
concept in the taxonomy called "Unassigned". Can I write these new
terms into the taxonomy using "INSERT INTO <graph>"?  If so, will any
newly inserted term be available when I sparql back into that data
source later in the sparqlmotion script?  My line of thinking for the
writing of the data is similar to the questions above: is it okay (or
even better) to write the triples into my desired graphs using the
INSERT statement rather than generating the 2 separate sets of triples
and than having to use some sort of a FILTER BY CONSTRUCT statement
before using an "smf:export..." module to write the result sets to
their separate graphs.

Thanks for your assistance!

Phil

-- 
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