Tabnine Logo
GremlinPipeline.has
Code IndexAdd Tabnine to your IDE (free)

How to use
has
method
in
com.tinkerpop.gremlin.java.GremlinPipeline

Best Java code snippets using com.tinkerpop.gremlin.java.GremlinPipeline.has (Showing top 20 results out of 315)

origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Check if the element has a property with provided key.
 *
 * @param key the property key to check
 * @return the extended Pipeline
 */
public GremlinPipeline<S, ? extends Element> has(final String key) {
  return this.has(key, Tokens.T.neq, null);
}
origin: apache/incubator-atlas

  protected Pipe getQueryPipe() {
    return new GremlinPipeline().has(Constants.ENTITY_TEXT_PROPERTY_KEY).
        hasNot(Constants.ENTITY_TYPE_PROPERTY_KEY, "Taxonomy");
  }
}
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Add an IdFilterPipe, LabelFilterPipe, or PropertyFilterPipe to the end of the Pipeline.
 * If the incoming element has the provided key/value as check with .equals(), then let the element pass.
 * If the key is id or label, then use respect id or label filtering.
 *
 * @param key   the property key to check
 * @param value the object to filter on (in an OR manner)
 * @return the extended Pipeline
 */
public GremlinPipeline<S, ? extends Element> has(final String key, final Object value) {
  return this.has(key, Tokens.T.eq, value);
}
origin: apache/incubator-atlas

@Override
protected Pipe getQueryPipe() {
  GremlinPipeline p;
  if (guid.equals("*")) {
    p = new GremlinPipeline().has(Constants.ENTITY_TEXT_PROPERTY_KEY).
        hasNot(Constants.ENTITY_TYPE_PROPERTY_KEY, "Taxonomy").outE();
  } else {
    p = new GremlinPipeline().has(Constants.GUID_PROPERTY_KEY, guid).outE();
  }
  //todo: this is basically the same pipeline used in TagRelation.asPipe()
  p.add(new FilterFunctionPipe<>(new PipeFunction<Edge, Boolean>() {
    @Override
    public Boolean compute(Edge edge) {
      String type = edge.getVertex(Direction.OUT).getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY);
      VertexWrapper v = new TermVertexWrapper(edge.getVertex(Direction.IN));
      return edge.getLabel().startsWith(type) && v.getPropertyKeys().contains("available_as_tag");
    }
  }));
  return p.inV();
}
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Check if the element does not have a property with provided key.
 *
 * @param key the property key to check
 * @return the extended Pipeline
 */
public GremlinPipeline<S, ? extends Element> hasNot(final String key) {
  return this.has(key, Tokens.T.eq, null);
}
origin: pridkett/gitminer

has(PropertyName.TYPE, VertexType.REPOSITORY).
hasNot(PropertyName.FULLNAME, "/").dedup().
property(PropertyName.FULLNAME).
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Add an IdFilterPipe, LabelFilterPipe, or PropertyFilterPipe to the end of the Pipeline.
 * If the incoming element has the provided key/value as check with .equals(), then filter the element.
 * If the key is id or label, then use respect id or label filtering.
 *
 * @param key   the property key to check
 * @param value the objects to filter on (in an OR manner)
 * @return the extended Pipeline
 */
public GremlinPipeline<S, ? extends Element> hasNot(final String key, final Object value) {
  return this.has(key, Tokens.T.neq, value);
}
origin: apache/incubator-atlas

  @Override
  protected Pipe getQueryPipe() {
    return new GremlinPipeline().has("__typeName", "Taxonomy");
  }
}
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Add an IdFilterPipe, LabelFilterPipe, or PropertyFilterPipe to the end of the Pipeline.
 * If the incoming element has the provided key/value as check with .equals(), then let the element pass.
 * If the key is id or label, then use respect id or label filtering.
 *
 * @param key          the property key to check
 * @param compareToken the comparison to use
 * @param value        the object to filter on
 * @return the extended Pipeline
 */
public GremlinPipeline<S, ? extends Element> has(final String key, final Tokens.T compareToken, final Object value) {
  return this.has(key, Tokens.mapPredicate(compareToken), value);
}
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Add a GraphQueryPipe to the end of the Pipeline.
 * If optimizations are enabled, then the the next steps can fold into a GraphQueryPipe compilation.
 *
 * @param key   they key that all the emitted vertices should be checked on
 * @param value the value that all the emitted vertices should have for the key
 * @return the extended Pipeline
 */
