[Developers] Adding a webpage to a topic.
Jeff Prucher
jeff at metaweb.com
Thu Jun 12 17:25:15 UTC 2008
One reason to do it Alec's way is that if two topics link to the same
Webpage instance, and it gets changed from one topic, it will be changed for
both.
Jeff
_____
From: developers-bounces at freebase.com
[mailto:developers-bounces at freebase.com] On Behalf Of Arthur van Hoff
Sent: Thursday, June 12, 2008 9:49 AM
To: For discussions about MQL,Freebase API and apps built on Freebase
Subject: Re: [Developers] Adding a webpage to a topic.
Ok, that seems inefficient, but I'm happy to do that.
From: developers-bounces at freebase.com
[mailto:developers-bounces at freebase.com] On Behalf Of Alec Flett
Sent: Thursday, June 12, 2008 9:38 AM
To: For discussions about MQL,Freebase API and apps built on Freebase
Subject: Re: [Developers] Adding a webpage to a topic.
/common/webpage instances are not supposed to be shared - they're like any
other Compound Value type in that sense. You should create a new one for
each topic that wants to link to that url.
So really it would be best if you used "create": "unconditional" (or maybe
"create": "unless_connected", which really does what you want)
Alec
On Jun 12, 2008, at 9:20 AM, Arthur van Hoff wrote:
I'm having some trouble adding a web page to a topic using a script, but it
fails because multiple instances of the webpage exist with the same uri. I
want to add http://www.nytimes.com to a topic, but unfortunately two
instances with that uri exist. A third instance with a trailing slash also
exists but it is ignored in this case.
How should I handle this case? I really don't care which instance is linked
to since presumably the two instances will eventually be merged (although I
am not sure if that is possible in the current UI).
Write query on sandbox:
{
"id": "/guid/9202a8c04000641f8000000006c2cbbd",
"type": "/common/topic",
"webpage": [{
"type": "/common/webpage",
"uri": "http://www.nytimes.com",
"connect": "insert",
"create": "unless_exists"
}]
}
Resulting error:
{
"status": "200 OK",
"code": "/api/status/error",
"messages": [
{
"info": {
"count": 2,
"guids": [
"#9202a8c04000641f80000000048e4d06",
"#9202a8c04000641f80000000080cc9df"
]
},
"query": {
"webpage": [
{
"create": "unless_exists",
"type": "/common/webpage",
"uri": "http://www.nytimes.com",
"error_inside": ".",
"connect": "insert"
}
],
"type": "/common/topic",
"id": "/guid/9202a8c04000641f8000000006c2cbbd"
},
"message": "Need a unique result to attach here, not 2",
"code": "/api/status/error/mql/result",
"path": "webpage"
}
]
}
___________________________________________
Arthur van Hoff, Dell-ZING, CTO Software and Services.
W: 650-267-2413, F: 650-267-2498, M: 650-283-0842
_______________________________________________
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/20080612/2f11482e/attachment.htm
More information about the Developers
mailing list