changing SYNC delay on a repo

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

changing SYNC delay on a repo

Terry Rankine

Hi Guys

 

I was looking at changing the sync delay on a continuous delivery repo to see if we get any insertion performance gains.

 

How would I alter it once the repo has been created?

 

Terry


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: changing SYNC delay on a repo

Jeen Broekstra

Hi Terry,

On 12/11/13 8:20 pm, [hidden email] wrote:

> I was looking at changing the sync delay on a continuous delivery repo
> to see if we get any insertion performance gains.
>
> How would I alter it once the repo has been created?

Unfortunately, changing a Sesame repository's configuration after it's
been created is quite difficult, as there is no proper admin interface
for this. However, the repository configuration is stored as RDF in the
SYSTEM repository, so you can modify that configuration by executing one
or more cunning updates on the RDF.

To further complicate matters, a single SPARQL update query is not
possible because the SYSTEM repo uses blank nodes for contexts (which
are not allowed as named graphs in SPARQL).

I tell you in advance that the simplest way is to just create a new
repository with the correct settings, transfer your data and then drop
the old repository.

However, if that is problematic, I'll outline two ways to modify the
config: first programmatically, then manually.

Using the API, you can open a connection to the SYSTEM repository, query
for the context that contains the repository's config, and execute a
remove and add to replace the syncDelay value within its context. Here's
some (untested) code to illustrate the idea.

Repository rep = new HTTPRepository(serverURL, "SYSTEM");
rep.initialize();

RepositoryConnection conn = rep.getConnection();

// we want to set the sync delay to 300 ms.
Literal newSyncDelay = conn.getValueFactory().createLiteral("300",
XMLSCHEMA.LONG);
try {
  // query for the graph that contains the config of the repository with
  // identifier "myRepo"
  String query = "SELECT ?c WHERE {GRAPH ?c { []
<http://www.openrdf.org/config/repository#repositoryID> \"myRepo\" . } }
LIMIT 1";

TupleQueryResult tqr = conn.prepareTupleQuery(SPARQL, query).evaluate();

  if (tqr.hasNext()) {
     Resource context = (Resource)tqr.next().getValue("c");

     // get the subject of the syncDelay triple so we can update it
     Resource subject = conn.getStatements(null,
MemoryStoreConfig.SYNC_DELAY, null, true, context).next().getSubject();

     conn.begin();
     conn.remove(subject, MemoryStoreConfig.SYNC_DELAY, null, context);
     conn.add(subject, MemoryStoreConfig.SYNC_DELAY, newSyncDelay, context);
     conn.commit();

  }
}
finally {
  conn.close();
}

After executing this, you will likely need to restart the Sesame server
for the changes to take effect.

Using manual means is a bit trickier however. So here's what you do
(using Workbench):

0. backup your system. I've tried to be thorough and correct, but this
procedure is not officially recommended, on your own head be it if stuff
breaks :)

1. open the SYSTEM repository .
2. Execute the following query:

PREFIX sys: <http://www.openrdf.org/config/repository#>
PREFIX sail: <http://www.openrdf.org/config/repository/sail#>
PREFIX memory: <http://www.openrdf.org/config/sail/memory#>

SELECT ?g ?i ?d
WHERE {
    GRAPH ?g {
        ?x a sys:Repository ;
           sys:repositoryID "myRepo" ;
           sys:repositoryImpl [ sail:sailImpl ?i ] .
        OPTIONAL { ?i memory:syncDelay ?d . }
     }
}

If ?d is unbound, go directly to step 4.

3. Go to the "Remove" screen, fill in the value of ?i for the subject,
fill in <http://www.openrdf.org/config/sail/memory#syncDelay> for the
predicate, and leave object and context empty, and click the 'Remove'
button (this step deletes the old syncDelay value).

4. Go to the "Add" screen, choose "Enter the RDF data you wish to
upload", set the format to Turtle, set the Context to the value of ?g,
and in the RDF Context textbox add the following:

  _:node1 <http://www.openrdf.org/config/sail/memory#syncDelay>
"120"^^<http://www.w3.org/2001/XMLSchema#long> .

In place of _:node1 use the value of ?i from the query in step 2, and of
course modify the number 120 in the above to whatever syncDelay (in
milliseconds) you want.

