All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.neo4j.cypher.export.DatabaseSubGraph Maven / Gradle / Ivy

There is a newer version: 5.25.1
Show newest version
package org.neo4j.cypher.export;

import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.schema.ConstraintDefinition;
import org.neo4j.graphdb.schema.IndexDefinition;

import java.util.Iterator;

import static apoc.export.cypher.formatter.CypherFormatterUtils.cypherNode;
import static apoc.util.Util.quote;

public class DatabaseSubGraph implements SubGraph
{
    private final Transaction transaction;

    public DatabaseSubGraph( Transaction transaction )
    {
        this.transaction = transaction;
    }

    @Override
    public Iterable getNodes()
    {
        return transaction.getAllNodes();
    }

    @Override
    public Iterable getRelationships()
    {
        return transaction.getAllRelationships();
    }

    @Override
    public Iterable getIndexes()
    {
        return transaction.schema().getIndexes();
    }

    @Override
    public Iterable getConstraints(Label label) {
        return transaction.schema().getConstraints(label);
    }

    @Override
    public Iterable getConstraints(RelationshipType type) {
        return transaction.schema().getConstraints(type);
    }

    @Override
    public Iterable getIndexes(Label label) {
        return transaction.schema().getIndexes(label);
    }

    @Override
    public Iterable getIndexes(RelationshipType type) {
        return transaction.schema().getIndexes(type);
    }

    @Override
    public Iterable getAllRelationshipTypesInUse() {
        return transaction.getAllRelationshipTypesInUse();
    }

    @Override
    public Iterable




© 2015 - 2024 Weber Informatics LLC | Privacy Policy