Creates an index in the neo4j database.

@param label        The label associated with the Index.
@param propertyName The property name associated with the Index.
340144
public void createIndex(String label, String propertyName) {
        Objects.requireNonNull(label, "label cannot be null");
        Objects.requireNonNull(propertyName, "propertyName cannot be null");
        // get current session
        Neo4JSession session = currentSession();
        // transaction should be ready for io operations
        transaction.readWrite();
        // execute statement
        session.executeStatement(new Statement("CREATE INDEX ON :`" + label + "`(" + propertyName + ")"));
    }
979429
public Optional<Label> createLabel(String monitorId, Label label)
    {
        HTTP.POST(String.format("/v1/monitors/%s/labels", monitorId), label.getKey());
        return Optional.of(label);
    }
385613
public void addPropertyColumn(String propertyName, Class propertyType, TableCellEditor editor)
    {
        addPropertyColumn(propertyName).withEditor(editor);
    }
599366
private String getPropertyLabel(PropertyIdValue propertyIdValue) {
		PropertyRecord propertyRecord = this.propertyRecords
				.get(propertyIdValue);
		if (propertyRecord == null || propertyRecord.propertyDocument == null) {
			return propertyIdValue.getId();
		} else {
			return getLabel(propertyIdValue, propertyRecord.propertyDocument);
		}
	}
885440
public void buildTagInfo(XMLNode node, Content propertyDocTree) {
        writer.addTags((MethodDoc) properties.get(currentPropertyIndex), propertyDocTree);
    }
301181
protected function addProperty($nodeType, $propertyName, array $propertyConfiguration)
    {
        if (isset($this->properties[$propertyName])) {
            $this->properties[$propertyName]->domains[] = $nodeType;
        } else {
            $propertyLabel = isset($propertyConfiguration['ui']['label']) ? $propertyConfiguration['ui']['label'] : $propertyName;
            $this->properties[$propertyName] = (object) [
                'comment' => $propertyLabel,
                'comment_plain' => $propertyLabel,
                'domains' => [$nodeType],
                'id' => $propertyName,
                'label' => $propertyName,
                'ranges' => [],
                'min' => 0,
                'max' => -1
            ];
        }
    }
1251373
@Procedure(mode = Mode.WRITE)
	@Description("apoc.refactor.rename.label(oldLabel, newLabel, [nodes]) | rename a label from 'oldLabel' to 'newLabel' for all nodes. If 'nodes' is provided renaming is applied to this set only")
	public Stream<BatchAndTotalResultWithInfo> label(@Name("oldLabel") String oldLabel, @Name("newLabel") String newLabel, @Name(value = "nodes", defaultValue = "") List<Node> nodes) {
		String cypherIterate = nodes != null && !nodes.isEmpty() ? "UNWIND {nodes} AS n WITH n WHERE n:`"+oldLabel+"` RETURN n" : "MATCH (n:`"+oldLabel+"`) RETURN n";
        String cypherAction = "SET n:`"+newLabel+"` REMOVE n:`"+oldLabel+"`";
        Map<String, Object> parameters = MapUtil.map("batchSize", 100000, "parallel", true, "iterateList", true, "params", MapUtil.map("nodes", nodes));
		return getResultOfBatchAndTotalWithInfo( newPeriodic().iterate(cypherIterate, cypherAction, parameters), db, oldLabel, null, null);
	}
983832
public static String formatAllLabels(Node node, Map<String, Set<String>> uniqueConstraints, Set<String> indexNames) {
        StringBuilder result = new StringBuilder(100);
        boolean uniqueLabelFound = false;
        List<String> list = getLabelsSorted(node);

        for (String labelName : list) {
            uniqueLabelFound = isUniqueLabelFound(node, uniqueConstraints, labelName);
            if (indexNames != null && indexNames.contains(labelName))
                result.insert(0, label(labelName));
            else
                result.append(label(labelName));
        }
        if (!uniqueLabelFound) {
            result.append(label(UNIQUE_ID_LABEL));
        }
        return result.toString();
    }
