Freebase Applications » Discuss

Discussions on Freebase Applications

  1.  

    "limit" : 0 change in semantics?

    1. It appears that setting limit to 0 now limits the number of results to 0, rather than be unlimited, as stated in the online documentation. Is this a recent change? Can you change the documentation if so?

       The tutorial says:

       Note that we use a limit of one in the above. Specifying a limit of zero means "don't limit the results: return everything you've got".  

      1. The doc is being revised right now, and that change is on the list. Thanks for asking about it.

      2. if limit:0 now means return zero returns, how do you ask to return all results?

      3. Set a large number as the limit. But if you truly want all results, you are much better off using a cursor; if you don’t know the reasonable upper bound, then you really can’t have confidence that you’ll get all the results without a timeout.

      4. The docs are still incorrectly stating zero returns all.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  2.  
    1. I don't mean semantically of course, I mean why can't I use the same MQL to get them both. For example:

      {
        "name" : "Kurt Cobain",
        "place_of_birth" : [],
        "places_lived" : [],
        "type" : "/people/person"
      }

       Gives me:

      {
        "name" : "Kurt Cobain",
        "place_of_birth" : [
          "Aberdeen"
        ],
        "places_lived" : [
          null
        ],
        "type" : "/people/person"
      }

      Even though http://www.freebase.com/view/en/kurt_cobain clearly lists Aberdeen for both values. Why can't I query them the same way?

      1. The Explore view is invaluable for this kind of question. If you don’t see a blue tool bar at the bottom of your screen, hit F8; I’ll wait.

        OK, now check out the Explore link from Kurt Cobain. It should take you here. You can also just change view to tools/explore in just about any Freebase URL.

        In that Explore view, you should see that the outbound /people/person/place_of_birth connects Kurt directly with Aberdeen. However, the inbound /people/place_lived/person link connects Kurt with some weird GUID-named thing. If you click on it, you will see that it is an instance of Place lived, connecting Kurt with Aberdeen. Why is that? Because we also might want to associate start and end dates with his residence there, which we can’t do on a simple, direct link.

        This design pattern is called a Compound Value Type, or CVT, and there is more information about them here.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  3.  

    How to query types in user's domains?

    1. Helo all,

       I was trying to analyze user defined types - types that are in user's default domain or user defined domain, but not yet promoted to the standard freebase domains. Any idea how to obtain a list of all such types? I was trying some MQL but it doesn't seem to be easy as we cannot use pattern matching for 'id'.

      1. Good question.  You can construct a query against the type /type/domain for all domains and its types that are hidden; however, user domains that are not their default domains can be "published", or unhidden, so those won't appear in your result set.  The full result set may not be possible in one MQL query.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  4.  

    A reminder about the Freebase blog...

    1. In case you aren't already subscribed to the RSS feed, I've just posted a new entry to the freebase blog called "The Significance of Significance":

      http://blog.freebase.com/

      Don't worry I'm not going to spam the list with this stuff every time someone posts, but until we get the blog, mailing lists, and discuss system in sync, I'm hoping it's helpful to cross-post reminders periodically..


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  5.  

    Query troubles

    1. I am having a lot of trouble with a query (I am running it in the query editor.) It runs great for the first three tries then fails at the fourth try. I am using cursors and taking the cursor from the previous result and using it at the next query. I am really lost as to what I am doing wrong.

      The query I am trying to run is
      {
      "cursor":true,
      "query":[{
      "*":[],
      "/business/retail_location/address":{
      "citytown":[],
      "postal_code":[],
      "street_address":[],
      "street_address_2":[]
      },
      "name":[],
      "type":"/dining/restaurant"
      }]
      }
      The error message I get is
      "message":"Unique query may have at most one result. Got 56". It seems like on the fourth attempt, it is losing the outside data like restaurant id etc and only returning the address information. What am I doing wrong?

      Thanks in advance!

      1. Hey, this is probably running into a topic that has multiple /business/retail_location/address entries. Note how that is the only "unique" clause in your query. So what's happening is the first few pages of results have a single address, and then all the sudden it hits one entry that has 56 addresses! Maybe starbucks? :)


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  6.  

    Rate limit?

    1. I didn't see an answer to this in the documentation or email archives... If I want to build a Metaweb app, are there any rate limits on the number of queries or writes I can perform?

      Thanks,
      Tom

      1. For the time being, there are no limits on reads. We'd like to see how that goes.

        As for writes, there is a limit of 10,000 new "primitives" (topics, values, etc.) per day. If you'd like to do more than that, please contact us. See the perform a bulk upload topic for more.

      2. I had the same question and just saw this, incidentally. No read limits is very generous, but I have to ask, can you recommend best practices or guidelines? I'm designing an app where having the most current information would be valuable and can expect to make queries on behalf of a lot of users, but I don't want to abuse the system. Not sure whether, how much, and how long to cache queried data for.

      3. Mike,
        Our service is designed to be queried in real time. We cache the database answers at our end, so if you make the same MQL request over and over from different clients, the cost is relatively low. If you explicitly ask for an uncached response, or if you are trying to crawl the whole database, we request that you try it out on sandbox.freebase.com first.

        As for caching on your end, the data is all open, so you can cache it for as long as you wish, or decant it into other forms if that works well for your application.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  7.  

    Difficulty getting musical group members

    1. I am trying to create a query that can search for music artists, and return the members of the group (if they are a group), or ignore them if they are just a single person artist. The problem is:

      * Any query that looks up a "/music/artist", the "member" attribute isn't there.
      * Any query that looks up a "/music/musical_group" has access to "member", but will not return any results for non-group artists.
      * Any query that tries to load both types via "a:type" and "b:type" will give me an error "Type /type/object does not have property member"

      So is it correct to assume that I can also only access a single type/id combination at a time? So to do what I want there, I have to send two queries (one for artist, one for group), then merge the artist and group results together if there is a group result on my end?

      Seems a little messy. Surely there is a better way?

      1. Alex, when looking at any type, you can always access properties of other types by using the full property name. Try this query out:
        { "query" : [ { "/music/musical_group/member" : [ { "member" : null, "optional" : true } ], "id" : null, "name" : null, "type" : "/music/artist" } ] }

      2. Nice, thank you.

        I tried that, but I couldn't figure out the right property name. I see now its the domain/type/property. Very cool.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  8.  

    Linq for metaweb (dotnet 3.5)

    1. Any people interest by linq for metaweb ?

      1. I have. What do you have in mind ?

      2. Centralize developments for linq to metaweb on one website (codeplex projet).
        Do you have start code ?

      3. Projet url :
        http://www.codeplex.com/metawebToLinQ

      4. I'd like to help as a developer. Would you add my name to the project ? My id in Codeplex is anoguei

        Thanks.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  9.  

    Deleting a Single Type of a Multiple Type Instance

    1. I have not verified this directly with a public type because I don't want to delete someone else's data.

      However, I've created a user type which includes a public type. User type '/user/szaijan/fantasy_football/player', is also of type '/american_football/football_player'. 'LaDainian Tomlinson' was an existing instance of type '/american_football/football_player' to which I added type '/user/szaijan/fantasy_football/player'. Now I'd like to delete the type '/user/szaijan/fantasy_football/player' from the instance, along with all it's uniquely associated objects, without deleting the instance itself.

      How is this best done? Do I simply delete the unwanted type from the instance's set of types? If so, do I need to manually delete uniquely associated linked records (i.e. those linked record that uniquely point to the '/user/szaijan/fantasy_football/player' fields on the instance) or will the deletion of the type 'cascade' to associated records?

      1. you've got it: just click on the dropdown next to the type you want to remove and do it. Technically, the links will still exist but they won't be displayed in the freebase UI and people querying that topic through MQL won't see them unless they explicitly look for them, That doesn't sound very tidy, I know, but we can clean up orphan links like that, after the fact.

      2. Thanks Brendan. The fascist in me was hoping for a cleaner solution, but that'll do. ;^)


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  10.  

    Feature Requests

    1. Having been programming in MQL and using Freebase for about 10 days now, there are some items I'd like to see going forward. I'd love to hear what other users think before going forward with a formal RFE (Request for Enhancement.) What follows is the beginnings of my wishlist. Please forgive the constant references to sports leagues and fantasy football... it's been a long off-season and I chose a fantasy football tool as my test case for MQL and Freebase.

      Virtual Types: A type which can be added to other types, but which cannot be instantiated itself.
      - In the database I'm setting up, I have two types of record that have exactly the same fields. One is the Statistic, which is a record of an NFL player's performance in a given season, and the other is the Projection, which is a guess as to a player's performance in a given year, usually prior to the season actually beginning. Rather than entering the common attribute definitions into each type, I created a type called StatLine, which includes all of the shared fields, and included that type in the type definitions of Projection and Statistic. I'd like to be able to mark the StatLine type as virtual, so it cannot be instantiated,

      Cascading Deletes/Updates: I'd like to be able to mark unique reciprocal links such that when the parent instance in the relationship is deleted, all instances uniquely linked to that instance get deleted as well. Similarly, if the parent field by which the instances are linked is updated, all of the child instances' fields should be updated as well.

      Attribute Constraints: While the object attributes in Freebase can already be limited by type, it would be very helpful to be able to limit their values as well. For instance, A sports league was created in 1933. Many associated objects would reference a specific season of that league, and it would be helpful to be able to limit the input values. Ideally, I'd like to limit input values to dates which only include the year designation, and only allow values >=1932.

      It is possible that some or all of these functions are already available in MQL, but I could find no reference to them in the available documentation on the Freebase site. If so, pointers to the appropriate reference materials would be greatly appreciated.

      Please add to the discussion with your opinions of the above and add your own RFE thoughts.

      MJ

      1. I missed one:

        Unique Constraints: The ability to create a set of attributes, the values of which define a unique instance. i.e. for a Projection, the Season, Player, League attributes should uniquely define an instance. Trying to create a new instance with the same values in those fields should fail, or update the existing instance if the appropriate command is used. In the UI of Freebase, this could be implemented by creating a named instance of type /type/constraint/unqiue, then associating the appropriate attributes to the constraint through the standard look-up menu. No sure how or if MQL could handle this sort of constraint.

        P.S. I'm still not clear on how to structure a single query to create a new instance if the fields specified do not indicate that one exists, and instead to update the instance, if a unique instance is found. I know to use create:unless exists to create and connect:update to update, but I'm not sure how to do one or the other, as appropriate, in a single query. I'm thinking a create:unless_exists command at the top level, then a connect:update command in each field, but this seems inefficient. Still experimenting.


    Discussion is posted in:

    Think this discussion also relates to something else? Cross-post it by adding a new discussion area:

  11.  

    Metaweb Perl Module

    1. I've started work on writing a Perl module to provide an interface to Metaweb - heavily based around using Freebase at this point obviously.

      I just wanted to check that no one else was working on a similar undertaking. If no one else is, I'm proposing the Net::Metaweb name space and will publish it on CPAN. I'm working on a structure that will allow queries to be given as either perl objects (a la the example in the Freebase developer documentation) or as a JSON string, and to receive either for the response too.

      If anyone is interested in working on this, please let me know.

      1. I'd be interested, hds. I currently do quite a bit of work in Perl, both professionally and free time. Your idea sounds great. JdP