5. Restart your Sesame server for the changes to take effect.


FWIW, we are looking into making this kind of thing easier.

HTH,

Jeen

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Does Sesame support SPARQL extension functions?

David Booth-2
Here's an example from the SPARQL 1.1 spec of invoking an extension
function to compute the distance between two geographic points:
http://www.w3.org/TR/sparql11-query/#extensionFunctions

     FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .

Does Sesame support SPARQL extension functions?  I haven't found any
mention of it.   And if not, does anyone know what would be involved in
extending the Sesame store to add support for them?  Ideally it would be
nice to be able to load them dynamically, using Java's dynamic class
loading.

Thanks,
David


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: Does Sesame support SPARQL extension functions?

Peter Ansell-2
Hi David,

Jeen has written a blog post about this at:

http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions/

Cheers,

Peter

On 15 November 2013 10:20, David Booth <[hidden email]> wrote:

> Here's an example from the SPARQL 1.1 spec of invoking an extension
> function to compute the distance between two geographic points:
> http://www.w3.org/TR/sparql11-query/#extensionFunctions
>
>      FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .
>
> Does Sesame support SPARQL extension functions?  I haven't found any
> mention of it.   And if not, does anyone know what would be involved in
> extending the Sesame store to add support for them?  Ideally it would be
> nice to be able to load them dynamically, using Java's dynamic class
> loading.
>
> Thanks,
> David
>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: Does Sesame support SPARQL extension functions?

David Booth-2
Awesome!  But one question: It sounds like I need to restart Sesame for
my new (or revised) extension function to be picked up.  Is that
correct?   If so, that probably wouldn't be a show-stopper for me, but
it may mean that I'd have to define a generic extension function that,
as its first argument, takes the name of an actual extension function
class that could be dynamically loaded at runtime.

Thanks!
David

On 11/14/2013 06:26 PM, Peter Ansell wrote:

> Hi David,
>
> Jeen has written a blog post about this at:
>
> http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions/
>
> Cheers,
>
> Peter
>
> On 15 November 2013 10:20, David Booth <[hidden email]> wrote:
>> Here's an example from the SPARQL 1.1 spec of invoking an extension
>> function to compute the distance between two geographic points:
>> http://www.w3.org/TR/sparql11-query/#extensionFunctions
>>
>>       FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .
>>
>> Does Sesame support SPARQL extension functions?  I haven't found any
>> mention of it.   And if not, does anyone know what would be involved in
>> extending the Sesame store to add support for them?  Ideally it would be
>> nice to be able to load them dynamically, using Java's dynamic class
>> loading.
>>
>> Thanks,
>> David
>>
>>
>> ------------------------------------------------------------------------------
>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>> Free app hosting. Or install the open source package on any LAMP server.
>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Sesame-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general
>
>
>

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: Does Sesame support SPARQL extension functions?

Peter Ansell-2
You would need to reload Sesame to pick up the new META-INF/services
files added to the classpath after the application is first loaded.

However, if you have new functions defined at runtime (say you are
implementing SPIN, for example), you can manually add functions to the
registry programmatically without META-INF/services files using
FunctionRegistry.getInstance().add(Function). The URIs defined for the
functions will still be picked up in the usual way from the
Function.getURI() method even if they don't originate from
META-INF/services files.

The way the FunctionRegistry is used in different implementations of
EvaluationStrategy has not yet been standardised though. Ie, you
cannot define a FunctionRegistry object to use for each
Query/ParsedQuery at this stage. Currently, the EvaluationStrategyImpl
from the sesame-queryalgebra-evaluation module hardcodes a reference
to FunctionRegistry.getInstance(). Feel free to suggest an improvement
for that and we can look to add it to Sesame-2.8/2.9 or the next major
version. One of the issues is that the Function interface is defined
in sesame-queryalgebra-evaluation, and that is not used by all OpenRDF
implementations, as some implement their own SPARQL engines. Both the
Function and FunctionRegistry interfaces would need to be defined in
sesame-queryalgebra-model or sesame-query to have them shared between
different Sail implementations. Note, if there is only a Repository
implementation (ie, Virtuoso) then you cannot extend the algebra using
FunctionRegistry.

