Yep, my bad..  the correct query with the string syntax returns the results as expected.
STRING[486:"D008180"]

But I'm still confused why the query
CLAIM[486:"D008180"]

gives the results that it does?  None of the returned items has the string target of that property as "D008180".  

It seems like its an erroneous query from the documentation that you pointed me to.  The only thing that mentions the use of strings in CLAIM queries is rather vague: "Note that the item-less form of this query also works for string, time, and coordinate properties."  What does that mean?

The following queries return the same results:
CLAIM[486:"D008180"]
CLAIM[486:"D008181"]
CLAIM[486:"D"]
CLAIM[486:" "]

though this is different (returns nothing):
CLAIM[486:""]

Is there ever a reason that a string should be used within a claim query?  If not, shouldn't the API throw an error?

thanks
-Ben







On Sun, Oct 26, 2014 at 3:50 PM, Magnus Manske <magnusmanske@googlemail.com> wrote:
Indeed. Full API documentation:
http://wdq.wmflabs.org/api_documentation.html

On Sun, Oct 26, 2014 at 4:52 PM, Andrew Gray <andrew.gray@dunelm.org.uk> wrote:
CLAIM seems to expect that the target is an item number, rather than a
text string. For string properties, I think the correct query is:

STRING[486:"D008180"]

http://tools.wmflabs.org/autolist/index.php?language=en&project=wikipedia&category=&depth=12&wdq=STRING[486%3A%22D008180%22]&mode=undefined&statementlist=&run=Run&label_contains=&label_contains_not=&chunk_size=10000

Andrew.

On 24 October 2014 18:13, Benjamin Good <ben.mcgee.good@gmail.com> wrote:
> Using the autolist 2 tool (http://tools.wmflabs.org/autolist/index.php), I
> enter the WDQ query:
> CLAIM[486:"D008180"]
>
> which I think means "Give me the items that have MeSH id = "D008180" ".  It
> does indeed return an item with that claim Q1495661
>
> but also returns items that have an no value as the object of that
> relationship, such as
> http://www.wikidata.org/wiki/Q3377653
> http://www.wikidata.org/wiki/Q7796109
> http://www.wikidata.org/wiki/Q1598365
>
> Is this a bug in the query API or a bug in my query ?



--
- Andrew Gray
  andrew.gray@dunelm.org.uk

_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l