/** * Sets the value for the API's "props" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestProps(WbGetEntitiesActionData properties) { StringBuilder builder = new StringBuilder(); builder.append("info|datatype"); if (!this.filter.excludeAllLanguages()) { builder.append("|labels|aliases|descriptions"); } if (!this.filter.excludeAllProperties()) { builder.append("|claims"); } if (!this.filter.excludeAllSiteLinks()) { builder.append("|sitelinks"); } properties.props = builder.toString(); }
/** * Sets the value for the API's "props" parameter based on the current * settings. * * @param properties * current setting of parameters */ private void setRequestProps(WbGetEntitiesActionData properties) { StringBuilder builder = new StringBuilder(); builder.append("info|datatype"); if (!this.filter.excludeAllLanguages()) { builder.append("|labels|aliases|descriptions"); } if (!this.filter.excludeAllProperties()) { builder.append("|claims"); } if (!this.filter.excludeAllSiteLinks()) { builder.append("|sitelinks"); } properties.props = builder.toString(); }
/** * Copies a list of {@link StatementGroup} objects. * * @param statementGroups * object to copy * @return the copied object */ private List<StatementGroup> copyStatementGroups(List<StatementGroup> statementGroups) { if (filter.excludeAllProperties()) { return Collections.emptyList(); } List<StatementGroup> result = new ArrayList<>(statementGroups.size()); for (StatementGroup statementGroup : statementGroups) { if (filter.includePropertyId(statementGroup.getProperty())) { result.add(copy(statementGroup)); } } return result; }
/** * Copies a list of {@link StatementGroup} objects. * * @param statementGroups * object to copy * @return the copied object */ private List<StatementGroup> copyStatementGroups(List<StatementGroup> statementGroups) { if (filter.excludeAllProperties()) { return Collections.emptyList(); } List<StatementGroup> result = new ArrayList<>(statementGroups.size()); for (StatementGroup statementGroup : statementGroups) { if (filter.includePropertyId(statementGroup.getProperty())) { result.add(copy(statementGroup)); } } return result; }
throws MediaWikiApiErrorException, IOException { WikibaseDataFetcher wbdf = new WikibaseDataFetcher(connection, siteIri); wbdf.getFilter().excludeAllProperties(); wbdf.getFilter().setLanguageFilter(Collections.singleton("en"));
throws MediaWikiApiErrorException { WikibaseDataFetcher wbdf = new WikibaseDataFetcher(connection, siteIri); wbdf.getFilter().excludeAllProperties(); wbdf.getFilter().setLanguageFilter(Collections.singleton("en"));