[Developers] Adding a webpage to a topic.
Alec Flett
alecf at metaweb.com
Thu Jun 12 16:38:13 UTC 2008
/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/622c117a/attachment.htm
More information about the Developers
mailing list