Multiple edges of same type between vertices

Coming from an LPG background, I'm wondering how Stardog models multiple edges of the same type between two vertices. In an LPG, each edge has its own id, which allows me to retrieve the edge and its properties.

Example. When I want to store two transactions between the same bank accounts, and I do this:

:a :transaction {:amount 10
             :currency :USD } :b .
:a :transaction {:amount 20
             :currency :EUR } :b .

it is my understanding that it will not work, since

:a transaction :b  

is not sufficient to identify the transaction.

So, should I define each transaction as a " vertex" ? Or are there other options?


Yes, modelling transactions as vertices would be the most standard way to achieve that in RDF. Then each tx will have an IRI so you can attach the additional triples to it (amount and currency).

RDF* support in Stardog does allow for properties on edges in the LPG style but still not for multiple triples with the same S, P, and O components (in the same graph anyway).


Thanks Pavel for your quick reply.

You write "still not" . Is there a construct on your roadmap that would allow this without creating vertices? Some background:

We at Graphileon model application logic in an LPG, and we have many of these cases, (including self-relations) like in this screenshot:

So, creating vertices for all these edges would make modelling a lot less intuitive.

Sorry for the delay. No, that option isn't on the roadmap. Triples in RDF have no other identity other than the combination of their S, P, and O components.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.