Class DocumentDataFilter

java.lang.Object
org.wikidata.wdtk.datamodel.interfaces.DocumentDataFilter

public class DocumentDataFilter extends Object
This class is used to describe restrictions to data in EntityDocument objects. This is used, e.g., to restrict only part of the data when copying objects.
Author:
Markus Kroetzsch
  • Constructor Details

    • DocumentDataFilter

      public DocumentDataFilter()
  • Method Details

    • getLanguageFilter

      public Set<String> getLanguageFilter()
      Returns the (possibly empty) set of language codes that are used to filter data, or null if no such filter is configured (default). If not equal to null, only terms in the given languages will be included.
      Returns:
      set of language codes to use for filtering
    • setLanguageFilter

      public void setLanguageFilter(Set<String> languageFilter)
      Sets the (possibly empty) set of language codes that are used to filter data. Setting this to null disables this filter (this is the default). If not equal to null, only terms in the given language will be included.

      The language filter is not applied to monolingual text values in statements. Only labels, descriptions, and aliases are filtered.

      Parameters:
      languageFilter - set of language codes to restrict to
    • getPropertyFilter

      public Set<PropertyIdValue> getPropertyFilter()
      Returns the (possibly empty) set of PropertyIdValue objects that are used to filter statements, or null if no such filter is configured (default). If not equal to null, only statements using the given properties will be included.
      Returns:
      set of properties to use for filtering
    • setPropertyFilter

      public void setPropertyFilter(Set<PropertyIdValue> propertyFilter)
      Sets the (possibly empty) set of PropertyIdValue objects that are used to filter statements. Setting this to null disables this filter (this is the default). If not equal to null, only statements using the given properties will be included.

      The property filter is not applied to qualifiers and references in statements. Only the main property of statements is filtered.

      Parameters:
      propertyFilter - set of properties to use for filtering
    • getSiteLinkFilter

      public Set<String> getSiteLinkFilter()
      Returns the (possibly empty) set of site keys that are used to filter SiteLink objects, or null if no such filter is configured (default). If not equal to null, only site links for the given sites will be included.
      Returns:
      set of site keys to use for filtering
    • setSiteLinkFilter

      public void setSiteLinkFilter(Set<String> siteLinkFilter)
      Sets the (possibly empty) set of site keys that are used to filter SiteLink objects. Setting this to null disables this filter (this is the default). If not equal to null, only site links for the given sites will be included.
      Parameters:
      siteLinkFilter - set of site keys to use for filtering
    • includeLanguage

      public boolean includeLanguage(String languageCode)
      Returns true if the given language is included (not filtered).
      Parameters:
      languageCode - code of the language to check
      Returns:
      true if there is no language filter, or a language filter that includes the given language
    • includePropertyId

      public boolean includePropertyId(PropertyIdValue propertyIdValue)
      Returns true if the given property is included (not filtered).
      Parameters:
      propertyIdValue - property id to check
      Returns:
      true if there is no property filter, or a property filter that includes the given property
    • includeSiteLink

      public boolean includeSiteLink(String siteLink)
      Returns true if the given site link is included (not filtered).
      Parameters:
      siteLink - key of the site to check
      Returns:
      true if there is no site link filter, or a site link filter that includes the given site
    • excludeAllLanguages

      public boolean excludeAllLanguages()
      Returns true if terms in all languages are excluded.
      Returns:
      true if all terms are excluded
    • excludeAllProperties

      public boolean excludeAllProperties()
      Returns true if statements for all properties are excluded.
      Returns:
      true if all statements are excluded
    • excludeAllSiteLinks

      public boolean excludeAllSiteLinks()
      Returns true if site links for all sites are excluded.
      Returns:
      true if all site links are excluded