It has been on my todo list to add a "rescanClasspath" method to the
Sesame service registries, but it doesn't yet have an issue on the
Jira tracker yet.

Cheers,

Peter

On 15 November 2013 10:56, David Booth <[hidden email]> wrote:

> Awesome!  But one question: It sounds like I need to restart Sesame for
> my new (or revised) extension function to be picked up.  Is that
> correct?   If so, that probably wouldn't be a show-stopper for me, but
> it may mean that I'd have to define a generic extension function that,
> as its first argument, takes the name of an actual extension function
> class that could be dynamically loaded at runtime.
>
> Thanks!
> David
>
> On 11/14/2013 06:26 PM, Peter Ansell wrote:
>> Hi David,
>>
>> Jeen has written a blog post about this at:
>>
>> http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions/
>>
>> Cheers,
>>
>> Peter
>>
>> On 15 November 2013 10:20, David Booth <[hidden email]> wrote:
>>> Here's an example from the SPARQL 1.1 spec of invoking an extension
>>> function to compute the distance between two geographic points:
>>> http://www.w3.org/TR/sparql11-query/#extensionFunctions
>>>
>>>       FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .
>>>
>>> Does Sesame support SPARQL extension functions?  I haven't found any
>>> mention of it.   And if not, does anyone know what would be involved in
>>> extending the Sesame store to add support for them?  Ideally it would be
>>> nice to be able to load them dynamically, using Java's dynamic class
>>> loading.
>>>
>>> Thanks,
>>> David
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>>> Free app hosting. Or install the open source package on any LAMP server.
>>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Sesame-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>>
>> ------------------------------------------------------------------------------
>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>> Free app hosting. Or install the open source package on any LAMP server.
>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Sesame-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>>
>>
>>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: Does Sesame support SPARQL extension functions?

David Booth-2
On 11/14/2013 07:18 PM, Peter Ansell wrote:

> You would need to reload Sesame to pick up the new META-INF/services
> files added to the classpath after the application is first loaded.
>
> However, if you have new functions defined at runtime (say you are
> implementing SPIN, for example), you can manually add functions to the
> registry programmatically without META-INF/services files using
> FunctionRegistry.getInstance().add(Function). The URIs defined for the
> functions will still be picked up in the usual way from the
> Function.getURI() method even if they don't originate from
> META-INF/services files.

Cool!

>
> The way the FunctionRegistry is used in different implementations of
> EvaluationStrategy has not yet been standardised though. Ie, you
> cannot define a FunctionRegistry object to use for each
> Query/ParsedQuery at this stage. Currently, the EvaluationStrategyImpl
> from the sesame-queryalgebra-evaluation module hardcodes a reference
> to FunctionRegistry.getInstance(). Feel free to suggest an improvement
> for that and we can look to add it to Sesame-2.8/2.9 or the next major
> version. One of the issues is that the Function interface is defined
> in sesame-queryalgebra-evaluation, and that is not used by all OpenRDF
> implementations, as some implement their own SPARQL engines. Both the
> Function and FunctionRegistry interfaces would need to be defined in
> sesame-queryalgebra-model or sesame-query to have them shared between
> different Sail implementations. Note, if there is only a Repository
> implementation (ie, Virtuoso) then you cannot extend the algebra using
> FunctionRegistry.

I'm afraid I don't know yet enough about the back end architecture to
follow all of that, but would I correct to understand this to mean that
registering an extension function using
FunctionRegistry.getInstance().add(Function) would work with the generic
Sesame server, but not necessarily other Sesame-compliant servers (such
as Virtuoso)?

David

