当前位置: 首页>>代码示例>>Java>>正文


Java GraphQuery.has方法代码示例

本文整理汇总了Java中com.tinkerpop.blueprints.GraphQuery.has方法的典型用法代码示例。如果您正苦于以下问题:Java GraphQuery.has方法的具体用法?Java GraphQuery.has怎么用?Java GraphQuery.has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tinkerpop.blueprints.GraphQuery的用法示例。


在下文中一共展示了GraphQuery.has方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVertices

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
/**
 * Gets the specified vertices or null if no such vertex is found
 *
 * @param label     vertex type label
 * @param limit     int value limiting the result. use Integer.MAX_VALUE for unlimited
 * @param pValueMap PropertyKey->Value map
 * @return the specified vertices or null if no such vertex is found
 */
public Iterable<Vertex> getVertices(String label, Map<String, String> pValueMap, int limit) throws SchemaViolationException {
    Integer suffix = s.getVertexTypes().get(label);
    Set<Vertex> res = new HashSet<>();
    if (suffix == null)
        throw new SchemaViolationException(label + " vertex type is not defined in the schema for " + s.getClass().getSimpleName());
    GraphQuery gq = g.query();
    for (String property : pValueMap.keySet())
        gq = gq.has(property, pValueMap.get(property));
    if (limit != Integer.MAX_VALUE)
        gq = gq.limit(limit);

    for (Vertex v : gq.vertices())
        if ((((Long) v.getId()) % mult) == suffix)
            res.add(v);

    return res;
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:26,代码来源:TitanFTMDb.java

示例2: processNextStart

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
public E processNextStart() {
    while (true) {
        if (this.count >= this.highRange) {
            throw FastNoSuchElementException.instance();
        } else if (this.currentIterator.hasNext()) {
            this.count++;
            final E e = currentIterator.next();
            if (this.count > this.lowRange)
                return e;
        } else {
            final Graph graph = this.starts.next();
            GraphQuery query = graph.query();
            if (null != this.hasContainers) {
                for (final HasContainer hasContainer : this.hasContainers) {
                    query = query.has(hasContainer.key, hasContainer.predicate, hasContainer.value);
                }
            }
            if (null != this.intervalContainers) {
                for (final IntervalContainer intervalContainer : this.intervalContainers) {
                    query = query.interval(intervalContainer.key, intervalContainer.startValue, intervalContainer.endValue);
                }
            }
            if (this.highRange != Integer.MAX_VALUE) {
                query = query.limit(this.highRange - this.count);
            }

            this.currentIterator = this.elementClass.equals(Vertex.class) ?
                    (Iterator<E>) query.vertices().iterator() :
                    (Iterator<E>) query.edges().iterator();
        }
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:33,代码来源:GraphQueryPipe.java

示例3: testGraphQueryHas

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
@Test
public void testGraphQueryHas() {
	GraphQuery q = graph.query();
	q.has("x");

	assertEquals(1, countResults(q.vertices()));
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:8,代码来源:ArangoGraphQueryTest.java

示例4: testGraphQueryHas2

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
@Test
public void testGraphQueryHas2() {
	GraphQuery q = graph.query();
	q.has("x");
	q.has("a");

	assertEquals(0, countResults(q.vertices()));
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:9,代码来源:ArangoGraphQueryTest.java

示例5: testGraphQueryHas3

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
@Test
public void testGraphQueryHas3() {
	GraphQuery q = graph.query();
	q.has("i");
	q.has("a");

	assertEquals(1, countResults(q.vertices()));
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:9,代码来源:ArangoGraphQueryTest.java

示例6: HistoricGraphQuery

import com.tinkerpop.blueprints.GraphQuery; //导入方法依赖的package包/类
/**
 * Create instance
 * 
 * @param hg associated graph
 * @param query query instance to be wrapped
 */
public HistoricGraphQuery(HistoricVersionedGraph<?, V> hg, GraphQuery query) {
    super(query.has(VEProps.HISTORIC_ELEMENT_PROP_KEY, true));
    this.hg = hg;
}
 
开发者ID:indexiatech,项目名称:antiquity,代码行数:11,代码来源:HistoricGraphQuery.java


注:本文中的com.tinkerpop.blueprints.GraphQuery.has方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。