Discussions on Help Center
Error Messages
It would be very helpful to have a list of query error codes with examples of what might generate them. I seem to be constantly running across "Expected a Dictionary or a list with one element error", any time I try to query instances with more than one type.
With that particular error message, we've recently improved the error message.. but we are also working on better API documentation.. we have some stuff in the works that will hopefully show up here in the next few weeks.
Cookies problem
I found a strange problem trying to upload some data to Metaweb. One client was writing data with no problems, another (with the same cookies, etc. ) was having authentication problems. An investigation with Ethereal showed:
first client was sending cookies on one line:
Cookie: last-write-cookie; user-cookie; user-auth-cookie ;
(I do not remember exact cookie names right now, the log is at home)
The second client:
Cookie: last-write-cookie;
Cookie: user-cookie;
Cookie: user-auth-cookie ;
After I made sure all cookies go in one line, a miracle happened: everything started to work.
I do not know http protocol well enough to know if it is a bug (not my area of expertise). Is it an expected behavior?
According to the ancient cookie spec, it looks like you're supposed to group them on one line: http://wp.netscape.com/newsref/std/cookie_spec.html
Sadly, I think that not all servers and clients completely follow this spec.
So I guess the answer is: no, that wasn't expected but if you can fix your client, that's probably preferred.
Thanks. My clients are weird: first is Emacs lisp url library, the second is Portable AllegroServe client library (common lisp). (this is because I am doing it for fun mostly). I'll try to talk to maintainers.
"Freebase"?
Is this really going to be the name? I understand the intended meaning/connotation, but shouldn't the colloquial drug-related meaning be taken into account?
There's a colloquial drug-related meaning? ; )
Yes, that really is going to be the name. Robert wrote a pretty good post on why we chose Freebase in his Blog a while back.
How can I be useful?
My knowledge base more visually oriented and I'm not sure how I can best contribute to this project- but I would like to as my schedule allows. I'm a graphic designer/illustrator- so I suppose I could just offer a "hey if you need a technical diagram for an entry- let me know." I guess I'm just looking for a wee niche here- know of one?
Thanks for offering. If something like this comes up, we can definitely get in touch.
How to 'unflag' a topic deletion ?
Accidentally flagged a topic for deletion, how do I unflag/undelete it ? Thanks
The only way currently is to add a note to the discussion board for that topic to the effect of "I made a mistake; please don't delete". That way, when the topic is reviewed, we'll know not to delete it and the flag will be removed.
Vandalism topic in Help Center FAQ produces error
The Vandalism topic link (http://www.freebase.com/view/9202a8c04000641f800000000420635d) in the Help Center FAQ question "How do I know the data's accurate?" produces an error page.
Thanks,
DA
Thanks for the heads-up. We'll look into it.
not in query
I try to find something like a negative predicate for my query but I didn't fint it anywhere...
Someone know the correct syntax for this ?
Depending on the exact structure, you can use the "optional" : clause. However, MQL is not optimized for negative
"forbidden"
queries, so for complex negatives, filtering the result is
recommended.
For the forbidden clause, here’s an
example of finding people who are not movie actors:
{
"query":[{
"id":null,
"limit":5,
"name":null,
"no:type":{
"id":"/film/actor",
"optional":"forbidden"
},
"type":[],
"yes:type":"/people/person"
}]
}Try that out in the query editor.
Thank you very much... but it seems it doesn't works.
my query is about the 'name' field and I want to exclude some substring...
OK, check this out. This will find people whose English names do not include the string “Bob”:
{
"query":[{
"a:name":null,
"id":null,
"name":[{
"lang":"/lang/en",
"optional":"forbidden",
"value":null,
"value~=":"Bob"
}],
"type":"/people/person"
}]
}
Queries Confusing Me...
Hi Guys,
I'm trying to do what I think is a basic query but I can't get my head around how to do this using MQL.
Basically I want to get a list of all games on the Xbox 360 - I've managed this so far:
{
"query":{
"games":[],
"name":"Xbox 360",
"type":"/cvg/cvg_platform"
}
}
Now this returns 2 results, nothing like I was expecting. Anyone know what I am doing wrong?
Cheers,
Chris
Chris, the platform schema shows that the “Games” property is hidden and deprecated; what you want is the “Games On This Platform” property (games_on_this_platform) instead. Keep in mind that that property points to a compound value type, so you will then need to ask for the game property of that.
{
"query":{
"games_on_this_platform":[{
"game":null
}],
"name":"Xbox 360",
"type":"/cvg/cvg_platform"
}
}
Thanks for the reply. I do have a suggestion/question though for the site in general. Why not show, on the site, the query used to generate the data on the page?
For example, this page: http://www.freebase.com/view/reorder/topic/en/xbox_360?propertyId=%2Fcvg%2Fcvg_platform%2Fgames_on_this_platform&returnUrl=http%3A%2F%2Fwww.freebase.com%2Fview%2Fxbox_360
It would be good to see the query used to generate all of those results and would make it easier for people to get to grips with it.
I agree with the last statement. I was wondering exactly the same thing.
"Why not show, on the site, the query used to generate the data on the page?"
Actually, you can get the queries for most things! Take a look at this page: http://tinyurl.com/6h28kt -- that's a list of computer games where I've added the "platform" column then filtered on "Xbox 360".
Then click on "Use Results" and then "See the query".
That gives you a MQL query you can use in your own apps or wherever.
Where to get DB info?
Greets,
Trying to get a handle on the freebase structure but I'm having a hard time figuring out how to know if a type particular type already exists. I managed to track down a few but I'm looking for a unified hierarchical view or even something straightforward, like a single text listing I can use ctrl+F in.
Also, have been looking at the query editor and such: looks good but how can I play with the actual SQL database--the schema, it's contents, etc?
Thanks in advance.
Awhile ago, I created a MJT app to browse domains and types:
http://dev.mqlx.com/~robert/mjt/trunk/examples/schemas/index.html
Also, if you need instruction on how to query MQL (Freebase doesn't speak SQL), see:
http://www.freebase.com/view/freebase/api
compound value types and MQL
Is there an object expressable in MQL to recognize a property as a compound value instead of a non-compound value?
Been searching the api documentation, but can't seem to find any pointers to this.
I think that's doable with type hints in the schema, but I'm not sure of the exact syntax. I'll see if I can get a more helpful answer.
that would be very helpful thanks!
The property you need to look for is /freebase/type_hints/mediator, e.g.:
{
"query":{
"/freebase/type_hints/mediator":null,
"id":"/music/recording_contribution",
"type":"/type/type"
}
}
db dump?
I cannot find a db dump. Where can it be downloaded - like wikipedia dumps at http://download.wikimedia.org/?
Hi minmax. To the best of my knowledge there is not currently any dump available. There was a recent thread about it on the dev mailing list, however, here. Here's one quote from the thread:
We intend to make our data available via some form of bulk
dump. Determining a good format is still an open question;
something like RDF would be very complete, but less accessible
for many people. Some form of tabular dump of particular
areas might be more useful to more people.
We'd be very interested to know what kind of dumps people
are creating for their own use (remember that any dump tool we
would create would pull data using exactly the same API that
you have access to). That would help us understand what formats
would be most useful to people.
Hope that helps.
We are indeed planning data dumps, probably in more than one format. We are still working on the details, Ill post more when we have something to show. In the meantime, you can access all the data and make a dump of relevant schema with the MQL API.
thanks for reply, this is very interesting, i'll join the mailing list
is there any update on a data dump feature?
a year is a datetime
The query editor agress, and will accept a query with a date:
{
"query" : [
{
"/people/person/date_of_birth" : "1975",
"name" : null,
"type" : "/film/actor"
}
]
}
But I'm getting "[message] => 1975 is a JSON integer, but the expected type is /type/datetime" when I use
http://www.freebase.com/api/service/mqlread
What should I be doing differently?
thanks!
Can you post the actual full GET request? Seems like an encoding issue... I would think you'd get that error if the service thinks it wasn't quoted as a string.
Definitions of common terms (i.e., Freebase jargon)
It would be helpful if the Important Terms in the Help Center was expanded to include definitions of frequently used data modeling terms. I've been able to slowly pick up this language through immersion but specific connotations of commonly used terms such as refactoring, co-typing (AKA cross-typing?), schema, etc. were new to me when I came here.
Add reciprocation, disambiguation, and link in to the list.
CVT/mediator, reconcilliation, disambiguation, guid/id, reflection ... also spring to mind
I'd like to now add character indicators of /types/, user_created_properties, "Topics", and $any*thing$ ^else^ that %programmers% might know & the !~rest~! of US -don't-. ;) These characters are often used as shorthand in the discussions and I'd be lying if I said I've figured them out yet. They do look efficient though, and probably not too difficult to learn if there was a reference for 5-10 major ones.
Question about MQL / "type" : "/location/location"
Hi Freebase,
when looking at http://www.freebase.com/view/guid/9202a8c04000641f800000000006ec5d i can see the longitude and latitude of "Madison, Wisconsin" (-89.4011 • 43.0731 ). However the MQL query editor return '"geolocation" : null' when I send the following query
{
"query" : {
"geolocation" : null,
"guid" : "#9202a8c04000641f800000000006ec5d",
"type" : "/location/location"
}
}
Why ? What am I missing ? Thanks for your help
Hi Lindenb,
"geolocation" here refers to an object of type "/location/geocode" that doesn't have a name.
Try replacing "geolocation" : null, with "geolocation" : { "*" : null },
great ! many thanks ! :-)
dictionary lookup
Is it possible to lookup a word and get its definition, word class, synonyms etc? I kept on looking but couldn't find it.
No, we don’t currently have information on words per se. It’s something we’ve discussed, though; what would your use case be? Are you interested in just browsing around, or (for example) is there an application that you would like to build that this would make possible?
I am trying to port my website at questsin.net to use freebase instead of mysql. My project is similar to a thesaurus but closer to google sets.. Closer to a related feature.. type in dog, and you could get dog, cat, pig etc. I am also working on a cluster feature that I have yet to release. Dog would return Animal, lifeform, and a few others. a dictionary schema could tell me the world class, how many senses etc. Topilogical features also impact suggestions. dog, cat, should return 3 letter animals with the third letter being a vowel, if the set exists. Might break convention if not enouh samples.
Have you looked at WordNet? That’s some data we’ve looked at importing, but it may be useful to you even before then.
One question we’re wrestling with is whether to conflate a word and its meaning: that is, should the topic for Dog be the same as the topic for the word “dog”? Is it appropriate for a single topic to be both an Animal and a Noun?
I've been aware and have been using wordnet for quite some time. There are also similar related projects called opencyc, learner and openmind. I would think there would be a new type called word with properties of language, meaning, word class, example ussage, synonyms, hypernym, hyponym and antonym, written frequency, oral frequency, web hit frequency. Just remember a word has multiple meannings. each meaning can have one world class.
I've hap hazardly unified these projects wordnet,opencyc, learner, openmind and a few other. The set is quite large but needs allot of clean up and standarization. I currently working on exporting into an owl ontology. Freebase seems to be too restrictive in types. I see a word type more useful than a topic type. When it has critical mass, someone could make the topic type.
An additional problem with integrating lexical information into Freebase is the problem of synonyms. In Freebase, we have one topic per thing/idea/whatever, which means that we have a topic named "arugula", which also covers the English synonym "rocket", the German name "Rauke", the French name "Roquette", etc. In fact, someone could rename the topic "rocket" and no harm would be done, since the information about the plant (species, cuisines used in, etc.) is the same no matter what you call it. From a linguistic or lexicographic viewpoint, however, each word would require its own topic, since the information about each word (etymology, language, region, etc.) is different, even though the thing each word refers to is the same.
So far in Freebase the approach has been a one-to-one mapping between an object and the topic for it, regardless of the object's names, synonyms, across different languages. Those are but labels to the "thing", and the "thing" was the essence. Well, to model language, where the interest is not in the "thing" itself but the ways we can refer to the "thing", it would make sense that each word becomes its own topic. We can then use aliases to capture alternative spellings, a noun's plural form or a verb's form in other tenses -- or those could be captured in structured properties as well. The point is, there's nothing built into Freebase that would make it unfit to model a dictionary. It can be done.
That's a very good point. The main problem, then, would be to prevent users from applying non-lexical types to the word topics. (That sounds like a problem for the relevance engine!)
Hi,
I think that topics map well onto Wordnet's id of a 'synset' (which is more or less an ontological entity that has been lexicalized). So, the Freebase Dog concept should (I think) have a connection to the Wordnet synset for dog, with appropriate versioning--that is, a connection to the Wordnet 2.1 or Wordnet 3.0 synset for dog.
Then, the word (lemma) 'dog' could be attached to synset for dog, and thereby make a connection to the topic /en/dog.
You could/should also connect Freebase types to Wordnet synsets, although this is a bit tricky (as we have found at Powerset).
For the purpose of modeling of a dictionary, there should be an entity representating each word: a topic for the word "dog" in english, a topic for the word "chien" in French, a topic for the word "perro" in Spanish, etc.
Linking the concept and the words for it would be easy with the structure of Freebase. As part of the schema for a Dictionary Word type, one of the properties could be "Concept the Word Represents", via which all of the words for "dog" ("chien", "perro", etc.) can link to the Freebase topic for the animal, Dog.
The word you're looking for, Faye, is "designatum". That is, dog is the designatum of the English noun "dog". Of course, foot, andiron, Canis Major, and a bunch of other things are also designata of the word "dog". And by most standards, it's the same word (as opposed to a homograph). The real trick here is that the designatum would have to be linked from each sense of the word. Modeling senses in Freebase could most easily be done as a CVT off the "word" (or lemma, or whatever) type, allowing the things that are common to the word (etymology, pronunciation, part of speech, etc.) to be on the topic, but the sense-specific data to be on the sense. The trouble is that these senses need to be reified to be used in something like WordNet, because synonymy and the like are dependent on the sense of the word, not the base form of the word. I haven't looked at WordNet in awhile, so I don't know how they handle polysemy (i.e., the condition of having multiple definitions).
I'm brand new to Freebase but interested in seeing Dictionary type information incorporated, particularly etymologies. I have some thoughts about organizing types. Also I wonder if we could collaborate with the XDXF project both for purposes of organizing datatypes and also for importing data from open source dictionaries.
My basic thoughts on adding dictionary words to Freebase (keep in mind I'm new here, so let me know if my thoughts are confused):
- The top level dictionary type should probably be the "grapheme" or some such. This is just a sequence of symbols, representing a "word". For homonyms, like "found", the grapheme would link to several semantic "word" entries. I think this is necessary, as for a grapheme like "found" even the etymology is different for the two different senses.
- Each semantic "word" should link to a "base word" and the different conjugations/inflections of the base word could point to the base word for information on meaning, etymology, etc. This corresponds to how most people would use dictionary type information.
Public VS Private Datasets
I just registered here today and the funny part is I'm not even sure how I navigated here. I think it had something to do with the book I just finished Programming Collective Intelligence
Since I have never heard of Freebase before I watched the intro video which was pretty cool and now I'm here. So far everything looks extremely interesting. As a developer I'm having a hard time wrapping my head around a few things.
I make, develop and work on websites and databases daily and what impresses me here is the shear connectivity between everything. So I'm curious how this happens so I can if possible improve my datasets...Everything is dynamically linked to everything else what ties everything together?
Freebase consists of only Public Data, or what could be considered facts? Names, Places, Things.
Private Data, or what could be consider personal information.
I am currently developing an International job website for people interested in living and working in Canada. So would it be possible to store my job posts on Freebase thus allowing others to display jobs in Canada?
Also regarding Jobs I wonder if Freebase has records regarding say default values for Industry and Positions
This last part might not make sense. Anyway it would be incredible if Freebase could develop a user based system perhaps similar to OpenID which is private to that user unless they are registered to a specific website. That would allow me to develop entirely on Freebase and also make it millions of times easier for users to register on accepted websites.
MyWebsite ( User Info ) <-> Freebase <-> AnotherWebsite x Infinity
ps - please add spell check to your toolbar, i can't spell ;)
There's a lot to respond to in here! I'll do what I can, and see if I can't get others to weigh in. My first thought is that job postings are essentially ephemeral and of little interest once the job posting has been filled or cancelled, which would not (in my opinion) make them a good candidate for storing in Freebase. Although I could certainly imagine a job posting site that used Freebase data for information about companies, industries, job titles, and the like. We don't currently have a comprehensive list of industries, professions, or positions at the moment. But we'd be happy to get more of this data, if you have access to a source for it.
Oh, and I forwarded on your request for a spell-checker.
ok cool, thanks for the reply.
I was also wondering for example. If I or someone decides to make a list of positions, industries, etc and some data is stored. What happens if in 3 months somone decides that it is not stored in the proper format or arrangement. So if someone decides to change the arrangement that would definietly cause a down-hill effect which would like break apps.
If it is a private domain created by you, nobody else will be able to modify it's types and their inherent properties at this time. If it is a Public Domain, the administrators will not make any significant changes without clear warnings in the data-modeling or developers email lists. These changes do occur, but usually they are limited to a single type (and most often a modification of a single property) and they are very infrequent for the well-established domains like film, people, business, etc.
Remember this site is still in late-alpha and so there will be necessary changes/modifications as needed. When Freebase reaches final-release stage there should be almost no significant changes within the Public Domains at that point without going through a vigorous vetting and community-wide notification process.
"If it is a private domain created by you, nobody else will be able to modify it's types and their inherent properties at this time."
So that kind of defeats the purpose a little, No one would be able to update the information outside of FreeBase. Which is rather terrible for me as a developer.
Perhaps:
- Someone on my website wants to add a movie ( this would also update Freebase, and anyone else linking )
- Someone wants to update a movie field
When I'm logged into Free base I can query and update.
On my website, My users and I are only able to query, not update?
If thats correct then I can't use this. In order for my website to become updateable by users they would all have to register on Freebase to simply update a movie on my website.
I think there’s a little confusion about types as opposed to instances. What Gordon is saying is that if you make a type in your private domain, other people will not be able to modify that type. However, they will be able to create instances of that type, and add property values. So, for instance, if you create an Employment Position type with a Salary Band property, I can add Data Pedant as an instance of Employment Position, and I can set the Salary Band property on that instance to $0–9,000. What I can’t do is add a Job Satisfaction property to Employment Position.
A separate question is the ability of users on your Web site to edit data in Freebase. Currently a user—some user—must be logged into Freebase to change any data. What we recommend for Web sites where the users may not have Freebase logins is that the Web site have a registered “bot” account with Freebase, which is used to make all the writes submitted by users of that site. That way, the individual users don’t need to log in, but the provenance of their contributions can still be tracked.
Licensing - Querying and Writing
I've found some topics on freebase which are under the GNU free documentation license (e.g. articles generated from wikipedia).
So I have two questions:
How would I query for the licensing of a topic using MQL?
How do I write to freebase under a different license (specifically the same license that wikipedia uses)?
This page won't give you help with the MQL part of your question, but it does explain how licensing is used in Freebase: http://www.freebase.com/signin/licensing
Oops, meant to make that a link: www.freebase.com/signin/licensing
Hi christian,
To expound on what Jeff is saying, at the bottom of the topic page there are usually blurbs about attribution. With the exception of Wikipedia summaries and some images, the content is typically distributed under the Creative Commons Attribution license or Public Domain. If you are looking for the attribution of a summary, then you can write a query to retrieve the properties of the /common/document associated with the topic:
{
"query" : {
"/common/topic/article" : [
{
"*" : null
}
],
"id" : "/topic/en/anthony_minghella",
"type" : "/common/topic"
}
}
The property source_uri has the original source URI of the summary.
With regards to the license for your contributions, we only accept contributions under CC-BY, as outlined in our TOS. GFDL is only supported for Wikipedia compatibility, not for user contributions.
Queries on aliases and descriptions?
How does one query for the aliases and descriptions on topics?
What's the connection between names (ie values of the name property) and Wikipedia topics?
Why is there a distinction between names and aliases?
The type /common/topic has the properties alias and article that you can query for. To fetch the description, you will need also query CDB for the content.
Unless an user has modified the display name, the FB topics that were loaded from WP should have identical names. However, I would not rely on being able to reconcile the WP topic name vs. the FB topic name. A much easier method is to query against a topic for WP keys.
An alias is not the same as a name - it can be an assumed or common name or an AKA that is not the official name of a topic. Take a look at San Francisco, for example.
Thanks.
Would you mind showing me how to get the aliases and descriptions for San Francisco ... for example, how would I modify this query?
{ "id" : "/guid/9202a8c04000641f8000000000061a55", "name" : [], "type" : "/location/citytown"}
to add alias and article info?
(Sorry, really didn't need that type pair).
{ "id" : "/guid/9202a8c04000641f8000000000061a55", "name" : []}
The alias and article are properties of the type /common/topic, and you will want to write your query as such:
{
"alias" : [],
"article" : {
"id" : null
},
"id" : "/guid/9202a8c04000641f8000000000061a55",
"type" : "/common/topic"
}
As mentioned in my previous post, to retrieve the description content, you will need to also query CDB for that.
querying for empty sets
I'm trying to do a look-up for something that has an empty set for one of its properties, which would look like [], but it thinks i'm asking it to fill the empty set in. How do i ask for empty sets?
If you want only empty sets, you can forbid a value:
"propname" : [ { "id" : null, "optional" : "forbidden" } ]
If you want to allow empty sets, but get values when there are any, you also use optional:
"propname" : [ { "id" : null, "optional" : true } ]
And as you have found, if you only want values to be present, you can use empty brackets:
"propname" : []
or be more detailed:
"propname" : [ { "someotherprop" : null, "id" : null } ]
How does Freebase cite *its* sources?
Freebase has a very reasonable policy requiring those who use Freebase contents to cite Freebase as a source. Also, very reasonably, it is requested that such citations should cite the particular segment of Freebase that is being used, if at all possible, and not Freebase as a whole.
What worries me, however, is that there does not seem to be any slot whereby Freebase does the same to *its* sources. There are after all other similar initiatives which also use Creative Commons or FSF licenses, and it is clear from the Freebase contribution instructions that a lot of such material has been imported into Freebase. But then, where are the exact citations? Logically they ought to be in every exported dataset, but I looked at a few of those, and they do not seem contain any attributions, nor even a reasonable slot for putting those attributions.
Our intention is certainly to cite our sources as much as we’re able. Can you give a specific example where you think we’ve missed it? We would like to correct any lapses.
The Freebase.com client displays general attribution for our mass data sources, including Wikipedia and MusicBrainz (even though the MusicBrainz data is, strictly, public domain). Topic blurbs derived from Wikipedia have a stated GFDL license, which our users are required to pass on; images also have explicit license information attached to them.
Our data dumps, as series of tuples, may be a little trickier to interpret, since the permissions data itself is stored among those tuples. Knowledge of the data set is necessary to find the licensing data.
I was mostly thinking of the data dumps, i e when data is extracted from FreeBase in order to be incorporated in an application, or in another database that is similar to FreeBase. If the GFDL is to be respected strictly then it seems that each extracted file should contain sections that conform to GFDL requirements concerning title page, a link to the full text of the GFDL license, etc. This may be too strict and not everyone follows those rules exactly, but only having the licensing information somewhere among the tab-separated tuples does not seem right. I understand the need for making it easy to import dumps into other systems, but there ought to be a straightforward way of organizing dumps into two or three parts that are clearly distinguishable and where one of them contains the (tab-separated, or marked-up) data dump and other parts contain licensing information.
Think of it this way: would you be happy if someone else imported a lot of data from FreeBase into their similar system and they were to use your policy for the citation information?
Erik,
The data dumps, consisting of the tuples from the Freebase store, are all CC-BY licensed. The exceptions to CC-BY in Freebase are in the LOB store: Wikipedia-derived blurbs (GFDL) and variously-licensed images.
It will always be the case that the structure of information needs to be understood in order for the information itself to be understood. One must be able to read to extract content from a book; one must know to look for and how to interpret a copyright page in order to understand the legal status of that book’s content. Freebase is no different; one must understand the Freebase.com UI or MQL in order to extract content, and one must understand how licensing is represented in Freebase in order to correctly associate a license with a given assertion.
We don’t care how someone stores the license information about Freebase; we care that it the attribution is made apparent to their users. If that means that their users are required to perform a query against their database to determine if a particular fact came from Freebase, so be it.
Thanks for the interesting questions.
How does a domain administrator add new administrators?
I was unable to find a help topic on this.
Danny,
If logged in as one of the administrators of a domain, you should see a little Edit button next to the Administrators heading. That should allow you to edit that list just as you would for any other property on a topic.
I think if you wait patiently it will become much much easier to do so from the client interface on the domain page in the next releases.
That said, one can do so from the explore view to find the outgoing property for the domain owners and then using the admin tool to edit the list of members (F8 for the developer toolbar)
Thant was easy. Thanks.
query problem
Good morning,
hope everyone out there is happy.
I just started with playing around with the freebase api so I guess this question is a stupid one but I can't see what is going wrong right now.
I want to get all webpages listed on the Carl Jung site.
[
{
"name" : "Carl Jung",
"type" : "/common/topic",
"webpage" : [
{
"uri" : []
}
]
}
]
This query just replies one uri even so on the respective freebase site
http://freebase.com/view/en/carl_jung
are two links.
Any suggestions highly appreciated.
cheers
martin
ps What I am working on right now is a prefuse flare visualization of the web of influence nodes in freebase. I did something link that with java prefuse before (not freebase based)
http://goosebumps4all.net/34all/genealogy.phtml?person=Jung
but for me java and webpages never really fit together ...
Martin,
The client is a little misleading when it comes to the “Weblinks” section. Any URI-valued property ends up over there, as does the Wikipedia link for topics that have keys in the /wikipedia/en_id namespace. So you see two links for Carl Jung in the client, but really there is one Wikipedia key and one value for /common/topic/webpage, which is what you are seeing in your query result.
The Explore view for a topic can help make this clearer.
Good morning Crism,
thanks a lot for the reply and the clarification and sorry for responding late, I was offline this week. And thanks for pointing to the explorer view which I haven't discovered yet and is indeed very helpful and also answers my questions.
Cheers
martin
Managing Data Quality
I just came across your site today. It is definitely going to fill a big hole in managing data across the web. Great job!!
The question that I have is in regards to achieving the necessary quality of data to run a business where the quality of data is really important. I can see where the processes driving your site will achieve reasonable quality of any given data set and that level of quality will be good enough for many types of businesses. If I want to know about movies, or actors, or music I'm not going to die if the list isn't 100% correct. But if I run a hospital am I ever going to rely on the Freebase database as a reference data source for mission critical processes?
So I guess that's my question. Do you see Freebase running mission critical systems? I believe that the answer would be no but I could be completely wrong.
Hi doug, and welcome to Freebase.
You're correct in thinking that data quality is a big issue. There's nothing stopping someone coming and changing/editing anything in here, so I wouldn't want to rely on it for eg. drug dosage information, or stuff like that. Having said that, though, we are putting some thought into this. We recently added a feature to our query language to allow you to specify "as_of_time" which means that if you are aware of a known-good version of the data (for instance, one that's been through an editorial process and you have confirmed that it's accurate) then you can fetch that version of the data and ignore any more recent changes. So there are ways to increase the reliability and reduce the likelihood of malicious or accidental edits messing up your app.
Empty Webpage/Uri kills entire query?
I'm trying to generalize how I obtain data about individuals, and am trying to use something like:
{"query" : {
"/common/topic/webpage" : [
{
"uri" : null
}
],
"/people/person/spouse_s" : [
{
"spouse" : [
{
"name" : null
}
]
}
],
"id" : "/en/ronald_reagan",
"name" : null
}
}
This works just fine...as long as webpage/uri exists. For the above example, Mr. Reagan doesn't have a webpage, and the query returns a completely null result set (i.e. nothing about spouses either). Removing the webpage clause returns the other data as expected.
Any thoughts on how I could re-structure the query so that it returns whatever it has?
Thanks
Add "optional":True to your webpage clause (or any other clause where data could be optional). See section 3.2.16 of the Metaweb Query Language documentation.
What's the difference between More and Less Descriptions
In the new UI there is a "More" and "Less" view of the description. The less view seems to be the same as what is shown in the Search. The More view seems to be a longer version if one is available. What is the difference between them and are they populated in different ways?
One of the reasons I ask is that the Motorcycle domain's search description does not begin with the beginning of the More description. It pulls from hyperlinks further down the page. I've previously brought this up (i.e., complained) several times in several discussions and no one has ever responded. Now I see that the Less view has that strange description while the More view looks like it should. Maybe these differences will help narrow down why this error is occurring so that recommendations can be made for fixing it. Thank you.
Ed, that looks like a bug. The less description is generally supposed to be only the first 1000 or so characters, but otherwise identical to the more description -- it was a known issue that the less wasn't showing rich HTML formatting, but it seems to have manifested itself strangely on your domain.
Thanks Dan.
how to get image link
Good morning,
hope all are well.
I just picked up my freebase green field project "genealogy of influences browser" again today and things go smooth so far. What I struggle with at the moment is how to get an image link for a person, for example the follwing image of Carl Jung
http://freebase.com/view/wikipedia/images/en_id/4783895
I guess I miss something obvious - any suggestions highly appreciated
cheers
martin
ps early alpha version of the browser
http://goosebumps4all.net/goi/test.html
Very nice :)
I'd ask this question on the developer's mail list, you'd get a more rapid response.
Hello gmacknez,
thanks a lot for the reply. I wasn't aware of the developer's mail list, looks like a great source of information. So I will wait a little if I get an answer here and if not I will repost my question there.
cheers
Good morning,
hope all are well.
Just found out how to get this link - so for the case some othe newbie need to get this done
[
{
"/common/topic/image" : {
"id" : null,
"name" : null
},
"name" : "Carl Jung",
"type" : "/influence/influence_node"
}
]
Not as complicated as I was struggling around for a while :-)
cheers
martin
Missing example / broken link in API specs
New user here. My startup (http://www.polarate.com) is working to integrate Freebase into a tagging system we're developing. Freebase can eliminate some of the problems of folksonomy-based systems. I was very happy to discover that there was a link to an example that seemed to detail exactly what I needed (Example: Auto-completion with mqlread) but discovered that it had been removed.
Does anyone know where I can find it? Also, is freebase going to release a search API? That would also be similar to what I need.
Hi, I think you're looking for the search api and Freebase Suggest (JS library for web browsers).
connecting to freebase instead of sandbox.
Trying to get a geolocation on a citytown but the sandbox is messed up and missing this property completely. So I get:
Type /location/citytown does not have property geolocation
Made a script that sets the source of script html element and the callback works ok untill I start trying to get value for geolocation, this might be because the sandbox does not have this property. So go to freebase and log in. After opening my page Temper data shows the following cookie sent:
Cookie=__utma=118736350.979481104.1211725296.1211725296.1211725296.1; __utmb=118736350; __utmc=118736350; __utmz=118736350.1211725296.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=
Under firefox tools -> options -> privacy -> show cookies -> filter on freebase
I have metaweb-user and metaweb-user-info
These cookies are obviously not sent when setting the source (src property) for the script element.
Removing all cookies will give me the same result, I suspect that no cookie means no authentication so I get data from the sandbox, in the sandbox the citytown is broken and indead has no geolocation property.
My question is: how do I get data from freebase instead of sandbox.freebase, the manual says just log in and the cookie will be sent but it is not sent.
Here is the script:
var props = {
query_url : "http://www.freebase.com/api/service/mqlread",
get_airports_by_city_name : '[{"geolocation" : null,"name" : "amsterdam","type" : "/location/citytown"}]',
}
function do_search(){
var scr = document.createElement("script");
var query = props.query_url
+ '?queries={"airport_by_city":{"query":'
+ props.get_airports_by_city_name
+ "}}&callback=search_result";
scr.src = query;
document.body.appendChild(scr);
}
function search_result(result){
var b = result;
try{
alert(result.airport_by_city.messages[0].message);
}catch(e){
}
var t = 0; // here to put a breakpoint in firebug
}
window.onload = do_search;
The type citytown includes the type location, and that included type has the property geolocation. You'll need to construct your query to ask for the property from that type, something like:
[{"/location/location/geolocation" : [{"latitude":null, "longitude":null}],"name" : "amsterdam","type" : "/location/citytown"}]
Note that geocode is a compound value type and if you ask for null in your query, it won't return anything useful.
Thanks cheunger for your reply, What I was trying to do is find all airports within a certain geolocation (eg google maps) but when using the query builder I got no geopoints. airport has a serves property which is a location. Looking for aiports in a location named amsterdam gives me the airport but no geolocation. Somehow this instance of location named amsterdam does not have geopoints or (more likely) my query is not correct:
This returnes no records:
[
{
"name" : null,
"serves" : [
{
"containedby" : [
{
"name" : null
}
],
"geolocation" : [
{
"latitude" : null,
"longitude" : null
}
],
"id" : null,
"name" : "amsterdam"
}
],
"type" : "/aviation/airport"
}
]
This returns the airport but no geolocation:
[
{
"name" : null,
"serves" : [
{
"containedby" : [
{
"name" : null
}
],
"geolocation" : [],
"id" : null,
"name" : "amsterdam"
}
],
"type" : "/aviation/airport"
}
]
The following query shows 2 locations named amsterdam that are contained by netherlands, the one without geolocation is the one used in serves for airport.
What I don't understand is why service points to another amsterdam and a version that is incomplete.
sorry, forgot the query, here it is:
[
{
"containedby" : [
{
"name" : "Netherlands"
}
],
"geolocation" : [
{
"latitude" : null,
"longitude" : null,
"optional" : true
}
],
"id" : null,
"name" : "amsterdam",
"type" : "/location/location"
}
]
I think I got it, the service object of that airport links to the following location:
http://freebase.com/view/guid/9202a8c04000641f8000000000004475
There was indead no geolocation for this object it is the amsterdam that serves as Administrative Division.
Most airports are cotyped as a location (6085 cotyped as location, 172 are not). You can construct a query for all airports with a geocode like this:
[
{
"/location/location/geolocation" : [
{
"latitude" : null,
"longitude" : null
}
],
"id" : null,
"name" : null,
"type" : "/aviation/airport"
}
]
I actually think airport should include the type location and I'll create an internal task to follow up with that.
Thank you chenger for your reply.
I thought that if airport is linked with location than location is linked with airport and thus I can get all airports for netherlands but somehow I must be doing something wrong.
Looking at the schema only makes stuff more confusing since this: http://dev.mqlx.com/~darin/ftv/ shows me that location is not linked with airport but airport is linked with location.
[
{
"contains" : [
{
"/aviation/airport" : [
{
"id" : null,
"name" : null
}
],
"id" : null,
"name" : null
}
],
"id" : null,
"limit" : 2000,
"name~=" : "*nether*",
"type" : "/location/location"
}
]
Output for this query is:
{
"code" : "/api/status/error",
"messages" : [
{
"code" : "/api/status/error/mql/type",
"info" : {
"expected_type" : "/aviation"
},
"message" : "Unable to load a schema for type /aviation",
"path" : "contains",
"query" : [
{
"contains" : [
{
"/aviation/airport" : [
{
"id" : null,
"name" : null
}
],
"error_inside" : ".",
"id" : null,
"name" : null
}
],
"id" : null,
"limit" : 2000,
"name~=" : "*nether*",
"type" : "/location/location"
}
]
}
]
}
Kind regards,
Harm Meijer
The containedby property on location does not necessarily include airports, therefore your query of finding all airports that are contained by netherlands may not return results. Similarly, your query of finding airports that serve Netherlands may not return results because Netherlands may not be linked to the serves property. Your final query of trying to find all airports that contain "*nether*" will work for airports that actually contain that part of the phrase, but I wouldn't expect Amsterdam Schiphol Airport to return in that result set.
I would suggest that for the all Netherlands airports, type them as a location if they are not already, add Netherlands to containedby, and then this query would work:
[
{
"/location/location/containedby" : {
"id" : "/en/netherlands"
},
"/location/location/geolocation" : [
{
"latitude" : null,
"longitude" : null
}
],
"id" : null,
"name" : null,
"type" : "/aviation/airport"
}
]
I've done Schiphol as an example.
Lastly, your latest query has some errors. You will want to ask for the topics that are of type /aviation/airport in your contains clause:
[
{
"contains" : [
{
"id" : null,
"name" : null,
"type" : "/aviation/airport"
}
],
"id" : null,
"limit" : 2000,
"name~=" : "*nether*",
"type" : "/location/location"
}
]
Generally, you will also want to use the id /en/netherlands instead of the name property.
Thanks,
I thought that airport and location somehow have a many to many relation so I could ask for all airports (or count) in a location like "*nether*".
Instead of linking the 2 records some airports are "subclasses" of location right? So it will be impossible to query (count) of all airports for a lokation that has a name like "*your search here*" Unless you query locations and then for each record query airports to see if their service or service.containedby has that location.
Thanks again you for your help, I will probably forget about displaying airport count in the autocomplete result and only show that on selection.
FYI - all airports have now been cotyped as a location.
You can ask for all airports in a location like "*nether*, but a link connecting the topics has to be present for query to return results. In this case, the airport as type location has to be containedby Netherlands.
Included types is somewhat analogous to subclassing, but not exactly, since the included type can be unlinked. It is possible to count all the airports of a location, the airport just needs to be containedby another location.
I get it now, in a traditional relational database airport and location relation is many to many. In the metaweb db is is done by cotyping airport as location so you can add airport as a contained by location.
What I need to do now is set the airports as contains value for the correct locations since this is not done for most of the airports. For example China has only one airport.
And if I need the geolocation of the airport I just refer back to it's cotype location, the query would look something like this:
[
{
"contains" : [
{
"/location/location/geolocation" : {
"latitude" : null,
"longitude" : null
},
"id" : null,
"name" : null,
"type" : "/aviation/airport"
}
],
"id" : null,
"limit" : 2000,
"name~=" : "*nether*",
"type" : "/location/location"
}
]
Thanks for all your help.
Improving on Wikipedia Imports?
I'm just getting started with this site. My particular area of interest is mycology (the study of fungi). I see that a number of my images have already made their way to Freebase via Wikipedia via my website, the Mushroom Observer. I have no problem with the images being on the site, but they have lost attribution along the way. Technically they have also lost their 'share-alike-ness'. I've correct a few by hand, but this is rather tedious.
Are there things I can do to speed up the correction process? Regardless of correcting the existing data, what can I do on my site to help get the attribution correct along this path? It looks like the copy to Wikipedia was done by hand and is probably where the attribution was lost.
The second question I have is how can I get data from my site to automatically feed into Freebase? I'm fairly new to RDF, but I have a good background in databases and software development. Existing examples or someone willing to mentor a newbie would be particularly helpful.
Thanks,
There are others who will better respond to your primary concerns about attributions.
Your secondary issue might get a more informed response by joining and asking on the Data Modeling Mail List that can be joined/browsed here.
(upper right hand of the right rail/column of the page)
Thanks for the reply and the help. I'll try posting to the Data Modeling Mail List.
Regarding the attribution info, I dug a bit deeper into Wikipedia and both the attribution and the licensing information is there. I make sure that both issues (use of cc-by-sa and lack of attribution) are filed as bugs.
Reading properties with forward slashes in javascript
I use setting the source of a script tag and the callback function, the object returns properties with forward slashes and I don't know how to read them.
For example:
var result = {
"/location/location/containedby" : "the value",
otherval : 22
}
This is perfectly good javascript (no errors) and firebug shows the properties of result but I can't read /location/location/containedby property.
result./location/location/containedby causes syntax error.
Reading properties that have forward slashes in their name with javascript
I am setting the src property of a script html element and use the callback. The results have a property that has forward slashes in its name and I am unable to read that property.
For example:
var result = {
"/location/location/containedby" : "the value",
otherval : 22
}
How do you get the value for /location/location/containedby?
variable names are not supposed to have forward slashes in their names so :
result./location/location/containedby will give a syntax error.
Have you tried single quoting instead of double quoting? I think the freebase-suggest examples use single quotes in their Javascript.
you need to use the brackets form:
result['/location/location/containedby']
(cheuner - Javascript treats single and double quotes identically)
Thanks, Will. My JavaScript skills are not savvy, as you can tell.
Thanks, both of you.
result['/location/location/containedby'] is the sollution.
Sorry for posting this twice, firefox crashed while posting the first time and my post didn't show up when vieuwing this page.
How to get /common/document from a found topic
Hi again,
I am trying to figure out how to get /common/document (or pictures or wiki links) from a found topic.
For example australia has an id of 9202a8c04000641f8000000000b7b9fd
Works when I use the view page:
http://freebase.com/view/guid/9202a8c04000641f8000000000b7b9fd
But not for the trans service:
http://www.freebase.com/api/trans/raw/%239202a8c04000641f8000000000b7b9fd
The query guide shows us how to get albums from the police but not how to get pictures for it, the only example is digging recent stuff out of /common/document and /common/image directly without any relation to other topics.
My question is: can someone show me how to get the /common/document and /common/image for australia, editing the query below?
[
{
"guid" : [
{
"type" : "/type/id",
"value" : "#9202a8c04000641f8000000000b7b9fd"
}
],
"name" : null
}
]
The id for the topic is not the same as the id of the image on our blob store. /common/topic has a property image which contains the (potentially multiple) ids to the images located on our blob server.
The query:
{
"id" : "/en/australia",
"image" : [
{
"id" : null
}
],
"type" : "/common/topic"
}
Returns 1 result - if you then use that id with the trans service, you get this.
Thanks again cheunger, the metaweb read service help is incorrect about fetching documents though.
http://freebase.com/view/guid/9202a8c04000641f800000000544e139
section 4.8 states "The trans service does not support a callback parameter as the mqlread service does", this is outdated since the api states it can and it can:
http://www.freebase.com/view/guid/9202a8c04000641f8000000007628edf
This way I can format the document without using a proxy.
How to handle "duplicate errors"
I want to determine the WIkipedia IDs and addresses for all houses in "California" but am getting duplicate WIkipedia IDs that cause my query to error out.
This query works:
[
{
"/architecture/structure/address" : [
{
"citytown" : null,
"state_province_region" : "California",
"street_address" : null
}
],
"id" : null,
"limit" : 100,
"name" : null,
"type" : "/architecture/house"
}
]
But when I attempt to get the Wikipedia IDs, an error is thrown. I would be OK with getting both Wikipedia IDs or to simply ignore any results with duplicates.
Here is the query that throws the error: "Unique query may have at most one result. Got 2". Same query as above but with additional request for Wikipedia IDs.
[
{
"/architecture/structure/address" : [
{
"citytown" : null,
"state_province_region" : "California",
"street_address" : null
}
],
"id" : null,
"key" : [
{
"namespace" : "/wikipedia/en_id",
"value" : null
}
],
"limit" : 100,
"name" : null,
"type" : "/architecture/house"
}
]
All help is greatly appreciated.
Thanks,
Biosopher
How to handle duplicate results
I want to find Wikipedia IDs for all the houses listed in Los Angeles. The query below finds all the houses in LA:
[
{
"/architecture/structure/address" : [
{
"citytown" : "Los Angeles",
"state_province_region" : "California"
}
],
"limit" : 100,
"name" : null,
"type" : "/architecture/house"
}
]
However adding the request for Wikipedia IDs results in a "Unique query may have at most one result" error. How can I ignore all duplicate results or create a non-unique query that returns the duplicates?
Here is the Wikipedia ID query that fails. It's identical to the above query except the Wikipedia ID request.
[
{
"/architecture/structure/address" : [
{
"citytown" : "Los Angeles",
"state_province_region" : "California",
"street_address" : null
}
],