public GremlinPipeline<S, Vertex> V(final String key, final Object value) {
  return this.add(new GraphQueryPipe(Vertex.class)).has(key, value);
}
origin: com.tinkerpop.gremlin/gremlin-java

/**
 * Add a GraphQueryPipe to the end of the Pipeline.
 * If optimizations are enabled, then the the next steps can fold into a GraphQueryPipe compilation.
 *
 * @param key   they key that all the emitted edges should be checked on
 * @param value the value that all the emitted edges should have for the key
 * @return the extended Pipeline
 */
public GremlinPipeline<S, Edge> E(final String key, final Object value) {
  return this.add(new GraphQueryPipe(Edge.class)).has(key, value);
}
origin: apache/incubator-atlas

  @Override
  protected Pipe getQueryPipe() {
    GremlinPipeline p;
    if (termPath.getTaxonomyName().equals("*")) {
      p = new GremlinPipeline().has("Taxonomy.name").out();
    } else {
      p = new GremlinPipeline().has("Taxonomy.name", termPath.getTaxonomyName()).out().
          has(Constants.ENTITY_TYPE_PROPERTY_KEY, Text.PREFIX, termPath.getFullyQualifiedName());
    }
    return p;
  }
}
origin: org.jboss.windup.rules.apps/rules-java

  @Override
  public void query(GraphRewrite event, GremlinPipeline<Vertex, Vertex> pipeline)
  {
    Predicate regexPredicate = new Predicate()
    {
      @Override
      public boolean evaluate(Object first, Object second)
      {
        return ((String) first).matches((String) second);
      }
    };
    pipeline.as("result")
          .out(FileReferenceModel.FILE_MODEL)
          .out(JavaSourceFileModel.JAVA_CLASS_MODEL)
          .has(JavaClassModel.QUALIFIED_NAME,
                regexPredicate,
                compiledTypeFilterPattern.pattern())
          .back("result");
  }
}
origin: org.jboss.windup.rules.apps/rules-java

public boolean isMavenConfiguration(XmlFileModel resource)
{
  return (new GremlinPipeline<Vertex, Vertex>(resource.asVertex())).in("xmlFacet").as("facet")
        .has(WindupVertexFrame.TYPE_PROP, this.getTypeValueForSearch()).back("facet")
        .iterator().hasNext();
}
origin: org.jboss.windup.rules.apps/rules-java

pipeline.has(WindupVertexFrame.TYPE_PROP, Text.CONTAINS, InlineHintModel.TYPE);
pipeline.out(InlineHintModel.FILE_LOCATION_REFERENCE).has(WindupVertexFrame.TYPE_PROP, Text.CONTAINS,
      JavaTypeReferenceModel.TYPE);
pipeline.back("inlineHintVertex");
origin: org.jboss.windup.rules.apps/rules-java

public MavenProjectModel getMavenConfigurationFromResource(XmlFileModel resource)
{
  @SuppressWarnings("unchecked")
  Iterator<Vertex> v = (Iterator<Vertex>) (new GremlinPipeline<Vertex, Vertex>(resource.asVertex()))
        .in("xmlFacet").as("facet")
        .has(WindupVertexFrame.TYPE_PROP, this.getTypeValueForSearch()).back("facet")
        .iterator();
  if (v.hasNext())
  {
    return getGraphContext().getFramed().frame(v.next(), this.getType());
  }
  return null;
}
origin: apache/incubator-atlas

