Holger,
Thanks (to you and Scott) for all the info. At this point I've got a
few use cases that I've been exploring, and was mostly curious about
general capabilities and what my options were. The answers you gave me
should give me enough to go on.
One additional question though. Can you access multiple endpoints
within a single construct query with the new Service keyword? One case
I was exploring involved retrieving some triples from a remote
endpoint, and running a local spin function against the results. For
example, can I define a single construct query that retrieves a
birthday from the endpoint, and converts it to an age through a spin
function? Something similar to the following:
CONSTRUCT {
?bpers a simple:BasicPerson .
?bpers simple:birthyear ?year .
}
WHERE {
SERVICE <http://my.remote.org/rmtsvc> {
?bpers a rmt:Person .
?bpers rmt:birthdate ?bdate .
}
LET (?byear := smf:getBirthYear(?bdate)) .
}
I couldn't find a clean way to do anything like this in v3.1.1 due to
the use of "from" to denote the SPARQL endpoint.
Thanks again,
Ray
On Wed, Nov 11, 2009 at 4:28 PM, Holger Knublauch
<[email protected]> wrote:
>
> Hi Ray,
>
>> Hi. I've been experimenting with SPARQL Motion and SPIN and have a
>> couple of questions. Fyi, I'm using TopBraid ME v3.1.1.
>>
>> - Can you access a SPARQL endpoint from within a SPIN rule? For
>> example, consider a BasicPerson class with first name and last name
>> properties. Is it possible to define a SPIN rule for this class that
>> creates a birthday property from a remote SPARQL endpoint?
>
> Yes, this can be done, but it requires TBC 3.2.0. The SPARQL engine
> that we use supports a keyword called SERVICE, which can be used to
> issue a remote query against a SPARQL end point.
>
> http://jena.sourceforge.net/ARQ/service.html
>
> This is extremely powerful because it allows SPIN rules to access
> almost any remote data source, as long as it is exposed through a
> SPARQL end point.
>
>>
>> - Building on the question above. Is it possible to reference
>> variables defined in a SPARQL motion script within a SPIN rule? For
>> example, can I provide the address of the endpoint as an argument when
>> I perform inferencing from a SPARQL Motion script? As another example,
>> can I have a rule that creates a birthday property only when the
>> user's last name begins some user specified value (established in the
>> SPARQL Motion script).
>
> If you are in a SPARQLMotion script that executes SPIN rules via
> sml:ApplyTopSPIN, then the only way to communicate with the SPIN rules
> is via triples. In other words, your script can add or delete triples
> (e.g. via sml:ApplyConstruct) and the rules would then look for those
> triples at execution time. But it's hard to give general advice here
> without seeing your use case. Maybe it would be better to wrap your
> SPARQLMotion scripts into user-defined SPIN functions and then invoke
> the SM functions as part of a SPIN rule.
>
> For an example of this, have a look at
>
>
> http://composing-the-semantic-web.blogspot.com/2009/09/currency-conversion-with-units-ontology.html
>
>
>>
>> - It seems that you can encode the similar types of operations as SPIN
>> rules or as SPARQL Motion construct statements. The main differences
>> are when the processing takes place and what you do with the results.
>> With SPIN the inferred triples are generated when inferencing is
>> performed, and the results wind up in your in memory model. As new
>> triples are added to the in memory model, the rule may be run against
>> the new triples. When using SPARQL Motion, the triples are generated
>> only when the script is explicitly executed, and are available for
>> further manipulation, or export into a variety of forms (RDF, etc).
>> Are there any other significant differences to be aware of? Is
>> performance between the two roughly the same or is one faster/more
>> efficient than the other (assuming I'm working with a relatively
>> static set of instance data)?
>
> In general SPARQLMotion is more powerful because it has all those
> features to import, process and export data. However, if you have the
> choice between a complex (SM) and simple (SPIN) solution, then I
> recommend using SPIN only. As shown above, you can extend SPIN using
> SPARQLMotion, to add the missing bits. The two of them can be mixed
> and matched arbitrarily. If you can provide details about your task we
> can give more detailed advice.
>
> Thanks
> Holger
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
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-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---