/** * Returns true if there is a statement for the given property. This is a * convenience method for accessing the data that can be obtained via * {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @return true if a statement for this property exists */ default boolean hasStatement(PropertyIdValue propertyIdValue) { return findStatementGroup(propertyIdValue) != null; }
/** * Returns true if there is a statement for the given property. This is a * convenience method for accessing the data that can be obtained via * {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @return true if a statement for this property exists */ default boolean hasStatement(PropertyIdValue propertyIdValue) { return findStatementGroup(propertyIdValue) != null; }
/** * Returns true if there is a statement for the given property. Only the * string id of the property is compared, not the site id. This is useful in * situations where all data is known to come from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @return true if a statement for this property exists */ default boolean hasStatement(String propertyId) { return findStatementGroup(propertyId) != null; }
/** * Returns true if there is a statement for the given property. Only the * string id of the property is compared, not the site id. This is useful in * situations where all data is known to come from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @return true if a statement for this property exists */ default boolean hasStatement(String propertyId) { return findStatementGroup(propertyId) != null; }
/** * Returns true if there is a statement for the given property and one of * the given values. This is a convenience method for accessing the data * that can be obtained via {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @param values * the set of values to search * @return true if a statement for this property and value exists */ default boolean hasStatementValue(PropertyIdValue propertyIdValue, Set<? extends Value> values) { StatementGroup statementGroup = findStatementGroup(propertyIdValue); if(statementGroup == null) { return false; } for (Statement statement : statementGroup) { if (values.contains(statement.getValue())) { return true; } } return false; }
/** * Returns true if there is a statement for the given property and one of * the given values. This is a convenience method for accessing the data * that can be obtained via {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @param values * the set of values to search * @return true if a statement for this property and value exists */ default boolean hasStatementValue(PropertyIdValue propertyIdValue, Set<? extends Value> values) { StatementGroup statementGroup = findStatementGroup(propertyIdValue); if(statementGroup == null) { return false; } for (Statement statement : statementGroup) { if (values.contains(statement.getValue())) { return true; } } return false; }
/** * Returns true if there is a statement for the given property and one of * the given values. Only the string id of the property is compared, not the * site id. This is useful in situations where all data is known to come * from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @param values * the set of values to search * @return true if a statement for this property and value exists */ default boolean hasStatementValue(String propertyId, Set<? extends Value> values) { StatementGroup statementGroup = findStatementGroup(propertyId); if(statementGroup == null) { return false; } for (Statement statement : statementGroup) { if (values.contains(statement.getValue())) { return true; } } return false; }
/** * Returns true if there is a statement for the given property and one of * the given values. Only the string id of the property is compared, not the * site id. This is useful in situations where all data is known to come * from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @param values * the set of values to search * @return true if a statement for this property and value exists */ default boolean hasStatementValue(String propertyId, Set<? extends Value> values) { StatementGroup statementGroup = findStatementGroup(propertyId); if(statementGroup == null) { return false; } for (Statement statement : statementGroup) { if (values.contains(statement.getValue())) { return true; } } return false; }
/** * Returns the unique {@link Statement} for the given property, or null if * there are zero or many statements for this property. This is a * convenience method for accessing the data that can be obtained via * {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @return {@link Statement} or null */ default Statement findStatement(PropertyIdValue propertyIdValue) { StatementGroup statementGroup = findStatementGroup(propertyIdValue); return (statementGroup != null && statementGroup.size() == 1) ? statementGroup.getStatements().get(0) : null; }
/** * Returns the unique {@link Statement} for the given property, or null if * there are zero or many statements for this property. This is a * convenience method for accessing the data that can be obtained via * {@link #getStatementGroups()}. * * @param propertyIdValue * the property to search for * @return {@link Statement} or null */ default Statement findStatement(PropertyIdValue propertyIdValue) { StatementGroup statementGroup = findStatementGroup(propertyIdValue); return (statementGroup != null && statementGroup.size() == 1) ? statementGroup.getStatements().get(0) : null; }
/** * Returns the unique {@link Statement} for the given property, or null if * there are zero or many statements for this property. Only the string id * of the property is compared, not the site id. This is useful in * situations where all data is known to come from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @return {@link Statement} or null */ default Statement findStatement(String propertyId) { StatementGroup statementGroup = findStatementGroup(propertyId); return (statementGroup != null && statementGroup.size() == 1) ? statementGroup.getStatements().get(0) : null; }
/** * Returns the unique {@link Statement} for the given property, or null if * there are zero or many statements for this property. Only the string id * of the property is compared, not the site id. This is useful in * situations where all data is known to come from a single site. * <p> * This is a convenience method for accessing the data that can be obtained * via {@link #getStatementGroups()}. * * @param propertyId * the property to search for * @return {@link Statement} or null */ default Statement findStatement(String propertyId) { StatementGroup statementGroup = findStatementGroup(propertyId); return (statementGroup != null && statementGroup.size() == 1) ? statementGroup.getStatements().get(0) : null; }
.findStatementGroup("P31"); if (instanceOfStatements != null) {