Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting config programmatically #204

Open
Superraptor opened this issue Aug 12, 2024 · 0 comments
Open

Setting config programmatically #204

Superraptor opened this issue Aug 12, 2024 · 0 comments

Comments

@Superraptor
Copy link

Hello! Just started using and was curious-- is there an accepted way to programmatically set P2302 and Q21502410 in my wikibase or to set core_props automatically?

In my case, I am using a locally hosting Wikibase instance in which most of the quality constraints were prepopulated using the script made available by WikibaseQualityConstraints (i.e. https://github.com/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/tree/master), using a variant of their command php maintenance/run.php WikibaseQualityConstraints:ImportConstraintEntities.php | tee -a LocalSettings.php. This added the following to my LocalSettings.php (as well as adding all of these to my local Wikibase):

$wgWBQualityConstraintsInstanceOfId = 'P5';
$wgWBQualityConstraintsSubclassOfId = 'P6';
$wgWBQualityConstraintsPropertyConstraintId = 'P7';
$wgWBQualityConstraintsExceptionToConstraintId = 'P8';
$wgWBQualityConstraintsConstraintStatusId = 'P9';
$wgWBQualityConstraintsMandatoryConstraintId = 'Q1';
$wgWBQualityConstraintsSuggestionConstraintId = 'Q2';
$wgWBQualityConstraintsDistinctValuesConstraintId = 'Q3';
$wgWBQualityConstraintsMultiValueConstraintId = 'Q4';
$wgWBQualityConstraintsUsedAsQualifierConstraintId = 'Q5';
$wgWBQualityConstraintsSingleValueConstraintId = 'Q6';
$wgWBQualityConstraintsSymmetricConstraintId = 'Q7';
$wgWBQualityConstraintsTypeConstraintId = 'Q8';
$wgWBQualityConstraintsValueTypeConstraintId = 'Q9';
$wgWBQualityConstraintsInverseConstraintId = 'Q10';
$wgWBQualityConstraintsItemRequiresClaimConstraintId = 'Q11';
$wgWBQualityConstraintsValueRequiresClaimConstraintId = 'Q12';
$wgWBQualityConstraintsConflictsWithConstraintId = 'Q13';
$wgWBQualityConstraintsOneOfConstraintId = 'Q14';
$wgWBQualityConstraintsMandatoryQualifierConstraintId = 'Q15';
$wgWBQualityConstraintsAllowedQualifiersConstraintId = 'Q16';
$wgWBQualityConstraintsRangeConstraintId = 'Q17';
$wgWBQualityConstraintsDifferenceWithinRangeConstraintId = 'Q18';
$wgWBQualityConstraintsCommonsLinkConstraintId = 'Q19';
$wgWBQualityConstraintsContemporaryConstraintId = 'Q20';
$wgWBQualityConstraintsFormatConstraintId = 'Q21';
$wgWBQualityConstraintsUsedForValuesOnlyConstraintId = 'Q22';
$wgWBQualityConstraintsUsedAsReferenceConstraintId = 'Q23';
$wgWBQualityConstraintsNoBoundsConstraintId = 'Q24';
$wgWBQualityConstraintsAllowedUnitsConstraintId = 'Q25';
$wgWBQualityConstraintsSingleBestValueConstraintId = 'Q26';
$wgWBQualityConstraintsAllowedEntityTypesConstraintId = 'Q27';
$wgWBQualityConstraintsCitationNeededConstraintId = 'Q28';
$wgWBQualityConstraintsPropertyScopeConstraintId = 'Q29';
$wgWBQualityConstraintsLexemeLanguageConstraintId = 'Q30';
$wgWBQualityConstraintsLabelInLanguageConstraintId = 'Q31';
$wgWBQualityConstraintsLanguagePropertyId = 'P10';
$wgWBQualityConstraintsClassId = 'P11';
$wgWBQualityConstraintsRelationId = 'P12';
$wgWBQualityConstraintsInstanceOfRelationId = 'Q32';
$wgWBQualityConstraintsSubclassOfRelationId = 'Q33';
$wgWBQualityConstraintsInstanceOrSubclassOfRelationId = 'Q34';
$wgWBQualityConstraintsPropertyId = 'P13';
$wgWBQualityConstraintsQualifierOfPropertyConstraintId = 'P14';
$wgWBQualityConstraintsMinimumQuantityId = 'P15';
$wgWBQualityConstraintsMaximumQuantityId = 'P16';
$wgWBQualityConstraintsMinimumDateId = 'P17';
$wgWBQualityConstraintsMaximumDateId = 'P18';
$wgWBQualityConstraintsNamespaceId = 'P19';
$wgWBQualityConstraintsFormatAsARegularExpressionId = 'P20';
$wgWBQualityConstraintsSyntaxClarificationId = 'P21';
$wgWBQualityConstraintsConstraintClarificationId = 'P22';
$wgWBQualityConstraintsConstraintScopeId = 'P23';
$wgWBQualityConstraintsConstraintEntityTypesId = 'P23';
$wgWBQualityConstraintsSeparatorId = 'P25';
$wgWBQualityConstraintsConstraintCheckedOnMainValueId = 'Q35';
$wgWBQualityConstraintsConstraintCheckedOnQualifiersId = 'Q36';
$wgWBQualityConstraintsConstraintCheckedOnReferencesId = 'Q37';
$wgWBQualityConstraintsNoneOfConstraintId = 'Q38';
$wgWBQualityConstraintsIntegerConstraintId = 'Q39';
$wgWBQualityConstraintsWikibaseItemId = 'Q40';
$wgWBQualityConstraintsWikibasePropertyId = 'Q41';
$wgWBQualityConstraintsWikibaseLexemeId = 'Q42';
$wgWBQualityConstraintsWikibaseFormId = 'Q43';
$wgWBQualityConstraintsWikibaseSenseId = 'Q44';
$wgWBQualityConstraintsWikibaseMediaInfoId = 'Q45';
$wgWBQualityConstraintsPropertyScopeId = 'P26';
$wgWBQualityConstraintsAsMainValueId = 'Q46';
$wgWBQualityConstraintsAsQualifiersId = 'Q47';
$wgWBQualityConstraintsAsReferencesId = 'Q48';

When running WikidataIntegrator though, I am still getting:

C:\Users\[USERNAME]\anaconda3\envs\wbsync\Lib\site-packages\wikidataintegrator\wdi_core.py:493: UserWarning: Warning: No distinct value properties found
Please set P2302 and Q21502410 in your wikibase or set `core_props` manually.
Continuing with no core_props
  warnings.warn("Warning: No distinct value properties found\n" +

So what is the best way to go about fixing this programmatically? (Rather than editing wdi_core.py and inserting the new variables manually)

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant