org.vertexium.Graph.getPropertyDefinition()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.vertexium.Graph.getPropertyDefinition()方法的一些代码示例,展示了Graph.getPropertyDefinition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getPropertyDefinition()方法的具体详情如下:
包路径:org.vertexium.Graph
类名称:Graph
方法名:getPropertyDefinition

Graph.getPropertyDefinition介绍

[英]Gets the property definition for the given name.
[中]获取给定名称的属性定义。

代码示例

代码示例来源:origin: visallo/vertexium

protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) {
  propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName);
  return graph.getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch5

protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) {
  propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName);
  return graph.getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument

protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) {
  propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName);
  return graph.getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch5

protected PropertyDefinition getPropertyDefinition(String propertyName) {
  return getGraph().getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch2

protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) {
  propertyName = inflatePropertyNameWithTypeSuffix(propertyName);
  return graph.getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch2

protected PropertyDefinition getPropertyDefinition(String propertyName) {
  return getGraph().getPropertyDefinition(propertyName);
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument

protected PropertyDefinition getPropertyDefinition(String propertyName) {
  return getGraph().getPropertyDefinition(propertyName);
}

代码示例来源:origin: visallo/vertexium

protected PropertyDefinition getPropertyDefinition(String propertyName) {
  return getGraph().getPropertyDefinition(propertyName);
}

代码示例来源:origin: visallo/vertexium

private List<String> getFieldNames(
      Graph graph,
      Elasticsearch5SearchIndex searchIndex,
      QueryParameters queryParameters,
      String field
  ) {
    PropertyDefinition propertyDefinition = graph.getPropertyDefinition(field);
    if (propertyDefinition == null) {
      return null;
    }
    if (!searchIndex.isPropertyInIndex(graph, field)) {
      return null;
    }

    String[] propertyNames = searchIndex.getPropertyNames(
        graph,
        propertyDefinition.getPropertyName(),
        queryParameters.getAuthorizations()
    );
    return Arrays.stream(propertyNames)
        .filter(propertyName -> Number.class.isAssignableFrom(propertyDefinition.getDataType()))
        .collect(Collectors.toList());
  }
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch5

private List<String> getFieldNames(
      Graph graph,
      Elasticsearch5SearchIndex searchIndex,
      QueryParameters queryParameters,
      String field
  ) {
    PropertyDefinition propertyDefinition = graph.getPropertyDefinition(field);
    if (propertyDefinition == null) {
      return null;
    }
    if (!searchIndex.isPropertyInIndex(graph, field)) {
      return null;
    }

    String[] propertyNames = searchIndex.getPropertyNames(
        graph,
        propertyDefinition.getPropertyName(),
        queryParameters.getAuthorizations()
    );
    return Arrays.stream(propertyNames)
        .filter(propertyName -> Number.class.isAssignableFrom(propertyDefinition.getDataType()))
        .collect(Collectors.toList());
  }
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch5

private List<String> getFieldNames(
      Graph graph,
      Elasticsearch5SearchIndex searchIndex,
      QueryParameters queryParameters,
      String field
  ) {
    PropertyDefinition propertyDefinition = graph.getPropertyDefinition(field);
    if (propertyDefinition == null) {
      return null;
    }
    if (!searchIndex.isPropertyInIndex(graph, field)) {
      return null;
    }
    if (!searchIndex.supportsExactMatchSearch(propertyDefinition)) {
      return null;
    }

    String[] propertyNames = searchIndex.getPropertyNames(
        graph,
        propertyDefinition.getPropertyName(),
        queryParameters.getAuthorizations()
    );
    return Arrays.stream(propertyNames)
        .filter(propertyName -> String.class.isAssignableFrom(propertyDefinition.getDataType()))
        .map(propertyName -> propertyName + Elasticsearch5SearchIndex.EXACT_MATCH_PROPERTY_NAME_SUFFIX)
        .collect(Collectors.toList());
  }
}

代码示例来源:origin: visallo/vertexium

private List<String> getFieldNames(
      Graph graph,
      Elasticsearch5SearchIndex searchIndex,
      QueryParameters queryParameters,
      String field
  ) {
    PropertyDefinition propertyDefinition = graph.getPropertyDefinition(field);
    if (propertyDefinition == null) {
      return null;
    }
    if (!searchIndex.isPropertyInIndex(graph, field)) {
      return null;
    }
    if (!searchIndex.supportsExactMatchSearch(propertyDefinition)) {
      return null;
    }

    String[] propertyNames = searchIndex.getPropertyNames(
        graph,
        propertyDefinition.getPropertyName(),
        queryParameters.getAuthorizations()
    );
    return Arrays.stream(propertyNames)
        .filter(propertyName -> String.class.isAssignableFrom(propertyDefinition.getDataType()))
        .map(propertyName -> propertyName + Elasticsearch5SearchIndex.EXACT_MATCH_PROPERTY_NAME_SUFFIX)
        .collect(Collectors.toList());
  }
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument

protected void applySort(SearchRequestBuilder q) {
  for (SortContainer sortContainer : getParameters().getSortContainers()) {
    SortOrder esOrder = sortContainer.direction == SortDirection.ASCENDING ? SortOrder.ASC : SortOrder.DESC;
    if (Element.ID_PROPERTY_NAME.equals(sortContainer.propertyName)) {
      q.addSort("_uid", esOrder);
    } else if (Edge.LABEL_PROPERTY_NAME.equals(sortContainer.propertyName)) {
      q.addSort(ElasticsearchSingleDocumentSearchIndex.EDGE_LABEL_FIELD_NAME, esOrder);
    } else {
      PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName);
      if (propertyDefinition == null) {
        continue;
      }
      if (!getSearchIndex().isPropertyInIndex(getGraph(), sortContainer.propertyName)) {
        continue;
      }
      if (!propertyDefinition.isSortable()) {
        throw new VertexiumException("Cannot sort on non-sortable fields");
      }
      q.addSort(propertyDefinition.getPropertyName() + ElasticsearchSingleDocumentSearchIndex.SORT_PROPERTY_NAME_SUFFIX, esOrder);
    }
  }
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch2

protected void applySort(SearchRequestBuilder q) {
  for (SortContainer sortContainer : getParameters().getSortContainers()) {
    SortOrder esOrder = sortContainer.direction == SortDirection.ASCENDING ? SortOrder.ASC : SortOrder.DESC;
    if (Element.ID_PROPERTY_NAME.equals(sortContainer.propertyName)) {
      q.addSort("_uid", esOrder);
    } else if (Edge.LABEL_PROPERTY_NAME.equals(sortContainer.propertyName)) {
      q.addSort(Elasticsearch2SearchIndex.EDGE_LABEL_FIELD_NAME, esOrder);
    } else {
      PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName);
      if (propertyDefinition == null) {
        continue;
      }
      if (!getSearchIndex().isPropertyInIndex(getGraph(), sortContainer.propertyName)) {
        continue;
      }
      if (!propertyDefinition.isSortable()) {
        throw new VertexiumException("Cannot sort on non-sortable fields");
      }
      q.addSort(propertyDefinition.getPropertyName() + Elasticsearch2SearchIndex.SORT_PROPERTY_NAME_SUFFIX, esOrder);
    }
  }
}

