Not much that can be done just by changing the query I think.

If you can modify the dataset, then one approach would be to precompute the 
results of the afn:namespace call. So, add an additional triple of this form to 
each subject in the dataset:

    <http://mynamespace#foo> my:namespace "http://mynamespace#"; .

Then you can query for

    GRAPH <http://mygraph> {
        ?s my:namespace "http://mynamespace#"; .
        ?s ?p ?o .
    }

and that should be much faster.

Richard



> On 31 Aug 2018, at 17:13, Steve Ray (CMU) <[email protected]> wrote:
> 
> Hi,
>             I’m putting out this request to the community at large to see if 
> there are ideas that I’m unaware of. I have a fairly large database of 
> roughly 1.5 million triples. It is populated with many sets of roughly 450 
> triples which share the same namespace. Many of my operations involve 
> retrieving one of those sets of triples, but I’m finding it takes about 7 
> seconds to execute on TBL, installed on a 16GB AWS instance. Here is the 
> SPARQL query I’m using to get a set of triples:
>  
>  
> PREFIX afn: <http://jena.hpl.hp.com/ARQ/function# 
> <http://jena.hpl.hp.com/ARQ/function#>>
> SELECT ?s ?p ?o
> WHERE {
> GRAPH <http://mygraph <http://mygraph/>> {
>     ?s ?p ?o .
>     FILTER (afn:namespace(?s) = "http://mynamespace# <http://mynamespace/#>") 
> .
> }}
>  
>  
> Is there some clever way to pull just the triples in a single namespace that 
> doesn’t involve using ?s ?p ?o followed by a FILTER?
> Brilliant ideas welcome!
>  
>  
> - Steve
>  
> Steven R. Ray, Ph.D.
> Distinguished Research Fellow
> Carnegie Mellon University
> NASA Research Park
> Building 23 (MS 23-11)
> P.O. Box 1
> Moffett Field, CA 94305-0001
> Email:    [email protected] <mailto:[email protected]>
> Phone: (650) 587-3780
> Cell:      (202) 316-6481
> Skype: steverayconsulting
> <image001.png>
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to