Class DocumentDataFilter
java.lang.Object
org.wikidata.wdtk.datamodel.interfaces.DocumentDataFilter
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if terms in all languages are excluded.booleanReturns true if statements for all properties are excluded.booleanReturns true if site links for all sites are excluded.Returns the (possibly empty) set of language codes that are used to filter data, or null if no such filter is configured (default).Returns the (possibly empty) set ofPropertyIdValueobjects that are used to filter statements, or null if no such filter is configured (default).Returns the (possibly empty) set of site keys that are used to filterSiteLinkobjects, or null if no such filter is configured (default).booleanincludeLanguage(String languageCode) Returns true if the given language is included (not filtered).booleanincludePropertyId(PropertyIdValue propertyIdValue) Returns true if the given property is included (not filtered).booleanincludeSiteLink(String siteLink) Returns true if the given site link is included (not filtered).voidsetLanguageFilter(Set<String> languageFilter) Sets the (possibly empty) set of language codes that are used to filter data.voidsetPropertyFilter(Set<PropertyIdValue> propertyFilter) Sets the (possibly empty) set ofPropertyIdValueobjects that are used to filter statements.voidsetSiteLinkFilter(Set<String> siteLinkFilter) Sets the (possibly empty) set of site keys that are used to filterSiteLinkobjects.
-
Constructor Details
-
DocumentDataFilter
public DocumentDataFilter()
-
-
Method Details
-
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
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
Returns the (possibly empty) set ofPropertyIdValueobjects 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
Sets the (possibly empty) set ofPropertyIdValueobjects 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
Returns the (possibly empty) set of site keys that are used to filterSiteLinkobjects, 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
Sets the (possibly empty) set of site keys that are used to filterSiteLinkobjects. 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
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
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
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
-