代码示例来源:origin: org.visallo/visallo-core

PropertyDefinition propertyDefinition = graph.getPropertyDefinition(propertyName);
if (propertyDefinition.getDataType() != dataType) {
  LOGGER.warn("Ontology property type mismatch for property %s! Expected %s but found %s",

代码示例来源:origin: org.vertexium/vertexium-elasticsearch5

);
} else {
  PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName);
  if (propertyDefinition == null) {
    continue;

代码示例来源:origin: visallo/vertexium

);
} else {
  PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName);
  if (propertyDefinition == null) {
    continue;

代码示例来源:origin: visallo/vertexium

timeout.start();
while (timeout.getTime() < 5000) {
  assertNotNull("Property definition cache shouldn't clear", graph1.getPropertyDefinition("p1"));
  PropertyDefinition def = graph2.getPropertyDefinition("p1");
  if (def != null) {
    LOGGER.debug("Propagation to graph #2 took %d ms", timeout.getTime());
assertNotNull("Property definition didn't propagate to graph #2", graph2.getPropertyDefinition("p1"));
assertTrue(graph1.getPropertyDefinition("p1").isSortable());
assertTrue(graph2.getPropertyDefinition("p1").isSortable());
assertFalse(graph2.getPropertyDefinition("p1").isSortable());
  PropertyDefinition def = graph1.getPropertyDefinition("p1");
  if (def != null && !def.isSortable()) {
    LOGGER.debug("Propagation to graph #1 took %d ms", timeout.getTime());

代码示例来源:origin: org.vertexium/vertexium-elasticsearch2

PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(inflatedPropertyName);
if (propertyDefinition != null && propertyDefinition.getDataType() == GeoCircle.class) {
  ShapeBuilder shapeBuilder = ShapeBuilder.newCircleBuilder()
PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(inflatedPropertyName);
if (propertyDefinition != null && propertyDefinition.getDataType() == GeoCircle.class) {
  ShapeBuilder shapeBuilder = ShapeBuilder.newPolygon()

相关文章

微信公众号

最新文章

更多