Interface Reference
- All Known Implementing Classes:
ReferenceImpl
public interface Reference
An interface for references in Wikidata. A reference is currently defined by
a list of ValueSnaks, encoding property-value pairs.
- Author:
- Markus Kroetzsch
-
Method Summary
Modifier and TypeMethodDescriptionReturns an interator over all snaks, without considering snak groups.getHash()
Wikibase calculates a hash for each reference based on the content of the reference.Get the list of snak groups associated with this reference.
-
Method Details
-
getSnakGroups
Get the list of snak groups associated with this reference. Objects of this class are immutable, and the list should therefore not be modifiable.- Returns:
- list of SnakGroups
-
getAllSnaks
Returns an interator over all snaks, without considering snak groups. The relative order of snaks is preserved.- Returns:
- iterator of snaks
-
getHash
String getHash()Wikibase calculates a hash for each reference based on the content of the reference. This hash appears in the RDF serialization of the reference. Since the calculation is hard to reproduce, this is only available if the reference was read from a dump that contains the hash.- Returns:
- the hash of the reference, if available, otherwise null.
-