405939
public void buildSignature(XMLNode node, Content propertyDocTree) {
        propertyDocTree.addContent(
                writer.getSignature((MethodDoc) properties.get(currentPropertyIndex)));
    }
1315835
private IndexConstraintNodeInfo nodeInfoFromIndexDefinition(IndexReference indexReference, SchemaRead schemaRead, TokenNameLookup tokens){
        int[] labelIds = indexReference.schema().getEntityTokenIds();
        if (labelIds.length != 1) throw new IllegalStateException("Index with more than one label");
        String labelName =  tokens.labelGetName(labelIds[0]);
        List<String> properties = new ArrayList<>();
        Arrays.stream(indexReference.properties()).forEach((i) -> properties.add(tokens.propertyKeyGetName(i)));
        try {
            return new IndexConstraintNodeInfo(
                    // Pretty print for index name
                    String.format(":%s(%s)", labelName, StringUtils.join(properties, ",")),
                    labelName,
                    properties,
                    schemaRead.indexGetState(indexReference).toString(),
                    !indexReference.isUnique() ? "INDEX" : "UNIQUENESS",
                    schemaRead.indexGetState(indexReference).equals(InternalIndexState.FAILED) ? schemaRead.indexGetFailure(indexReference) : "NO FAILURE",
                    schemaRead.indexGetPopulationProgress(indexReference).getCompleted() / schemaRead.indexGetPopulationProgress(indexReference).getTotal() * 100,
                    schemaRead.indexSize(indexReference),
                    schemaRead.indexUniqueValuesSelectivity(indexReference),
                    indexReference.userDescription(tokens)
            );
        } catch(IndexNotFoundKernelException e) {
            return new IndexConstraintNodeInfo(
                    // Pretty print for index name
                    String.format(":%s(%s)", labelName, StringUtils.join(properties, ",")),
                    labelName,
                    properties,
                    "NOT_FOUND",
                    !indexReference.isUnique() ? "INDEX" : "UNIQUENESS",
                    "NOT_FOUND",
                    0,0,0,
                    indexReference.userDescription(tokens)
            );
        }
    }
184338
public String getFieldName(String propertyName, JsonNode node) {

        if (node != null && node.has("javaName")) {
            propertyName = node.get("javaName").textValue();
        }

        return propertyName;
    }
66981
public GitlabLabel createLabel(Serializable projectId, GitlabLabel label)
            throws IOException {
        String name = label.getName();
        String color = label.getColor();
        return createLabel(projectId, name, color);
    }
348687
@Override
    public String getProperty(String name) {
        return name.startsWith(LABEL_PREFIX) ? StrUtil.getLabel(name.substring(LABEL_PREFIX.length())) : null;
    }
289142
private void ensureIndex(DS session, EntityTypeMetadata<NodeMetadata<L>> entityTypeMetadata,
            IndexedPropertyMethodMetadata<IndexedPropertyMetadata> indexedProperty) {
        if (indexedProperty != null) {
            IndexedPropertyMetadata datastoreMetadata = indexedProperty.getDatastoreMetadata();
            if (datastoreMetadata.isCreate()) {
                L label = entityTypeMetadata.getDatastoreMetadata().getDiscriminator();
                PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
                if (label != null && propertyMethodMetadata != null) {
                    ensureIndex(session, label, propertyMethodMetadata, datastoreMetadata.isUnique());
                }
            }
        }
    }
70042
@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public PrefixedPropertiesEnumeration<?> propertyNames() {
		lock.readLock().lock();
		try {
			final Set result = new HashSet();
			for (final Object key : getKeyMap(false).keySet()) {
				result.add(getUnprefixedKey(key));
			}
			return new PrefixedPropertiesEnumerationImpl(result.iterator(), true);
		} finally {
			lock.readLock().unlock();
		}
	}
340334
public void setLabel(java.lang.String label) {
        getStateHelper().put(PropertyKeys.label, label);
    }
1016394
public void setLabel(final String label) {
        if (label != null)
            attrMixin.setAttribute(LABEL, label);
        else
            attrMixin.removeAttribute(LABEL);
    }