@Override
public Pipe asPipe() {
  //todo: encapsulate all of this path logic including path sep escaping and normalizing
  final int sepIdx = getField().indexOf(QueryFactory.PATH_SEP_TOKEN);
  final String edgeToken = getField().substring(0, sepIdx);
  GremlinPipeline pipeline = new GremlinPipeline();
  Relation relation = resourceDefinition.getRelations().get(fieldSegments[0]);
  if (relation != null) {
    pipeline = pipeline.outE();
    pipeline.add(relation.asPipe()).inV();
  } else {
    if (resourceDefinition.getProjections().get(fieldSegments[0]) != null) {
      return super.asPipe();
    } else {
      //todo: default Relation implementation
      pipeline = pipeline.outE().has("label", Text.REGEX, String.format(".*\\.%s", edgeToken)).inV();
    }
  }
  //todo: set resource definition from relation on underlying expression where appropriate
  String childFieldName = getField().substring(sepIdx + QueryFactory.PATH_SEP_TOKEN.length());
  underlyingExpression.setField(childFieldName);
  Pipe childPipe;
  if (childFieldName.contains(QueryFactory.PATH_SEP_TOKEN)) {
    childPipe = new ProjectionQueryExpression(underlyingExpression, resourceDefinition).asPipe();
  } else {
    childPipe = underlyingExpression.asPipe();
  }
  pipeline.add(childPipe);
  return negate ? new FilterFunctionPipe(new ExcludePipeFunction(pipeline)) : pipeline;
}
origin: org.jboss.windup.rules.apps/rules-java-ee

  @Override
  public void query(GraphRewrite event, GremlinPipeline<Vertex, Vertex> pipeline)
  {
    pipeline.has(DoctypeMetaModel.PROPERTY_PUBLIC_ID, Text.REGEX, hibernateRegex);
    FramedGraphQuery systemIDQuery = event.getGraphContext().getQuery().type(DoctypeMetaModel.class)
          .has(DoctypeMetaModel.PROPERTY_SYSTEM_ID, Text.REGEX, hibernateRegex);
    GremlinPipeline<Vertex, Vertex> systemIdPipeline = new GremlinPipeline<>(systemIDQuery.vertices());
    pipeline.add(systemIdPipeline);
    pipeline.dedup();
  }
};
origin: pridkett/gitminer

userList = pipe.start(repo).out(EdgeType.PULLREQUEST).
   out(EdgeType.PULLREQUESTDISCUSSION).in().
   has(PropertyName.TYPE, VertexType.USER).dedup().toList();
log.info("Discussion users: {}", userList.size());
users.addAll(userList);
origin: org.jboss.windup.rules.apps/rules-java-ee

  @Override
  public void query(GraphRewrite event, GremlinPipeline<Vertex, Vertex> pipeline)
  {
    pipeline.has(DoctypeMetaModel.PROPERTY_PUBLIC_ID, Text.REGEX, hibernateRegex);
    FramedGraphQuery systemIDQuery = event.getGraphContext().getQuery().type(DoctypeMetaModel.class)
          .has(DoctypeMetaModel.PROPERTY_SYSTEM_ID, Text.REGEX, hibernateRegex);
    GremlinPipeline<Vertex, Vertex> systemIdPipeline = new GremlinPipeline<>(systemIDQuery.vertices());
    pipeline.add(systemIdPipeline);
    pipeline.dedup();
  }
};
com.tinkerpop.gremlin.javaGremlinPipelinehas

Javadoc

Check if the element has a property with provided key.

Popular methods of GremlinPipeline

  • <init>
  • out
    Add an OutPipe to the end of the Pipeline. Emit the adjacent outgoing vertices of the incoming verte
  • in
    Add a InPipe to the end of the Pipeline. Emit the adjacent incoming vertices for the incoming vertex
  • add
    Add an arbitrary pipe to the GremlinPipeline
  • as
    Wrap the previous step in an AsPipe. Useful for naming steps and is used in conjunction with various
  • iterator
  • back
    Add a BackFilterPipe to the end of the Pipeline. The object that was seen namedSteps ago is emitted.
  • both
    Add a BothPipe to the end of the Pipeline. Emit both the incoming and outgoing adjacent vertices for
  • dedup
    Add a DuplicateFilterPipe to the end of the Pipeline. Will only emit the object if the object genera
  • hasNot
    Add an IdFilterPipe, LabelFilterPipe, or PropertyFilterPipe to the end of the Pipeline. If the incom
  • outE
    Add an OutEdgesPipe to the end of the Pipeline. Emit the outgoing edges for the incoming vertex.
  • toList
    Return a list of all the objects in the pipeline.
  • outE,
  • toList,
  • V,
  • _,
  • addPipe,
  • aggregate,
  • bothE,
  • count,
  • enablePath

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • Menu (java.awt)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now