You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andrey Lomakin <lo...@gmail.com> on 2012/10/22 13:35:01 UTC
OrientDB based SDB store
Hi all,
We are OrientDB commiters and we are interested to create SDB store based
on OrientDB graph/document based NoSQL DB http://code.google.com/p/orient/.
But at first we would like to:
1. Know whether it is considered valuable for Apache Jena project by
it's commiters ?
2. Estimate time which is needed to provide given implementation and
have starting point to do such estimation.
So could you answer on following question, according to documentation:
> "The class GraphSDB provides the adapter between the standard Jena Java
> API and an SDB store, either to the default graph or one of the named
> graphs. The SDBFactory can also create Jena Models backed by such a graph.
> "
would it be enough to provide implementation of GraphSDB which is based on
OrientDB to make possible to use this graph DB as store for Apache Jena
model and process SPARQL queries ?
--
With best regards,
Andrey Lomakin
Re: OrientDB based SDB store
Posted by Andy Seaborne <an...@apache.org>.
In RDF, resources don't have a class as part of the data model. A
resource has a type if there is a triple:
<resource> rdf:type ontology:Class45 .
so the notion of "class" is layered on top.
------------------------------
Let me see if I understand the physical data model for RDF:
The structure is a pair of indexes
S->triples with same subject
i.e. S -> list of triple ids of triples with the same subject
O->triples with same object
and triples have an id.
Is that right?
Solving SPARQL queries requires simple range access to the index. All
access comes down to looking for triples that match a pattern of 3
slots, where a slot is either a RDF term or a wildcard. What you need
back is a stream of matches.
(there are various speed-ups on top of this)
for example:
SELECT ?xname ?yname
{
<http://person/x> foaf:name ?xname .
?x foaf:knows ?y .
?y foaf:name ?yname .
}
There are various ways to solve this pattern (ordering matters to the
speed not the answer).
What are your thoughts on solving that on your physical data model?
(graph traversal is in effect a join - a parallel index join - now that
impala, dremel, and Spanner are on the scene, NoSQL can again use the
word "join"!)
Andy
On 24/10/12 06:30, Andrey Lomakin wrote:
> Hi Andy,
> Thank you very much for such comprehensive answer.
>
> I think I should add more details about graph presentation of OrientDB.
>
> Vertexes and edges are presented as triples which contain set of ids from
> which vertex there is connection to given edge (or from which edge there is
> connection to given vertex), to which vertex there is connection from
> given edge and property-value pairs.
>
> The sets of "from", "to" values are presented as special kind of MVRBTree
> and according to our tests they scales pretty well.
> The id itself presents index of item in persistent list, item in the list
> has fixed size and contains physical position of record on the disk.
> OrientDB has no joins and one -to-many relations are presented as "linked
> sets" (MVRBTree which contains ids) and many to many relationships are
> presented as "from-to" triples (like vertex-edge relations described above).
>
> Triples itself are presented as single document.
>
> Also there are types to present embedded maps, lists and sets. Collections
> and primitive values can be indexed.
>
> Usage of given approach to present one-to-many relations (according to
> reports of our clients who migrated from relational solution)
> increase business logic processing up to 10-100 times.
>
> The only big difference between RDF and OrientDB model is inheritance
> model, OrientDB has classes but it does not support multiple inheritance
> and does not support property inheritance.
>
> According to all written above we think that implementation of Graph
> interface with SPARQL algebra should provide the best performance.
> But to be sure we need to look on Graph interface sources to clarify all
> details.
>
> Meanwhile could answer whether inheritance relations are implemented on
> graph interface or on more higher level ?
>
> The idea to implement TDB on top of MVRBTree is worth of consideration and
> we have concept of manual indexes which essentially provide public
> interface to MVRBTree itself but from our point of view it will be less
> effective implementation but of course it will allow us to integrate
> OrientDB with Apache Jena in short terms.
>
> The very important point here that we have company which is ready to
> provide contribution in this migration but they need POC before they will
> do any donations.
>
> So we think that we will spend about 3-4 weeks on investigation of Jena
> sources and after that will provide you our vision of approach which we
> will use to integrate both of this projects.
>
> Now about your questions:
>
>> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
>> some details? I couldn't find it (probably user search error)
>
>
> There were plans to provide details of MVRB-Tree implementation but because
> lack of the time we did not realize them.
>
> Q2/ I didn't quite understand whether operations are distributed across a
>> OrientDB cluster. I understood the access by key but how do operations
>> like graph traversal get spread or does a master coordinate them?
>
>
> We have master-master replication approach, in this approach writes are
> replicates on all servers but reads are performed from single one.
> But now I and Artem are working on DHT based solution. In this solution
> records will be distributed between nodes by their ids values , ids itself
> are generated using Mersenne Twister RNG.
> Each node has replica of it's data on it's successor
> which automatically will become data owner of it's predecessor data if last
> one will fail.
> So we do not have single master and can suffer from network partitions and
> nodes failures but for the cost of eventual consistency of course.
> Also in DHT case we are going to use not list but map which is implemented
> on enhanced version of linear hashing.
>
> About the graph traversal - do I need to provide more details about how it
> is performed ?
>
> On Mon, Oct 22, 2012 at 11:21 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 22/10/12 12:35, Andrey Lomakin wrote:
>>
>>> Hi all,
>>>
>>> We are OrientDB commiters and we are interested to create SDB store based
>>> on OrientDB graph/document based NoSQL DB http://code.google.com/p/**
>>> orient/ <http://code.google.com/p/orient/>.
>>> But at first we would like to:
>>>
>>> 1. Know whether it is considered valuable for Apache Jena project by
>>> it's commiters ?
>>> 2. Estimate time which is needed to provide given implementation and
>>>
>>> have starting point to do such estimation.
>>>
>>> So could you answer on following question, according to documentation:
>>>
>>> "The class GraphSDB provides the adapter between the standard Jena Java
>>>> API and an SDB store, either to the default graph or one of the named
>>>> graphs. The SDBFactory can also create Jena Models backed by such a
>>>> graph.
>>>> "
>>>>
>>>
>>> would it be enough to provide implementation of GraphSDB which is based on
>>> OrientDB to make possible to use this graph DB as store for Apache Jena
>>> model and process SPARQL queries ?
>>>
>>>
>> Hi Andrey,
>>
>> Interesting - I had a all-too-quick look at the OrientDB website so please
>> forgive me for any and all the bits I get wrong here. Please do correct my
>> mistakes. Similarly, if anything I write here isn't clear, please do ask.
>>
>> An important first question is how do you want to lay out the RDF in
>> OrientDB? i.e. how best to exploit the best of OrientDB. Whatever
>> integration route you explore, this is going to be important.
>>
>> There are several ways you might consider integrating with Jena - they are
>> not all mutually exclusive.
>>
>>
>> (1) Implement the Graph interface
>>
>> Because there it a framework implementation (GraphBase2), this comes down
>> to 2 methods - add and find. This is the quickest way to implement but it
>> does not lead to the best scalability. However, everything works so it
>> often worth doing to get complete functionality quickly.
>>
>> This gets the code API working. If the core API works, everthing works,
>> just not as fast as possible.
>>
>>
>> (2) SDB
>>
>> If OrientDB has enough SQL (does OrientDb have leftjoin? - I see an
>> example where it has nested selects which SDB also uses), this is one route
>> but it may be limited in scalability because of JDBC overhead.
>>
>> SDB does not translate every SPARQL query to exactly one SQL query.
>> Sometimes it takes many SQL queries to execute a single (complicated)
>> SPARQL query. This is due to wanting XSD semantics for arithmetic
>> operations and also the overheads of JDBC mean SDB, while supported, isn't
>> the major focus of attention. SDB on other SQL databases sclaes to 10s of
>> millions of triples; in contrast, TDB does 100's of millions and some
>> people use it at large scale.
>>
>> SDB does take a particular way of laying out the RDF
>>
>> http://jena.apache.org/**documentation/sdb/database_**layouts.html<http://jena.apache.org/documentation/sdb/database_layouts.html>
>>
>> but I'm not clear this is a good choice for you. Maybe storing the node
>> representation inline is better or storing all triples with the same
>> subject is a better match.
>>
>>
>> (3) TDB - replace TDB's B+Tree with OrientDB's MVRB-Tree
>>
>> A specific possibility for OrientDB is to take TDB, and replace TDB's
>> B+Trees with the MVRB-Tree's.
>>
>> The TDB data model for RDF is to have a dictionary (the node table) where
>> each node has an id. A triple is 3 ids which is 24 bytes. Both TDB and
>> SDB produce narrow tables - some systems are not efficient (not all SQL
>> databases do very well for this style).
>>
>> Incidentally, one of the TDB bulk loaders will work this way because it
>> works over indexes (the other one knows the disk layout of index files and
>> writes the files directly - that won't work for another index
>> implementation).
>>
>> (4) Implement/extend the SPARQL Algebra
>>
>> ARQ provides a general way to implement SPARQL - you can implement just
>> some of it (one operation - OpExecutor(OpBGP)) and add more and more
>> algebra operations as you want. You also need a way to add data to the
>> databse - (1) will do for that until you want to get very smart about it.
>>
>> The general purpose OpExecutor will execute any query given
>> OpExecutor(OpBGP) to access the data. As more and more algebra operations
>> are replaced by OrientDB specific imeplementations, you get better and
>> better performance and scalability. At all times, you have a complete
>> SPARQL implementation.
>>
>> So if you have a way to load the database you can get complete
>> functionality very quickly.
>>
>>
>> If it were me, I'd look at (4); TDB uses (4) to extend ARQ so (3) also
>> applies. The most basic integration is a few 10s of lines of code and
>> there is a path to more efficient integration. And all the test cases work!
>>
>>
>> There is some information here:
>>
>> http://jena.apache.org/**documentation/query/arq-query-**eval.html<http://jena.apache.org/documentation/query/arq-query-eval.html>
>>
>> But the first question is the critical one - how to store RDF in OrientDB
>> so as to use the best of OrientDB. Any thoughts?
>>
>>
>> A couple of questions:
>>
>> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
>> some details? I couldn't find it (probably user search error)
>>
>> Q2/ I didn't quite understand whether operations are distributed across a
>> OrientDB cluster. I understood the access by key but how do operations
>> like graph traversal get spread or does a master coordinate them?
>>
>> Again - I have only had a chance to lightly read the website and not had
>> the time to look at the code and so apologies if I have missed the point
>> somewhere.
>>
>> Andy
>>
>>
>
>
Re: OrientDB based SDB store
Posted by Andrey Lomakin <lo...@gmail.com>.
+ Sergey
On Wed, Oct 24, 2012 at 8:30 AM, Andrey Lomakin <lo...@gmail.com>wrote:
> Hi Andy,
> Thank you very much for such comprehensive answer.
>
> I think I should add more details about graph presentation of OrientDB.
>
> Vertexes and edges are presented as triples which contain set of ids from
> which vertex there is connection to given edge (or from which edge there is
> connection to given vertex), to which vertex there is connection from
> given edge and property-value pairs.
>
> The sets of "from", "to" values are presented as special kind of MVRBTree
> and according to our tests they scales pretty well.
> The id itself presents index of item in persistent list, item in the list
> has fixed size and contains physical position of record on the disk.
>
> OrientDB has no joins and one -to-many relations are presented as "linked
> sets" (MVRBTree which contains ids) and many to many relationships are
> presented as "from-to" triples (like vertex-edge relations described above).
>
> Triples itself are presented as single document.
>
> Also there are types to present embedded maps, lists and sets. Collections
> and primitive values can be indexed.
>
> Usage of given approach to present one-to-many relations (according to
> reports of our clients who migrated from relational solution)
> increase business logic processing up to 10-100 times.
>
> The only big difference between RDF and OrientDB model is inheritance
> model, OrientDB has classes but it does not support multiple inheritance
> and does not support property inheritance.
>
> According to all written above we think that implementation of Graph
> interface with SPARQL algebra should provide the best performance.
> But to be sure we need to look on Graph interface sources to clarify all
> details.
>
> Meanwhile could answer whether inheritance relations are implemented on
> graph interface or on more higher level ?
>
> The idea to implement TDB on top of MVRBTree is worth of consideration and
> we have concept of manual indexes which essentially provide public
> interface to MVRBTree itself but from our point of view it will be less
> effective implementation but of course it will allow us to integrate
> OrientDB with Apache Jena in short terms.
>
> The very important point here that we have company which is ready to
> provide contribution in this migration but they need POC before they will
> do any donations.
>
> So we think that we will spend about 3-4 weeks on investigation of Jena
> sources and after that will provide you our vision of approach which we
> will use to integrate both of this projects.
>
> Now about your questions:
>
>> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
>> some details? I couldn't find it (probably user search error)
>
>
> There were plans to provide details of MVRB-Tree implementation but
> because lack of the time we did not realize them.
>
> Q2/ I didn't quite understand whether operations are distributed across a
>> OrientDB cluster. I understood the access by key but how do operations
>> like graph traversal get spread or does a master coordinate them?
>
>
> We have master-master replication approach, in this approach writes are
> replicates on all servers but reads are performed from single one.
> But now I and Artem are working on DHT based solution. In this solution
> records will be distributed between nodes by their ids values , ids itself
> are generated using Mersenne Twister RNG.
> Each node has replica of it's data on it's successor
> which automatically will become data owner of it's predecessor data if last
> one will fail.
> So we do not have single master and can suffer from network partitions and
> nodes failures but for the cost of eventual consistency of course.
> Also in DHT case we are going to use not list but map which is implemented
> on enhanced version of linear hashing.
>
> About the graph traversal - do I need to provide more details about how
> it is performed ?
>
> On Mon, Oct 22, 2012 at 11:21 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 22/10/12 12:35, Andrey Lomakin wrote:
>>
>>> Hi all,
>>>
>>> We are OrientDB commiters and we are interested to create SDB store
>>> based
>>> on OrientDB graph/document based NoSQL DB http://code.google.com/p/**
>>> orient/ <http://code.google.com/p/orient/>.
>>> But at first we would like to:
>>>
>>> 1. Know whether it is considered valuable for Apache Jena project by
>>> it's commiters ?
>>> 2. Estimate time which is needed to provide given implementation and
>>>
>>> have starting point to do such estimation.
>>>
>>> So could you answer on following question, according to documentation:
>>>
>>> "The class GraphSDB provides the adapter between the standard Jena Java
>>>> API and an SDB store, either to the default graph or one of the named
>>>> graphs. The SDBFactory can also create Jena Models backed by such a
>>>> graph.
>>>> "
>>>>
>>>
>>> would it be enough to provide implementation of GraphSDB which is based
>>> on
>>> OrientDB to make possible to use this graph DB as store for Apache Jena
>>> model and process SPARQL queries ?
>>>
>>>
>> Hi Andrey,
>>
>> Interesting - I had a all-too-quick look at the OrientDB website so
>> please forgive me for any and all the bits I get wrong here. Please do
>> correct my mistakes. Similarly, if anything I write here isn't clear,
>> please do ask.
>>
>> An important first question is how do you want to lay out the RDF in
>> OrientDB? i.e. how best to exploit the best of OrientDB. Whatever
>> integration route you explore, this is going to be important.
>>
>> There are several ways you might consider integrating with Jena - they
>> are not all mutually exclusive.
>>
>>
>> (1) Implement the Graph interface
>>
>> Because there it a framework implementation (GraphBase2), this comes down
>> to 2 methods - add and find. This is the quickest way to implement but it
>> does not lead to the best scalability. However, everything works so it
>> often worth doing to get complete functionality quickly.
>>
>> This gets the code API working. If the core API works, everthing works,
>> just not as fast as possible.
>>
>>
>> (2) SDB
>>
>> If OrientDB has enough SQL (does OrientDb have leftjoin? - I see an
>> example where it has nested selects which SDB also uses), this is one route
>> but it may be limited in scalability because of JDBC overhead.
>>
>> SDB does not translate every SPARQL query to exactly one SQL query.
>> Sometimes it takes many SQL queries to execute a single (complicated)
>> SPARQL query. This is due to wanting XSD semantics for arithmetic
>> operations and also the overheads of JDBC mean SDB, while supported, isn't
>> the major focus of attention. SDB on other SQL databases sclaes to 10s of
>> millions of triples; in contrast, TDB does 100's of millions and some
>> people use it at large scale.
>>
>> SDB does take a particular way of laying out the RDF
>>
>> http://jena.apache.org/**documentation/sdb/database_**layouts.html<http://jena.apache.org/documentation/sdb/database_layouts.html>
>>
>> but I'm not clear this is a good choice for you. Maybe storing the node
>> representation inline is better or storing all triples with the same
>> subject is a better match.
>>
>>
>> (3) TDB - replace TDB's B+Tree with OrientDB's MVRB-Tree
>>
>> A specific possibility for OrientDB is to take TDB, and replace TDB's
>> B+Trees with the MVRB-Tree's.
>>
>> The TDB data model for RDF is to have a dictionary (the node table) where
>> each node has an id. A triple is 3 ids which is 24 bytes. Both TDB and
>> SDB produce narrow tables - some systems are not efficient (not all SQL
>> databases do very well for this style).
>>
>> Incidentally, one of the TDB bulk loaders will work this way because it
>> works over indexes (the other one knows the disk layout of index files and
>> writes the files directly - that won't work for another index
>> implementation).
>>
>> (4) Implement/extend the SPARQL Algebra
>>
>> ARQ provides a general way to implement SPARQL - you can implement just
>> some of it (one operation - OpExecutor(OpBGP)) and add more and more
>> algebra operations as you want. You also need a way to add data to the
>> databse - (1) will do for that until you want to get very smart about it.
>>
>> The general purpose OpExecutor will execute any query given
>> OpExecutor(OpBGP) to access the data. As more and more algebra operations
>> are replaced by OrientDB specific imeplementations, you get better and
>> better performance and scalability. At all times, you have a complete
>> SPARQL implementation.
>>
>> So if you have a way to load the database you can get complete
>> functionality very quickly.
>>
>>
>> If it were me, I'd look at (4); TDB uses (4) to extend ARQ so (3) also
>> applies. The most basic integration is a few 10s of lines of code and
>> there is a path to more efficient integration. And all the test cases work!
>>
>>
>> There is some information here:
>>
>> http://jena.apache.org/**documentation/query/arq-query-**eval.html<http://jena.apache.org/documentation/query/arq-query-eval.html>
>>
>> But the first question is the critical one - how to store RDF in OrientDB
>> so as to use the best of OrientDB. Any thoughts?
>>
>>
>> A couple of questions:
>>
>> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
>> some details? I couldn't find it (probably user search error)
>>
>> Q2/ I didn't quite understand whether operations are distributed across a
>> OrientDB cluster. I understood the access by key but how do operations
>> like graph traversal get spread or does a master coordinate them?
>>
>> Again - I have only had a chance to lightly read the website and not had
>> the time to look at the code and so apologies if I have missed the point
>> somewhere.
>>
>> Andy
>>
>>
>
>
> --
> With best regards,
> Andrey Lomakin
>
>
>
>
--
With best regards,
Andrey Lomakin
Re: OrientDB based SDB store
Posted by Andrey Lomakin <lo...@gmail.com>.
Hi Andy,
Thank you very much for such comprehensive answer.
I think I should add more details about graph presentation of OrientDB.
Vertexes and edges are presented as triples which contain set of ids from
which vertex there is connection to given edge (or from which edge there is
connection to given vertex), to which vertex there is connection from
given edge and property-value pairs.
The sets of "from", "to" values are presented as special kind of MVRBTree
and according to our tests they scales pretty well.
The id itself presents index of item in persistent list, item in the list
has fixed size and contains physical position of record on the disk.
OrientDB has no joins and one -to-many relations are presented as "linked
sets" (MVRBTree which contains ids) and many to many relationships are
presented as "from-to" triples (like vertex-edge relations described above).
Triples itself are presented as single document.
Also there are types to present embedded maps, lists and sets. Collections
and primitive values can be indexed.
Usage of given approach to present one-to-many relations (according to
reports of our clients who migrated from relational solution)
increase business logic processing up to 10-100 times.
The only big difference between RDF and OrientDB model is inheritance
model, OrientDB has classes but it does not support multiple inheritance
and does not support property inheritance.
According to all written above we think that implementation of Graph
interface with SPARQL algebra should provide the best performance.
But to be sure we need to look on Graph interface sources to clarify all
details.
Meanwhile could answer whether inheritance relations are implemented on
graph interface or on more higher level ?
The idea to implement TDB on top of MVRBTree is worth of consideration and
we have concept of manual indexes which essentially provide public
interface to MVRBTree itself but from our point of view it will be less
effective implementation but of course it will allow us to integrate
OrientDB with Apache Jena in short terms.
The very important point here that we have company which is ready to
provide contribution in this migration but they need POC before they will
do any donations.
So we think that we will spend about 3-4 weeks on investigation of Jena
sources and after that will provide you our vision of approach which we
will use to integrate both of this projects.
Now about your questions:
> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
> some details? I couldn't find it (probably user search error)
There were plans to provide details of MVRB-Tree implementation but because
lack of the time we did not realize them.
Q2/ I didn't quite understand whether operations are distributed across a
> OrientDB cluster. I understood the access by key but how do operations
> like graph traversal get spread or does a master coordinate them?
We have master-master replication approach, in this approach writes are
replicates on all servers but reads are performed from single one.
But now I and Artem are working on DHT based solution. In this solution
records will be distributed between nodes by their ids values , ids itself
are generated using Mersenne Twister RNG.
Each node has replica of it's data on it's successor
which automatically will become data owner of it's predecessor data if last
one will fail.
So we do not have single master and can suffer from network partitions and
nodes failures but for the cost of eventual consistency of course.
Also in DHT case we are going to use not list but map which is implemented
on enhanced version of linear hashing.
About the graph traversal - do I need to provide more details about how it
is performed ?
On Mon, Oct 22, 2012 at 11:21 PM, Andy Seaborne <an...@apache.org> wrote:
> On 22/10/12 12:35, Andrey Lomakin wrote:
>
>> Hi all,
>>
>> We are OrientDB commiters and we are interested to create SDB store based
>> on OrientDB graph/document based NoSQL DB http://code.google.com/p/**
>> orient/ <http://code.google.com/p/orient/>.
>> But at first we would like to:
>>
>> 1. Know whether it is considered valuable for Apache Jena project by
>> it's commiters ?
>> 2. Estimate time which is needed to provide given implementation and
>>
>> have starting point to do such estimation.
>>
>> So could you answer on following question, according to documentation:
>>
>> "The class GraphSDB provides the adapter between the standard Jena Java
>>> API and an SDB store, either to the default graph or one of the named
>>> graphs. The SDBFactory can also create Jena Models backed by such a
>>> graph.
>>> "
>>>
>>
>> would it be enough to provide implementation of GraphSDB which is based on
>> OrientDB to make possible to use this graph DB as store for Apache Jena
>> model and process SPARQL queries ?
>>
>>
> Hi Andrey,
>
> Interesting - I had a all-too-quick look at the OrientDB website so please
> forgive me for any and all the bits I get wrong here. Please do correct my
> mistakes. Similarly, if anything I write here isn't clear, please do ask.
>
> An important first question is how do you want to lay out the RDF in
> OrientDB? i.e. how best to exploit the best of OrientDB. Whatever
> integration route you explore, this is going to be important.
>
> There are several ways you might consider integrating with Jena - they are
> not all mutually exclusive.
>
>
> (1) Implement the Graph interface
>
> Because there it a framework implementation (GraphBase2), this comes down
> to 2 methods - add and find. This is the quickest way to implement but it
> does not lead to the best scalability. However, everything works so it
> often worth doing to get complete functionality quickly.
>
> This gets the code API working. If the core API works, everthing works,
> just not as fast as possible.
>
>
> (2) SDB
>
> If OrientDB has enough SQL (does OrientDb have leftjoin? - I see an
> example where it has nested selects which SDB also uses), this is one route
> but it may be limited in scalability because of JDBC overhead.
>
> SDB does not translate every SPARQL query to exactly one SQL query.
> Sometimes it takes many SQL queries to execute a single (complicated)
> SPARQL query. This is due to wanting XSD semantics for arithmetic
> operations and also the overheads of JDBC mean SDB, while supported, isn't
> the major focus of attention. SDB on other SQL databases sclaes to 10s of
> millions of triples; in contrast, TDB does 100's of millions and some
> people use it at large scale.
>
> SDB does take a particular way of laying out the RDF
>
> http://jena.apache.org/**documentation/sdb/database_**layouts.html<http://jena.apache.org/documentation/sdb/database_layouts.html>
>
> but I'm not clear this is a good choice for you. Maybe storing the node
> representation inline is better or storing all triples with the same
> subject is a better match.
>
>
> (3) TDB - replace TDB's B+Tree with OrientDB's MVRB-Tree
>
> A specific possibility for OrientDB is to take TDB, and replace TDB's
> B+Trees with the MVRB-Tree's.
>
> The TDB data model for RDF is to have a dictionary (the node table) where
> each node has an id. A triple is 3 ids which is 24 bytes. Both TDB and
> SDB produce narrow tables - some systems are not efficient (not all SQL
> databases do very well for this style).
>
> Incidentally, one of the TDB bulk loaders will work this way because it
> works over indexes (the other one knows the disk layout of index files and
> writes the files directly - that won't work for another index
> implementation).
>
> (4) Implement/extend the SPARQL Algebra
>
> ARQ provides a general way to implement SPARQL - you can implement just
> some of it (one operation - OpExecutor(OpBGP)) and add more and more
> algebra operations as you want. You also need a way to add data to the
> databse - (1) will do for that until you want to get very smart about it.
>
> The general purpose OpExecutor will execute any query given
> OpExecutor(OpBGP) to access the data. As more and more algebra operations
> are replaced by OrientDB specific imeplementations, you get better and
> better performance and scalability. At all times, you have a complete
> SPARQL implementation.
>
> So if you have a way to load the database you can get complete
> functionality very quickly.
>
>
> If it were me, I'd look at (4); TDB uses (4) to extend ARQ so (3) also
> applies. The most basic integration is a few 10s of lines of code and
> there is a path to more efficient integration. And all the test cases work!
>
>
> There is some information here:
>
> http://jena.apache.org/**documentation/query/arq-query-**eval.html<http://jena.apache.org/documentation/query/arq-query-eval.html>
>
> But the first question is the critical one - how to store RDF in OrientDB
> so as to use the best of OrientDB. Any thoughts?
>
>
> A couple of questions:
>
> Q1/ There was a paper promised about MVRB-Trees - do you have the link to
> some details? I couldn't find it (probably user search error)
>
> Q2/ I didn't quite understand whether operations are distributed across a
> OrientDB cluster. I understood the access by key but how do operations
> like graph traversal get spread or does a master coordinate them?
>
> Again - I have only had a chance to lightly read the website and not had
> the time to look at the code and so apologies if I have missed the point
> somewhere.
>
> Andy
>
>
--
With best regards,
Andrey Lomakin
Re: OrientDB based SDB store
Posted by Andy Seaborne <an...@apache.org>.
On 22/10/12 12:35, Andrey Lomakin wrote:
> Hi all,
>
> We are OrientDB commiters and we are interested to create SDB store based
> on OrientDB graph/document based NoSQL DB http://code.google.com/p/orient/.
> But at first we would like to:
>
> 1. Know whether it is considered valuable for Apache Jena project by
> it's commiters ?
> 2. Estimate time which is needed to provide given implementation and
> have starting point to do such estimation.
>
> So could you answer on following question, according to documentation:
>
>> "The class GraphSDB provides the adapter between the standard Jena Java
>> API and an SDB store, either to the default graph or one of the named
>> graphs. The SDBFactory can also create Jena Models backed by such a graph.
>> "
>
> would it be enough to provide implementation of GraphSDB which is based on
> OrientDB to make possible to use this graph DB as store for Apache Jena
> model and process SPARQL queries ?
>
Hi Andrey,
Interesting - I had a all-too-quick look at the OrientDB website so
please forgive me for any and all the bits I get wrong here. Please do
correct my mistakes. Similarly, if anything I write here isn't clear,
please do ask.
An important first question is how do you want to lay out the RDF in
OrientDB? i.e. how best to exploit the best of OrientDB. Whatever
integration route you explore, this is going to be important.
There are several ways you might consider integrating with Jena - they
are not all mutually exclusive.
(1) Implement the Graph interface
Because there it a framework implementation (GraphBase2), this comes
down to 2 methods - add and find. This is the quickest way to implement
but it does not lead to the best scalability. However, everything works
so it often worth doing to get complete functionality quickly.
This gets the code API working. If the core API works, everthing works,
just not as fast as possible.
(2) SDB
If OrientDB has enough SQL (does OrientDb have leftjoin? - I see an
example where it has nested selects which SDB also uses), this is one
route but it may be limited in scalability because of JDBC overhead.
SDB does not translate every SPARQL query to exactly one SQL query.
Sometimes it takes many SQL queries to execute a single (complicated)
SPARQL query. This is due to wanting XSD semantics for arithmetic
operations and also the overheads of JDBC mean SDB, while supported,
isn't the major focus of attention. SDB on other SQL databases sclaes
to 10s of millions of triples; in contrast, TDB does 100's of millions
and some people use it at large scale.
SDB does take a particular way of laying out the RDF
http://jena.apache.org/documentation/sdb/database_layouts.html
but I'm not clear this is a good choice for you. Maybe storing the node
representation inline is better or storing all triples with the same
subject is a better match.
(3) TDB - replace TDB's B+Tree with OrientDB's MVRB-Tree
A specific possibility for OrientDB is to take TDB, and replace TDB's
B+Trees with the MVRB-Tree's.
The TDB data model for RDF is to have a dictionary (the node table)
where each node has an id. A triple is 3 ids which is 24 bytes. Both
TDB and SDB produce narrow tables - some systems are not efficient (not
all SQL databases do very well for this style).
Incidentally, one of the TDB bulk loaders will work this way because it
works over indexes (the other one knows the disk layout of index files
and writes the files directly - that won't work for another index
implementation).
(4) Implement/extend the SPARQL Algebra
ARQ provides a general way to implement SPARQL - you can implement just
some of it (one operation - OpExecutor(OpBGP)) and add more and more
algebra operations as you want. You also need a way to add data to the
databse - (1) will do for that until you want to get very smart about it.
The general purpose OpExecutor will execute any query given
OpExecutor(OpBGP) to access the data. As more and more algebra
operations are replaced by OrientDB specific imeplementations, you get
better and better performance and scalability. At all times, you have a
complete SPARQL implementation.
So if you have a way to load the database you can get complete
functionality very quickly.
If it were me, I'd look at (4); TDB uses (4) to extend ARQ so (3) also
applies. The most basic integration is a few 10s of lines of code and
there is a path to more efficient integration. And all the test cases work!
There is some information here:
http://jena.apache.org/documentation/query/arq-query-eval.html
But the first question is the critical one - how to store RDF in
OrientDB so as to use the best of OrientDB. Any thoughts?
A couple of questions:
Q1/ There was a paper promised about MVRB-Trees - do you have the link
to some details? I couldn't find it (probably user search error)
Q2/ I didn't quite understand whether operations are distributed across
a OrientDB cluster. I understood the access by key but how do
operations like graph traversal get spread or does a master coordinate them?
Again - I have only had a chance to lightly read the website and not had
the time to look at the code and so apologies if I have missed the point
somewhere.
Andy
Re: OrientDB based SDB store
Posted by Simon Helsen <sh...@ca.ibm.com>.
I am not a committer so I can't speak for them, but I think another store
implementation is always valuable, especially if it targets scalability.
From:
Andrey Lomakin <lo...@gmail.com>
To:
dev@jena.apache.org
Cc:
Artem Orobets <en...@gmail.com>
Date:
10/22/2012 07:39 AM
Subject:
OrientDB based SDB store
Hi all,
We are OrientDB commiters and we are interested to create SDB store based
on OrientDB graph/document based NoSQL DB http://code.google.com/p/orient/
.
But at first we would like to:
1. Know whether it is considered valuable for Apache Jena project by
it's commiters ?
2. Estimate time which is needed to provide given implementation and
have starting point to do such estimation.
So could you answer on following question, according to documentation:
> "The class GraphSDB provides the adapter between the standard Jena Java
> API and an SDB store, either to the default graph or one of the named
> graphs. The SDBFactory can also create Jena Models backed by such a
graph.
> "
would it be enough to provide implementation of GraphSDB which is based on
OrientDB to make possible to use this graph DB as store for Apache Jena
model and process SPARQL queries ?
--
With best regards,
Andrey Lomakin