1. Jurriaan Schulman
  2. Valentina Database ADK
  3. Thursday, August 11 2016, 06:38 AM
  4.  Subscribe via email
Hello,

I'm looking for a graph database to represent and store knowledge (like Cayley or Neo4j) which can be used with Xojo. Would it be possible to use Valentina for this kind of work, using records as nodes and binary links as edges?

Cheers,

Jurriaan
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
Hi Jurian,

1) yes

2) API is easy enough todo yourself.
SQL is important for client-server, when the whole query should run on server side

API is better for LOCAL or localhost dbs.


3) yes correct.
Well, if we discuss and you will show HOW this can be possible, yes we can implement that.

Btw, I not remember - you going have local db or client-server?

Note, that Valentina have stored procedures, some logic can be programmed there, and become part of db schema.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Jurriaan Schulman Accepted Answer
============================
Now back to your question.

It seems you want that you can have
Company has customer some person
Person has customer some company

right?

And this not cover all variants I think. What about
- persons to person?
- company to company?


Yes, you are right. But I didn't want to make the example to complex.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Ruslan Zasukhin Accepted Answer
So far please forget about theory you have learn in Graph DB books.
Lets consider your task/example.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Ruslan Zasukhin Accepted Answer
Well,

lets at first consider logic benhind of BinaryLinks.

You have two tables, and you create binary link between them using command, which want to see that tables:
CREATE BINARY LINK isCustomerOf ON TABLES ( Person, Company ) AS MANY TO ONE;

Order of tables in this command is very important.
Later you need send RecIDs for LINK command exactly in this order.
So if record John Doe has RecID = 8
and PAradigma Software has RecID = 4,
then
LINK RECORD 8 OF Person WITH RECORD 4 of Company [USING isCustomerOf]

ValentinaDB inside will create pair of values (4,8)

============================
Now back to your question.

It seems you want that you can have
Company has customer some person
Person has customer some company

right?

And this not cover all variants I think. What about
- persons to person?
- company to company?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
Jurriaan Schulman Accepted Answer
Hello Ruslan,

You know that in graph databases, the relationships between nodes can be directed or undirected. So when I query the database, I want to know if a link between two records is directed or not and what the direction of a relationship (link) is, i.e. what is the start (tail) and what is the end (head) of a relationship (= binary link).

For instance:
Table "Person", Record 1 = "John Doe"
Table "Company", Record 1 = "Paradigma Software"
Binary Link labeled "isCustomerOf" between record "John Doe" and record "Paradigma Software".


1) If John Doe is a customer of Paradigma Software, yet Paradigma Software is not a customer of John Doe, the link would be directed.
2) If Paradigma Software is a customer of John Doe, yet John Doe is not a customer of Paradigma Software, the link would also be directed.
3) But if Paradigma Software is a customer of John Doe and John Doe is also a customer of Paradigma Software, the link would be undirected.

So my question is:

How would I do this in Valentina?

I could maybe use the new VKeyValueForLink, so the binary link gets an attribute "isDirected" with a value true or false.

Now, when I query the database and the value of a key of VKeyValueForLink "isDirected" is true, how do I know the direction of the link? How do I know if record "John Doe" is a customer of "Paradigma Software" or the other way around?


Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 5
Ruslan Zasukhin Accepted Answer
Hi Jurriaan,

I have not catch question. Please make some example Table, fields, 2(?) records
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 6
Jurriaan Schulman Accepted Answer
Hello Ruslan,

If I want to map a directed graph in Valentina, what would be the best way to store/retrieve which is the tail (record) and which is the head (record) of a binary link between two records?

Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 7
Ruslan Zasukhin Accepted Answer
I have provide detailed answer in the new thread Graph Database with Valentina - ANSWER
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 8
Ruslan Zasukhin Accepted Answer
For now please use that private-private channel

Also we will try to setup BETA section for beta testers,
where we will be able discuss upcoming features.
I see Lynn already have create this category in this forum.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 9
Jurriaan Schulman Accepted Answer
Hello Ruslan,

