rya-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Pelakh <boris.pel...@semanticarts.com>
Subject RE: Dataset not applied to queries
Date Tue, 04 Dec 2018 14:45:14 GMT
So, a /sparql?query=SELECT...WHERE...&default-graph-uri=my-named-graph is logically equivalent
to 

SELECT ...
FROM <my-named-graph>
WHERE ...

(overriding whatever FROM/FROM NAMED clauses actually specified in the query) I looked at
org.apache.rya.rdftriplestore.RdfCloudTripleStoreConnection.evaluateInternal(), and the dataset
containing the overriding graph names is passed in, but does not seem to be honored, i.e if
I have the following data:

ns:g1 { ns:p1 ns:pred ns:o1 }
ns:g2 { ns:p2 ns:pred ns:o2 }

and I execute 'SELECT COUNT(?s) where { ?s ns:pred ?o }' with default-graph-uri set to ns:g1,
I expect to get 1, but I get 2.

I am assuming that there is someplace where the TupleExpr passed to evaluateInternal gets
transformed into a scan pattern for Accumulo, after the right index (spo/ops/pso) is identified.
If I remember correctly, S/P/O is used the the row ID, and the graph is the column name (or
family?). So the dataset should modify the scan filter if applied correctly.

Boris Pelakh
Ontologist, Developer, Software Architect
boris.pelakh@semanticarts.com
+1-321-243-3804


-----Original Message-----
From: Puja Valiyil <pujav65@gmail.com> 
Sent: Tuesday, December 4, 2018 9:31 AM
To: dev@rya.incubator.apache.org
Subject: Re: Dataset not applied to queries

Hi Boris,
Unfortunately I'm not very familiar with that method -- can you provide some more details
into exactly what its supposed to do?
All of the connectors for implementing the sail api are in the rya.sail, and the main classes
to look at are RdfCloudTripleStore, RyaSailRepository, and RdfCloudTripleStoreConnection.
All of these classes all extend abstract implementations SAIL provides out of the box, so
typically the way you extend them to do more stuff is to look at the Sail implementation and
customize it for Rya's data structures.
If you need any help or want to bounce any implementation ideas off of anyone, please send
out an email over the dev list. Just let us know how we can help!
Thanks,
Puja


On Tue, Dec 4, 2018 at 9:19 AM Boris Pelakh <boris.pelakh@semanticarts.com>
wrote:

> I am in the process of implementing a SPARQL 1.1-compliant endpoint 
> for web.rya so that Rya can be used as a federated repository with 
> RDF4J workbench.
>
>
>
> One of requirements is to be able to pass default-graph-uri and 
> named-graph-uri filters external to the query to override the graph 
> filter in the query itself (see 
> https://www.w3.org/TR/sparql11-protocol/#query-operation).
>
>
>
> In the sail API this is accomplished by setting the dataset on the 
> query object (see 
> http://docs.rdf4j.org/javadoc/2.2/org/eclipse/rdf4j/query/Operation.ht
> ml#setDataset-org.eclipse.rdf4j.query.Dataset-),
> but that setting does not seem to be honored by the Rya SAIL 
> implementation. Any ideas on where I can start digging to correct this?
>
>
>
> (I have also tried wrapping the Rya repository connection in a 
> ContextAwareConnection and setting readContexts, but the effect is the 
> same).
>
>
>
> *Boris Pelakh*
>
> *Ontologist, Developer, Software Architect*
>
> *boris.pelakh@semanticarts.com <boris.pelakh@semanticarts.com>*
>
> *+1-321-243-3804*
>
> [image: SemanticArtsLogo]
>
>
>
Mime
View raw message