Skip to content

Neo4jGraph

Eugenia Oshurko edited this page Dec 6, 2018 · 4 revisions

Neo4jGraph

Encoding of typed attribute graphs with property graphs

We would like to build a system based on the property graph model, that would allow us to represent typed attribute graphs and to perform SqPO rewriting and propagation on these graphs using a database query language.

We would like for our framework to provide means for definition of graphs, graph typing, rewriting rules and instances of these rules inside of graphs, which relies greatly on definition of a graph homomorphism. Therefore, we need to provide tools for defining meaningful and unambiguous maps from the elements of one graph to the elements of another (nodes for simple graphs and nodes and edges for non-simple ones). These elements should possess application-level identifiers.

Namespaces

Instead of using labels to type nodes, we would like to use them for defining disjoint namespaces for identifiers of graph elements.

Identifiers for graph elements.

For all elements of a property graph (both nodes and edges) Neo4j generates unique internal identifiers. However, these identifiers are unsuitable for our purposes of defining. One of the main reasons for for that is due to the fact the user has virtually no control over them, i.e. they are automatically allocated, can be reassigned in some particular scenarios, and as the result. Using them as reference identifiers in our system can cause dangling reference problems. Therefore, in the concrete implementation of attribute graphs the value of the property id is reserved and chosen to encode such an identifier. We also create the uniqueness constraint on the values of this property for every namespace

CREATE CONSTRAINT ON (n:<namespace>) ASSERT n.id IS UNIQUE