Optimized queries through R2RML/Virtual Graph

0 views
Skip to first unread message

Charbel Kaed

unread,
Oct 13, 2016, 2:08:30 PM10/13/16
to Stardog
Hello,

I would like to have your opinion on what is the best way to execute a federated query combining a local table in Stardog and a remote RDBMS through R2RML. The remote table contains 50 million records and the result of the query is expected to return between 500.000 and 1 million records.

SELECT DISTINCT ?b ?ts ?val 
WHERE {
 ?point qt:hasSeries ?id. //this should return 40 ids.

graph <virtual://semantic> // this should return 500.000 and 1 million records after the filter on the ids.
 {
   [] qt:hasSeries ?b; 
      qt:hasV ?val ; 
      qt:hasT ?ts.  
      filter(?val <5). 
 } 

filter (?id = ?b) 

group by ?b ?ts ?val

Thank you,
Charbel.

Zachary Whitley

unread,
Oct 13, 2016, 3:42:36 PM10/13/16
to Stardog
The most straight forward solution would be materializing the virtual graph and loading the data into Stardog.

I don't know if you can use variables with virtual graphs but if you can and there aren't too many total id's you might be able to create a separate mapping for each series ?id and add some information that correlates id with the virtual graph. Not a great solution but might work. I'd be interested to know if you can use variables with virtual graphs. You can't with service url's but I virtual graphs might work.

I'm assuming there isn't anything you can do from the RDBMS side. If there is you might be able to create a user defined function that turns the query inside out and makes a sparql call from the RDBMS depending on the database you're using.

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+unsubscribe@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

Zachary Whitley

unread,
Oct 20, 2016, 8:02:36 PM10/20/16
to sta...@clarkparsia.com
I just came across this project [1] that looks like it implements what I suggested with calling Stardog from the relational database. It's using MS SQL Server and Stardog. I don't recall you mentioning what RDBMS you were using. 


For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

charbel kaed

unread,
Oct 21, 2016, 3:13:18 PM10/21/16
to sta...@clarkparsia.com
Thank you Zachary, 
I will take a look at it.

On Thu, Oct 20, 2016 at 8:02 PM, Zachary Whitley <zachary...@gmail.com> wrote:
I just came across this project [1] that looks like it implements what I suggested with calling Stardog from the relational database. It's using MS SQL Server and Stardog. I don't recall you mentioning what RDBMS you were using. 

You received this message because you are subscribed to a topic in the Google Groups "Stardog" group.
To unsubscribe from this topic, visit https://groups.google.com/a/clarkparsia.com/d/topic/stardog/8F-ZgIHEa7o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stardog+unsubscribe@clarkparsia.com.

Reply all
Reply to author
Forward
0 new messages