This project has moved. For the latest updates, please go here.

Attributes on Edges or relationships?

Aug 16, 2014 at 4:57 PM
Is it possible it possible to store attributes on edges or relationships between objects?

For example, I have a list of users and a list of pictures, I'd like to have a relationship between a user and the pictures and in that relationship track when the have viewed or shared the picture and if they have shared the picture which user the shared it with.
Coordinator
Aug 17, 2014 at 3:19 PM
Hi,

BrightstarDB is based on RDF and RDF does not support attributes on edges. Typically however you can create a model that does away with the need for attributes on edges - the most common means of doing this is to turn the edge into a resource (i.e. something with its own URI). In your case I would say that you could either do that or simply extend the metadata on a picture so that you track the owner of the picture as one property and the list of people that the picture is shared with as another property.

Cheers

Kal
Aug 18, 2014 at 12:30 PM
Hmm, you are absolutely right, I could do that -- but I was hoping to not have to. I was looking for a directed graph database that was native to .NET that would allow me to add information and metadata not only to the nodes but also to the edges as this provides a more natural way of modeling a complex environment and in turn "asking questions" of the model.

For example: How many users have shared a picture more than X times between A and B (date time) and the picture was not taken by themselves.

Any thought to adding support for metadata on edges?
Coordinator
Aug 19, 2014 at 7:36 AM
I wouldn't add support for metadata on edges unless the RDF model changed to support that. SPARQL is our underlying query language (even if you use LINQ), and SPARQL is tied to the RDF model it would be impossible to add support for querying such metadata without introducing non-standard extensions to the SPARQL query language.
Aug 19, 2014 at 11:59 AM
Ok, that makes sense. Might be worth talking to the RDF maintainers to think about something like this in the future.
Aug 20, 2014 at 9:10 PM
techquila wrote:
Typically however you can create a model that does away with the need for attributes on edges - the most common means of doing this is to turn the edge into a resource (i.e. something with its own URI).
+1

If an edge is important enough that it needs properties then it should be a first class resource