[Wikidata-bugs] [Maniphest] T285606: Unexpected title value in WDQS when using MWAPI for lexemes

2021-06-28 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment.


  Well, I would say it’s not really a bug, more an unfortunate combination of 
features. There are currently two ways to get an entity ID out of MWAPI:
  
  Given a “client-like” API result like this
  

  

  
  then the MWAPI config
  
?item wikibase:apiOutputItem mwapi:item.
  
  corresponds to the XPath `pageprops/@wikibase_item`, i.e. the `wikibase_item` 
attribute of the `pageprops` child element of that `page` element.
  
  Given a “repo-like” API result like this
  

  

  
  then the MWAPI config
  
?item wikibase:apiOutputItem mwapi:title.
  
  corresponds to the XPath `@title`, i.e. the `title` attribute of that `page` 
element.
  
  In both cases, the assumption is that the XPath selects the entity ID as a 
string, but for the `title` attribute, that’s only true for items, not other 
entity types. (On Wikibase installations where items aren’t in the main 
namespace, I assume it’s not even true for items.) But I’m not sure what the 
best way to solve this would be – I would be hesitant to hard-code something 
like “remove everything up to the first colon” into MWAPI.
  
  Maybe we can add a new value for the `query+prop` API parameter, which would 
add the page’s entity ID (as an attribute on the `page` element, like the 
`contentmodel`, `pagelanguage`, etc.)? And then we could add that by default to 
the MWAPI “Generator” service, and add a new shortcut, `mwapi:entityid` = 
`@wikibase_entity` or something like that.

TASK DETAIL
  https://phabricator.wikimedia.org/T285606

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lydia_Pintscher, Lucas_Werkmeister_WMDE, Aklapper, Ainali, Invadibot, 
MPhamWMF, maantietaja, CBogen, Akuckartz, Nandana, Namenlos314, Lahi, Gq86, 
GoranSMilovanovic, QZanden, EBjune, merbst, LawExplorer, _jensen, rosalieper, 
Scott_WUaS, Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, 
Manybubbles, Mbch331
___
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org


[Wikidata-bugs] [Maniphest] T285606: Unexpected title value in WDQS when using MWAPI for lexemes

2021-06-27 Thread Lydia_Pintscher
Lydia_Pintscher added subscribers: Lucas_Werkmeister_WMDE, Lydia_Pintscher.
Lydia_Pintscher added a comment.


  @Lucas_Werkmeister_WMDE Any idea if this is on us to fix or Search Platform 
team?

TASK DETAIL
  https://phabricator.wikimedia.org/T285606

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lydia_Pintscher
Cc: Lydia_Pintscher, Lucas_Werkmeister_WMDE, Aklapper, Ainali, Invadibot, 
MPhamWMF, maantietaja, CBogen, Akuckartz, Nandana, Namenlos314, Lahi, Gq86, 
GoranSMilovanovic, QZanden, EBjune, merbst, LawExplorer, _jensen, rosalieper, 
Scott_WUaS, Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, 
Manybubbles, Mbch331
___
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org


[Wikidata-bugs] [Maniphest] T285606: Unexpected title value in WDQS when using MWAPI for lexemes

2021-06-26 Thread Maintenance_bot
Maintenance_bot added a project: Wikidata.

TASK DETAIL
  https://phabricator.wikimedia.org/T285606

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Maintenance_bot
Cc: Aklapper, Ainali, Invadibot, MPhamWMF, maantietaja, CBogen, Akuckartz, 
Nandana, Namenlos314, Lahi, Gq86, Lucas_Werkmeister_WMDE, GoranSMilovanovic, 
QZanden, EBjune, merbst, LawExplorer, _jensen, rosalieper, Scott_WUaS, Jonas, 
Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, Manybubbles, Mbch331
___
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org


[Wikidata-bugs] [Maniphest] T285606: Unexpected title value in WDQS when using MWAPI for lexemes

2021-06-26 Thread Ainali
Ainali created this task.
Ainali added a project: Wikidata-Query-Service.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  **List of steps to reproduce** (step by step, including full links if 
applicable):
  
  - I make a query like this :
  
SELECT ?title WHERE {
  hint:Query hint:optimizer "None".
  SERVICE wikibase:mwapi {
 bd:serviceParam wikibase:endpoint "www.wikidata.org"; # Set the 
project here
 wikibase:api "Generator";
 mwapi:generator "recentchanges";
 mwapi:grcnamespace "146"; # Restrict 
to lexemes
 mwapi:grctype "new";
 mwapi:grcuser "Ainali";.  # Your 
username
 ?title wikibase:apiOutputItem mwapi:title. 
  } 
FILTER BOUND (?title)  
} LIMIT 1
  
  **What happens?**:
  It gives a result which in JSON looks like this:
  

{"head":{"vars":["title"]},"results":{"bindings":[{"title":{"type":"uri","value":"http://www.wikidata.org/entity/LEXEME:L496172"}}]}}
  
  and the query service renders that as wd:LEXEME:L496172 
 which is a link that resolves 
to https://www.wikidata.org/wiki/Lexeme:LEXEME:L496172 
  which gives a 404 with the error message "This entity does not exist. "
  
  **What should have happened instead?**:
  I would have expected that title would either have the value of 
`http://www.wikidata.org/entity/L496172` or that it would be a string with the 
value of  `Lexeme:L496172` (like in a regular API-call 
).

TASK DETAIL
  https://phabricator.wikimedia.org/T285606

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Ainali
Cc: Aklapper, Ainali, MPhamWMF, CBogen, Namenlos314, Gq86, 
Lucas_Werkmeister_WMDE, EBjune, merbst, Jonas, Xmlizer, jkroll, Wikidata-bugs, 
Jdouglas, aude, Tobias1984, Manybubbles
___
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org