Class SnakOnlyStatementMerger
java.lang.Object
org.openrefine.wikidata.schema.strategies.SnakOnlyStatementMerger
- All Implemented Interfaces:
StatementMerger
Merging strategy which only looks at the main value of statements
(in addition to their property, but that is expected). This is what
QuickStatements does.
- Author:
- Antonin Delpeuch
-
Field Summary
Fields inherited from interface org.openrefine.wikidata.schema.strategies.StatementMerger
FORMER_DEFAULT_STRATEGY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic List<org.wikidata.wdtk.datamodel.interfaces.Snak>inthashCode()booleanmatch(org.wikidata.wdtk.datamodel.interfaces.Snak existingSnak, org.wikidata.wdtk.datamodel.interfaces.Snak addedSnak) Matches two snaks using the underlying value matcher.booleanmatch(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Determines if the existing statement matches the statement to add (or remove)org.wikidata.wdtk.datamodel.interfaces.Statementmerge(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Return the result of merging the statement to add with the existing statement.List<org.wikidata.wdtk.datamodel.interfaces.Reference>mergeReferences(List<org.wikidata.wdtk.datamodel.interfaces.Reference> existing, List<org.wikidata.wdtk.datamodel.interfaces.Reference> added) toString()
-
Constructor Details
-
SnakOnlyStatementMerger
-
-
Method Details
-
match
public boolean match(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Description copied from interface:StatementMergerDetermines if the existing statement matches the statement to add (or remove)- Specified by:
matchin interfaceStatementMerger- Parameters:
existing- the statement currently on the entityadded- the statement to add or remove- Returns:
-
merge
public org.wikidata.wdtk.datamodel.interfaces.Statement merge(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Description copied from interface:StatementMergerReturn the result of merging the statement to add with the existing statement. This method can assume that the two statements are matching (i.e. the method above has returned true on them).- Specified by:
mergein interfaceStatementMerger- Parameters:
existing- the statement currently on the entityadded- the statement to add or remove- Returns:
- the merged statement obtained out of the two
-
getValueMatcher
-
match
public boolean match(org.wikidata.wdtk.datamodel.interfaces.Snak existingSnak, org.wikidata.wdtk.datamodel.interfaces.Snak addedSnak) Matches two snaks using the underlying value matcher. The snaks must have the same property id to match.- Parameters:
existingSnak-addedSnak-- Returns:
-
mergeReferences
-
flatten
-
toString
-
hashCode
public int hashCode() -
equals
-