Big Data Lecture 13 Graph Databases Flashcards
What properties does a well-defined query language have? Why?
<div>It must be</div>
<ul><li>declarative (hidden what it does),</li><li>functional (composable).</li></ul>
So that we can parralelize the query, optimize behind the scenes. It makes it more concise and readable.<br></br>
Why do we use graph databases?
So that we can avoid expensive joins on multiple tables when we query!
How are data linked in a graph database?
Using pointers, that is fast.
What are the two families of graph databases?
Labeled property graphs, and triple stores.
How can we represent graph connectivity in memory?
Using adjancency matrix, or incidence graph (nodes x edges: 1 = in, -1 = out, 0 = nothing).
How is data stored in Labeled Property Graphs?
Both edges and nodes can have properties (flat table) and labels.
What extra datatypes are in Cypher?
Node, Relationship and Path.
Is there order between types in neo4j?
Yes!
What does Null mean in Neo4j?
Absent data!
How do we query data on graphs?
We use pattern matching for values and edges!
How is data sharded in Neo4j?
In overlapping shards, so that we have time to load them when chasing the pointers. But for all we know its all difficult and complicated.
How are edges for one node stored in memory?
As a linked list, which allows for fast querying.
What are triple stores?
Data is stored in tripples (subject)-(property)-(object), where object can be left empty. And subject, or property cannot be literal.
What formats are there for triple store?
<ol><li>RDF/XML,</li><li>Turtle,</li><li>JSON-LD,</li><li>RDFa,</li><li>N-Triples.</li></ol>
What are query languages for graph databases?
Cypher and SPARQL.
What were graph databases used for in AI historically?
We can build ontologies on top of them, on which we can run logical entailments. For example OWL, or OWL2.