[Developers] Multiple Wildcards in MQL Query
James Taylor
jame0taylor at gmail.com
Sat Jan 3 23:13:02 UTC 2009
Concatenating results is not idea. Is there a way to solve this in a single
query by combining the 'pattern matching' operator and the 'one of'
operator?
Something like (which doesn't work):
[
{
"name" : null,
"name|=" : [
"^0*",
"^1*",
"^2*"
],
"type" : "/base/bioventurist/science_or_technology_company"
}
]
-JT
On Sat, Jan 3, 2009 at 2:37 PM, Kurt Bollacker <kurt at metaweb.com> wrote:
>
> Your query is simply the logical intersection of the name constraints,
> rather than the union ("OR") that you wanted. You could write each of
> your 10 queries like:
>
> [
> {
> "a:name~=" : "^0*",
> "name" : null,
> "type" : "/base/bioventurist/science_or_technology_company"
> }
> ]
>
> and concatenate the results. Currently, MQL pattern matching does not
> have a "full set" of regular expressions.
>
>
> Kurt :-)
>
>
>
> On Sat, Jan 03, 2009 at 02:06:43PM -0800, Rob Warren wrote:
> > Hi,
> >
> > I was wondering if anybody has any experience using multiple wildcards
> > within a single MQL query?
> >
> > I am trying to write a single query that returns all names that begin
> with a
> > number for a given type (e.g. for "type" :
> > "/base/bioventurist/science_or_technology_company", I want freebase to
> > return 3M, 454 Life Sciences, 23andme etc.).
> >
> > I have tried using property prefixes such as in the example below and not
> > had any luck.
> >
> > [
> > {
> > "a:name~=" : "^0*",
> > "b:name~=" : "^1*",
> > "c:name~=" : "^2*",
> > "d:name~=" : "^3*",
> > "e:name~=" : "^4*",
> > "f:name~=" : "^5*",
> > "g:name~=" : "^6*",
> > "h:name~=" : "^7*",
> > "i:name~=" : "^8*",
> > "j:name~=" : "^9*",
> > "name" : null,
> > "type" : "/base/bioventurist/science_or_technology_company"
> > }
> > ]
> >
> > I am unsure as to how to combine wildcards and either numeric comparisons
> > "one of" operators and am not sure if this is even an effective solution.
> >
> > Any suggestions or help would be much appreciated.
>
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090103/f9b0c349/attachment.htm
More information about the Developers
mailing list