[Developers] pattern-matching syntax for =~ constraint in MQL

Christine Weibel xtine at metaweb.com
Wed Apr 23 01:54:55 UTC 2008


hmm, i would think something like this should work, but is currently returning no results, even though there are many objects that should match this query.  does this look right?  will file a bug.


{
  "q1" : {
    "query" : [
      {
        "a:name~=" : "love",
        "b:name~=" : "you",
        "c:name" : {
          "optional" : "forbidden",
          "value~=" : "love you"
        },
        "name" : null,
        "type" : "/common/topic"
      }
    ]
  }
}


----- Original Message -----
From: "Ian Swett" <iswett at appliedminds.com>
To: "For discussions about MQL, Freebase API and apps built on Freebase" <developers at freebase.com>
Sent: Tuesday, April 22, 2008 4:42:52 PM (GMT-0800) America/Los_Angeles
Subject: Re: [Developers] pattern-matching syntax for =~ constraint in MQL

I'm interested in any updates to the pattern matching syntax as well.

In particular, the docs indicate that "love you" matches the phrase  
love you.  Is there a way to match the word love and you, but not as a  
phrase?

-Ian

On Apr 15, 2008, at 1:40 PM, David Flanagan wrote:

> Answering my own question here, it appears that using * in quotes,
> causes it to match a single word.
>
> So the pattern I should use in my query is:
>
>    "name~=": "\"^The *$\""
>
> The pattern ^*$ matches strings that are single words.  The pattern  
> * by
> itself seems to match anything.  I'm still not exactly sure what the
> matching rules are, but I can make the examples in my documentation  
> work
> again.
>
> 	David
>
> David Flanagan wrote:
>> The * in the query below used to match a single word:
>>
>> [{
>>   "type" : "/music/artist",
>>   "name" : null,
>>   "name~=" : "^The *$"
>> }]
>>
>> So this query would return The Clash, but not The Mighty Mighty
>> Bosstones.  That's changed: the * now seems to match any string.
>>
>> Can anyone tell me if there is any new syntax to match a single word?
>>
>> 	David
>> _______________________________________________
>> Developers mailing list
>> Developers at freebase.com
>> http://lists.freebase.com/mailman/listinfo/developers
>>
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers

_______________________________________________
Developers mailing list
Developers at freebase.com
http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list