>
> It has been on my todo list to add a "rescanClasspath" method to the
> Sesame service registries, but it doesn't yet have an issue on the
> Jira tracker yet.
>
> Cheers,
>
> Peter
>
> On 15 November 2013 10:56, David Booth <[hidden email]> wrote:
>> Awesome!  But one question: It sounds like I need to restart Sesame for
>> my new (or revised) extension function to be picked up.  Is that
>> correct?   If so, that probably wouldn't be a show-stopper for me, but
>> it may mean that I'd have to define a generic extension function that,
>> as its first argument, takes the name of an actual extension function
>> class that could be dynamically loaded at runtime.
>>
>> Thanks!
>> David
>>
>> On 11/14/2013 06:26 PM, Peter Ansell wrote:
>>> Hi David,
>>>
>>> Jeen has written a blog post about this at:
>>>
>>> http://rivuli-development.com/further-reading/sesame-cookbook/creating-custom-sparql-functions/
>>>
>>> Cheers,
>>>
>>> Peter
>>>
>>> On 15 November 2013 10:20, David Booth <[hidden email]> wrote:
>>>> Here's an example from the SPARQL 1.1 spec of invoking an extension
>>>> function to compute the distance between two geographic points:
>>>> http://www.w3.org/TR/sparql11-query/#extensionFunctions
>>>>
>>>>        FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .
>>>>
>>>> Does Sesame support SPARQL extension functions?  I haven't found any
>>>> mention of it.   And if not, does anyone know what would be involved in
>>>> extending the Sesame store to add support for them?  Ideally it would be
>>>> nice to be able to load them dynamically, using Java's dynamic class
>>>> loading.
>>>>
>>>> Thanks,
>>>> David
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>>>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>>>> Free app hosting. Or install the open source package on any LAMP server.
>>>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Sesame-general mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>>>
>>> ------------------------------------------------------------------------------
>>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>>> Free app hosting. Or install the open source package on any LAMP server.
>>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Sesame-general mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>> Free app hosting. Or install the open source package on any LAMP server.
>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Sesame-general mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sesame-general
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Sesame-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sesame-general
>
>
>

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general
Reply | Threaded
Open this post in threaded view
|

Re: Does Sesame support SPARQL extension functions?

Peter Ansell-2
On 15 November 2013 13:40, David Booth <[hidden email]> wrote:

> On 11/14/2013 07:18 PM, Peter Ansell wrote:
>> You would need to reload Sesame to pick up the new META-INF/services
>> files added to the classpath after the application is first loaded.
>>
>> However, if you have new functions defined at runtime (say you are
>> implementing SPIN, for example), you can manually add functions to the
>> registry programmatically without META-INF/services files using
>> FunctionRegistry.getInstance().add(Function). The URIs defined for the
>> functions will still be picked up in the usual way from the
>> Function.getURI() method even if they don't originate from
>> META-INF/services files.
>
> Cool!
>
>>
>> The way the FunctionRegistry is used in different implementations of
>> EvaluationStrategy has not yet been standardised though. Ie, you
>> cannot define a FunctionRegistry object to use for each
>> Query/ParsedQuery at this stage. Currently, the EvaluationStrategyImpl
>> from the sesame-queryalgebra-evaluation module hardcodes a reference
>> to FunctionRegistry.getInstance(). Feel free to suggest an improvement
>> for that and we can look to add it to Sesame-2.8/2.9 or the next major
>> version. One of the issues is that the Function interface is defined
>> in sesame-queryalgebra-evaluation, and that is not used by all OpenRDF
>> implementations, as some implement their own SPARQL engines. Both the
>> Function and FunctionRegistry interfaces would need to be defined in
>> sesame-queryalgebra-model or sesame-query to have them shared between
>> different Sail implementations. Note, if there is only a Repository
>> implementation (ie, Virtuoso) then you cannot extend the algebra using
>> FunctionRegistry.
>
> I'm afraid I don't know yet enough about the back end architecture to
> follow all of that, but would I correct to understand this to mean that
> registering an extension function using
> FunctionRegistry.getInstance().add(Function) would work with the generic
> Sesame server, but not necessarily other Sesame-compliant servers (such
> as Virtuoso)?

That is basically correct.

It will work for all of the Sesame Sail stores that are distributed
with OpenRDF Sesame, as they all use the SPARQL engine that we
implement.

However, it won't work with Virtuoso as they pass the SPARQL queries
directly to their engine for parsing and processing, so they don't
know about the function within their engine when they parse the query.

That strategy will also not work with BigData, as far as I know, as
they have their own SPARQL engine. There may be a similar situation
for the other SPARQL engines.

If we can standardise the way the Function interface and the
FunctionRegistry is used, it could work with other OpenRDF implemented
SPARQL engines. That wouldn't require much effort, but it may require
those classes to change modules to one of their current parent
modules.

Cheers,

Peter

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Sesame-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sesame-general