简体   繁体   中英

What is the difference between triplestores and graph databases?

There are triplestores (semantic databases), and there are general-purpose graph databases.

Both are based on the similar concepts of linking one "item" to another via a relationship. Triplestores support RDF and are queried by SPARQL, but such add-ons can be (and are) implemented ontop of general-purpose graph databases as well.

What is the fundamental difference that would make you prefer a semantic db / triplestore to a general purpose graph database like neo4j?

Triples stores are graph databases. RDF is a graph. Granted, triple stores tend to not store the information internally as a graph; that's sub-optimal for query answering, but they're still graph databases.

You'd prefer them to something like neo4j if you're interested in an ecosystem based on W3C standards. Makes interop with other RDF-based systems trivial, and it makes picking up everything and moving to a different triple store quite painless.

To start with, besically all data-structures can be projected more or less painful into any underlying storage engine (or even your file system and text files). The reason to choose a certain data model and storage backend are IMHO:

  • your development and modelling preferences
  • your expected runtime performance for inserting, storing, and querying of your model.

As mentioned before, both RDBMSes and TripleStores tend to be useful at runtime in "shallow" traversing of JOIN or SparQL traversals, and do much work in caches or prepared views etc. Graph Databases (uniquely Neo4j) put the graph structure actually down to the storage layer and do pointer chasing (with a number of optimizations) on node-record level. Thus, when traversing the graph, you don't need to touch more than your current subgraph down to the storage layer, thus being able to traverse parts of the data without touching the whole graph, resulting in constant performance for a number of interesting scenarios.

My 2 cents.

Neo4j comes under the category of Property Graph. They support directed relations and each relation has only two nodes; the start node and end node. The nodes and relationships can store arbitrary data in the form of key-value pairs. They however can't support 3-ary relations. ie You can't have one edge connecting more than two nodes ie a kind of hyperdege . You can however emulate a 3-ary relations in property graphs by creating join nodes. You can see how to implement this in neo4j here .

Triplestores have standardized query language in the form of SPARQL but no standard exists yet for querying other graph databases. RDF is the standard for importing/exporting from triplestores.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM