[Developers] Creating new Relationships
Christian Hirsch
hirsch.christian at gmail.com
Wed Feb 20 22:53:02 UTC 2008
Hi,
I am developing an application which should be able to create new
relationships between existing topics. For example connect a movie to a
person with the relationship "story_by". I am trying to establish this with
3 known variables:
- the "source" id, e.g. the movie ID
- the "sink" id, e.g. the person ID
- the name of the relationship, e.g. "story_by"
As I found out, these 3 variables are not enough to create the relationshp
(if I'm wrong please correct me ;)... I have two questions:
1)
creating the relationship with the 3 mentioned variables alone doesn't work.
The following write request is missing the correct type
{
"id" : "movieID",
"story_by" : {
"connect" : "insert",
"id" : "personID"
},
}
this works:
{
"id" : "movieID",
"story_by" : {
"connect" : "insert",
"id" : "personID"
},
"type" : "/film/film"
}
So my question is: given only the 3 variables, What is the best way to find
out, that I need to use the type "/film/film"?
2)
the second write request above is still not enough to create the new
relationship. I need to assign a new type to the person. In this example I
need to do the following:
{
"id" : "personID",
"type" : {
"connect" : "insert",
"id" : "/film/film_story_contributor"
}
}
The question is again: how do I find out that the new type which needs to be
assigned to the person is "/film/film_story_contributor"?
Thanks,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20080221/12547423/attachment.htm
More information about the Developers
mailing list