Search in sources :

Example 11 with Value

use of org.neo4j.driver.v1.Value in project cypher-for-gremlin by opencypher.

the class GremlinCypherValueConverter method toCypherPath.

@SuppressWarnings("unchecked")
private static Value toCypherPath(List p) {
    boolean isNode = true;
    Entity[] objects = new Entity[p.size()];
    for (int i = 0; i < p.size(); i++) {
        if (isNode) {
            objects[i] = toCypherNode((Map<?, ?>) p.get(i));
        } else {
            objects[i] = toCypherRelationship((Map<?, ?>) p.get(i));
        }
        isNode = !isNode;
    }
    return new InternalPath(objects).asValue();
}
Also used : Entity(org.neo4j.driver.v1.types.Entity) InternalPath(org.neo4j.driver.internal.InternalPath) HashMap(java.util.HashMap) Map(java.util.Map)

Example 12 with Value

use of org.neo4j.driver.v1.Value in project neo4j-apoc-procedures by neo4j-contrib.

the class Bolt method toNode.

private Object toNode(Object value, boolean virtual, Map<Long, Object> nodesCache) {
    Value internalValue = ((InternalEntity) value).asValue();
    Node node = internalValue.asNode();
    if (virtual) {
        List<Label> labels = new ArrayList<>();
        node.labels().forEach(l -> labels.add(Label.label(l)));
        VirtualNode virtualNode = new VirtualNode(node.id(), labels.toArray(new Label[0]), node.asMap(), db);
        nodesCache.put(node.id(), virtualNode);
        return virtualNode;
    } else
        return Util.map("entityType", internalValue.type().name(), "labels", node.labels(), "id", node.id(), "properties", node.asMap());
}
Also used : InternalEntity(org.neo4j.driver.internal.InternalEntity) VirtualNode(apoc.result.VirtualNode) VirtualNode(apoc.result.VirtualNode) Node(org.neo4j.driver.v1.types.Node) Label(org.neo4j.graphdb.Label)

Aggregations

Value (com.google.privacy.dlp.v2.Value)5 Arrays (java.util.Arrays)5 Collectors (java.util.stream.Collectors)5 ServiceOptions (com.google.cloud.ServiceOptions)4 DlpServiceClient (com.google.cloud.dlp.v2.DlpServiceClient)4 FieldId (com.google.privacy.dlp.v2.FieldId)4 InfoType (com.google.privacy.dlp.v2.InfoType)4 ProjectName (com.google.privacy.dlp.v2.ProjectName)4 SettableApiFuture (com.google.api.core.SettableApiFuture)3 Subscriber (com.google.cloud.pubsub.v1.Subscriber)3 Action (com.google.privacy.dlp.v2.Action)3 PublishToPubSub (com.google.privacy.dlp.v2.Action.PublishToPubSub)3 AnalyzeDataSourceRiskDetails (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails)3 CategoricalStatsHistogramBucket (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket)3 KAnonymityResult (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult)3 KAnonymityEquivalenceClass (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass)3 KAnonymityHistogramBucket (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket)3 KMapEstimationResult (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult)3 KMapEstimationHistogramBucket (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket)3 KMapEstimationQuasiIdValues (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues)3