-
Notifications
You must be signed in to change notification settings - Fork 9
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
An example for importing properties with constraints #4
Comments
Hi! So the properties are there, no? or do you mean to make the plugin work? |
The properties contain only labels and "Wikidata PID". I thought that the local equivalent of P2302 is also created for all imported properties, no? The extension WikibaseQualityConstraints is installed. |
When you import an entity then all related properties and statements are imported. The outgoing entities and properties are only imported as leaves. If you want all properties of an outgoing object or a property you need to run the import one again. BTW, can we have a chat once? |
Hm, I started with a clean Wikibase instance, and wanted to create just one property like this: python3 import_one.py P31
WARNING: /.local/lib/python3.10/site-packages/rdflib_jsonld/__init__.py:9: DeprecationWarning: The rdflib-jsonld package has been integrated into rdflib as of rdflib==6.0.1. Please remove rdflib-jsonld from your project's dependencies.
warnings.warn(
Traceback (most recent call last):
File "/WikibaseSync/import_one.py", line 31, in <module>
wikibase_importer.change_property(wikidata_property, wikibase_repo, True)
File "/WikibaseSync/util/util.py", line 1110, in change_property
self.changeClaims(wikidata_item, wikibase_item)
File "/WikibaseSync/util/util.py", line 865, in changeClaims
for wikibase_claims in wikibase_item.claims:
AttributeError: 'NoneType' object has no attribute 'claims'
CRITICAL: Exiting due to uncaught exception <class 'AttributeError'> My use case is just to create all properties with constraints. In principle, for that I need to create a list with all Wikidata PIDs in the P.S. Sure, let's agree on time via LI. |
can you run the script a second time? |
On a clean instance after the second run of import_one.py I have:
|
I'm trying to reproduce it ... did you use https://www.mediawiki.org/wiki/Wikibase/Docker? |
Yes, the latest release https://github.com/wmde/wikibase-release-pipeline/tree/wmde.2 within https://github.com/UB-Mannheim/RaiseWikibase. |
As you saw I run into this: wmde/wikibase-release-pipeline#265 I will wait a bit to see if someone has an idea on how to fix it ... passed my morning trying to make it work. Had never a problem with the old version .... |
Yes, a weird problem. |
Regarding the warning of "Property [[Property:P2|P2]] already has label "instance of" associated with language code en."
--> This will create a new property ID and remove it. At the end, the property ID number will be very big. like this one Regarding: It seems that there was an imported problem of wikibase_item in this function: Line 1057 in 6d04d6a
Maybe you have to debug to see what was happened. I also got this problem, then, I found that the error is in my config/application.config.ini. |
@shigapov : could you check, I pushed a fix. Also the config files are more aligned to the latest release |
I ran But then I wanted to create yet another property and it has failed:
|
@shigapov new fix .... this should not have happened ... the problem is that the version that we have in production is not fully aligned to this one. I will try to move this one to production so that we can contribute better to the repo. Did you execute the imports above in a test instance? |
@shigapov did you find time to test it? |
Hi @D063520! I've just repeated the experiment on a fresh Wikibase instance 1.36 with your updates from 20.12.2021. I've got the same error message as explained in #4 (comment). So I ran |
On a fresh install, I tried to reproduce this, First with python import_one.py P31 Second with python import_one.py P281 Both imports worked successfully |
It could be related also to this: #15 |
Hi Dennis, I managed to run import_one.py and import_list.py and to import entities with multilingual labels and external IDs. Now I would like to add the constraints to properties, how can I make it?
The text was updated successfully, but these errors were encountered: