Merge pull request #1785 from OpenRefine/issue1772
Ignore deprecated constraints.
This commit is contained in:
commit
4dd538a956
@ -39,6 +39,7 @@ import org.wikidata.wdtk.datamodel.interfaces.Snak;
|
|||||||
import org.wikidata.wdtk.datamodel.interfaces.SnakGroup;
|
import org.wikidata.wdtk.datamodel.interfaces.SnakGroup;
|
||||||
import org.wikidata.wdtk.datamodel.interfaces.Statement;
|
import org.wikidata.wdtk.datamodel.interfaces.Statement;
|
||||||
import org.wikidata.wdtk.datamodel.interfaces.StatementGroup;
|
import org.wikidata.wdtk.datamodel.interfaces.StatementGroup;
|
||||||
|
import org.wikidata.wdtk.datamodel.interfaces.StatementRank;
|
||||||
import org.wikidata.wdtk.datamodel.interfaces.StringValue;
|
import org.wikidata.wdtk.datamodel.interfaces.StringValue;
|
||||||
import org.wikidata.wdtk.datamodel.interfaces.Value;
|
import org.wikidata.wdtk.datamodel.interfaces.Value;
|
||||||
|
|
||||||
@ -290,7 +291,8 @@ public class WikidataConstraintFetcher implements ConstraintFetcher {
|
|||||||
*/
|
*/
|
||||||
protected Stream<Statement> getConstraintsByType(PropertyIdValue pid, String qid) {
|
protected Stream<Statement> getConstraintsByType(PropertyIdValue pid, String qid) {
|
||||||
Stream<Statement> allConstraints = getConstraintStatements(pid).stream()
|
Stream<Statement> allConstraints = getConstraintStatements(pid).stream()
|
||||||
.filter(s -> ((EntityIdValue) s.getValue()).getId().equals(qid));
|
.filter(s -> s.getValue() != null && ((EntityIdValue) s.getValue()).getId().equals(qid))
|
||||||
|
.filter(s -> !StatementRank.DEPRECATED.equals(s.getRank()));
|
||||||
return allConstraints;
|
return allConstraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user