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

core_props fails when prop is an ItemID (bug) #155

Closed
maximearmstrong opened this issue May 25, 2021 · 4 comments · Fixed by #156
Closed

core_props fails when prop is an ItemID (bug) #155

maximearmstrong opened this issue May 25, 2021 · 4 comments · Fixed by #156
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@maximearmstrong
Copy link

When using ItemID property as a core_prop in ItemEngine, the function __select_item() fails because of this line, where get_sparql_value() returns an int for the self.value of an ItemID, so replace() fails.

Is there another way to use an ItemID property in a core_props? Or is this a bug? Thanks a lot :)
cc: @annaelleduff

@LeMyst
Copy link
Owner

LeMyst commented May 25, 2021

Hello @maximearmstrong ,
Thank you for your issue.
Do you have an example code that trigger the issue?

@LeMyst LeMyst added the bug Something isn't working label May 25, 2021
@LeMyst
Copy link
Owner

LeMyst commented May 25, 2021

Ok, I can reproduce the issue with

from wikibaseintegrator import wbi_core
from wikibaseintegrator.wbi_datatype import ItemID

data = ItemID(prop_nr='P1589', value='Q1491734')

item = wbi_core.ItemEngine(debug=True, core_props={'P1589'}, data=data)
print(item.item_id)  # Q2

LeMyst added a commit that referenced this issue May 25, 2021
LeMyst added a commit that referenced this issue May 25, 2021
@LeMyst LeMyst added the good first issue Good for newcomers label May 25, 2021
@LeMyst
Copy link
Owner

LeMyst commented May 25, 2021

It's fixed in the master branch.
You can use this one.
I will probably release 0.11.0 at the end of the week.
The 0.12.0 will be a huge rewrite of WBI with a lot of changes. (#152 )

Just for my knowledge, how do you use WikibaseIntegrator?

@maximearmstrong
Copy link
Author

Thanks a lot @LeMyst !
We use WikibaseIntegrator for the Mobility Database Interface at MobilityData. We are mostly testing at the moment, but you can access the Mobility Database here, which will be populated soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants