Rename the option for excluded claims to one that more precisely declares what it does.
@@ -607,10 +607,10 @@ def add_arguments(parser: KGTKArgumentParser):
help='How many characters should be used to hash the claim ID? 0 means do not hash the claim ID. (default=%(default)d)')
parser.add_argument(
- "--exclude-certain-claims",
+ "--exclude-statements-with-certain-claims",
nargs='?',
type=optional_bool,
- dest="exclude_certain_claims",
+ dest="exclude_statements_with_certain_claims",
const=True,
default=True,
metavar="True/False",
@@ -683,7 +683,7 @@ def run(input_file: KGTKFiles,
mgzip_threads_for_output: int,
value_hash_width: int,
claim_id_hash_width: int,
- exclude_certain_claims: bool,
+ exclude_statements_with_certain_claims: bool,
):
# import modules locally
@@ -765,8 +765,11 @@ def run(input_file: KGTKFiles,
'P279': exclude_list # subclass
}
# CMR: The exclude_list and neg_prop_filter processing, when
- # enabled by exclude_certain_claims, excludes any claims where the
- # label is P31 or P279 and the node2 value is in the exclude list.
+ # enabled by exclude_statements_with_certain_claims, excludes any statement
+ # containing a claim where the label is P31 or P279 and the node2
+ # value is in the exclude list. In other words, if at least one claim
+ # matches an excluding pattern, all claims for that statement will
+ # be excluded.
self.first=True
self.cnt=0
@@ -1187,7 +1190,7 @@ def run(input_file: KGTKFiles,
if parse_claims and "claims" in obj:
claims = obj["claims"]
- if exclude_certain_claims:
+ if exclude_statements_with_certain_claims:
for prop, value_set in self.neg_prop_filter.items():
claim_property = claims.get(prop, None)
if claim_property:
