protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) { propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName); return graph.getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) { propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName); return graph.getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) { propertyName = removeVisibilityFromPropertyNameWithTypeSuffix(propertyName); return graph.getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(String propertyName) { return getGraph().getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(Graph graph, String propertyName) { propertyName = inflatePropertyNameWithTypeSuffix(propertyName); return graph.getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(String propertyName) { return getGraph().getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(String propertyName) { return getGraph().getPropertyDefinition(propertyName); }
protected PropertyDefinition getPropertyDefinition(String propertyName) { return getGraph().getPropertyDefinition(propertyName); }
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()); } }
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()); } }
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()); } }
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()); } }
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); } } }
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); } } }
PropertyDefinition propertyDefinition = graph.getPropertyDefinition(propertyName); if (propertyDefinition.getDataType() != dataType) { LOGGER.warn("Ontology property type mismatch for property %s! Expected %s but found %s",
); } else { PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName); if (propertyDefinition == null) { continue;
); } else { PropertyDefinition propertyDefinition = getGraph().getPropertyDefinition(sortContainer.propertyName); if (propertyDefinition == null) { continue;
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());
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()