I've read the linked article. Can I ask questions about it here?

Regards,

Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 10
Ruslan Zasukhin Accepted Answer
Please check your inbox on this forum,
I have sent URL there
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 11
Jurriaan Schulman Accepted Answer
Hello Ruslan,

yes, of course I would like to read the article.

Regards,

Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 12
Ruslan Zasukhin Accepted Answer
Hi Jurian,

We did good progress with KeyValue

Would you like read article in its current state?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 13
Ruslan Zasukhin Accepted Answer
Hi Jurriaan,

first point: about 10 years ago Nikon have choose Valentina DB for their photoApp.
They have use it few years at least.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 14
Jurriaan Schulman Accepted Answer
Hello Ruslan,

after reading the documentation, I have a few questions.

1) is it correct that if I want to do a hierarchical query with Valentina that this is only possible when the linked objects are of the same class (table)?

2) is it correct that I must use SQL for hierarchical queries (there are no API methods for this)?

3) is it correct that when I want to do a Hierarchical query on linked objetcs of different classes (link between tables), I have to implement this myself in the application code? Would it be possible to add methods for this in a future release of Valentina?

Cheers,

Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 15
Ruslan Zasukhin Accepted Answer
KeyValue should not be hard, so I can hope about 2 months...

than more, that here we not going invent something own,
we can just copy ideas of e.g. LevelDB.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 16
Ruslan Zasukhin Accepted Answer
Are you thinking about KeyValue as "objects" which can be linked with binary links?


Perfect question :)

Frankly saying I did not think so deeply yet.
In ideal we'd need to have some integration of this "thing" to others.

ANSWER: KeyValue storage can keep, as known, normal table with horizontal rows. So if we define some part of key as RecID, then we can use that in links.


2) We also thinking about adding into VDB

a) BinaryLinkWithOrder -- 80% done.

b) VARIANT - column type.

c) Inheritance

others ...

Just each such feature requires a lots of job and challenge :)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 17
Jurriaan Schulman Accepted Answer
Hi Ruslan,

thank you for your explanations, they were vere helpful. I think, Valentina is the right database for the projects I have in mind.

The KeyValue feature you mentioned sounds interesting. Are you thinking about KeyValue as "objects" which can be linked with binary links? If you decide to implement this feature, how long would it take before we can use it in Valentina? Months, years? ;)

Cheers,

Jurriaan
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 18
Ruslan Zasukhin Accepted Answer
About Links in a graph-DB.

I think it is obvious that not LevelDB, not MongoDB have this feature.
So they have implement it in some artificial way

The same step must be done in your case over relational Tables + Links.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 19
Ruslan Zasukhin Accepted Answer
I don't know if Valentina has optimzed algorithms to traverse such a graph and about the performance when using many records (objects) with many links to many other objects.



Well, I think our BINARY LINKS, and our feature todo Recursive Searches on any levels down, up, side, are so powerful, that not doubts here :)

Our BinaryLinks work faster than Relational ULONG - ULONG link based on PK-FK
Right?

And I always was and I am skeptical to KeyValue Storage as UNIVERSAL storage, to keep complex structures.

And I always was and I am skeptical to MongoDB, which keep data in TEXTUAL format of JSON. This can be faster of direct pointers? :)

Mongo have some win for special tasks, when one user have data, separate from data of other user. So they can scale to hardware. But excuse me, such scale you perfectly and easy can do with RDBMS (postgreSQL, mySQL, MS SQL, VDB).

Format of some file, such as JSON or XML, cannot be base of DB. Remember in about 2000 year how many noise was about XML-based databases, and how they will kill relational. Three times HA HA HA :) Where XML dbs today?

I think the same story expects the "JSON-boom".

Relational DBs will add COLOMN of JSON type, as some did with XML type, and that is enough.

XML/JSON - are text formats, perfectly can be used for exchange of data
BETWEEN DBs, DB and user, ...
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 20
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories