jack
unread,Nov 5, 2009, 9:27:40 PM11/5/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bibjson
I created a domain for bkn in a freebase user account called bkn. I
create only a few types so far. There are a lot of decisions to be
made regarding how we want to represent the schema in freebase. The
primary decisions to be made are how much of the existing "common"
freebase we use.
Another decision is to what degree do we want to wrap properties so
that we can add whatever metadata we want to a property instance. This
would be like having the ability to add metadata to a BibJSON "ref".
We also need to decide what we want to call the domain. I will try to
get "bkn" the current "bibliographicknowledgenetwork" is temporary.
For an initial test I created types:
author
organization
affiliation
department
(freebase automatically adds a topic type to a domain)
I created one author instance with one affiliation. To query for
jim_pitman author data I can do,
[{
"affiliation": [{
"organization": {
"name": null,
"id": null
},
"department": {
"name": null,
"id": null
}
}],
"id": "/en/jim_pitman",
"type": "/base/bibliographicknowledgenetwork/author"
}]
the result would be,
{
"code": "/api/status/ok",
"result": [{
"affiliation": [{
"department": {
"id": "/en/statistics",
"name": "Statistics"
},
"organization": {
"id": "/en/university_of_california_berkeley",
"name": "University of California, Berkeley"
}
}],
"id": "/en/jim_pitman",
"type": "/base/bibliographicknowledgenetwork/author"
}],
"status": "200 OK",
"transaction_id": "cache;cache01.p01.sjc1:8101;2009-11-06T02:20:17Z;
0016"
}
To query for some info about all schema in the domain you can do,
[{
"id": "/base/bibliographicknowledgenetwork",
"types": [{
"properties": [{
"expected_type": {
"name": null
},
"name": null,
"id": null
}],
"name": null,
"id": null
}],
"type": "/type/domain"
}]
and get this result,
{
"code": "/api/status/ok",
"result": [{
"id": "/base/bibliographicknowledgenetwork",
"type": "/type/domain",
"types": [
{
"id": "/base/bibliographicknowledgenetwork/topic",
"name": "Topic",
"properties": [
{
"expected_type": {
"name": "Text"
},
"id": "/base/bibliographicknowledgenetwork/topic/alias",
"name": "Also known as"
},
{
"expected_type": {
"name": "Document"
},
"id": "/base/bibliographicknowledgenetwork/topic/
article",
"name": "article"
},
{
"expected_type": {
"name": "Image"
},
"id": "/base/bibliographicknowledgenetwork/topic/image",
"name": "image"
},
{
"expected_type": {
"name": "Webpage"
},
"id": "/base/bibliographicknowledgenetwork/topic/
webpage",
"name": "Web Link(s)"
},
{
"expected_type": {
"name": "Topic"
},
"id": "/base/bibliographicknowledgenetwork/topic/
subjects",
"name": "Subjects"
},
{
"expected_type": {
"name": "Topic"
},
"id": "/base/bibliographicknowledgenetwork/topic/
subject_of",
"name": "Subject of"
}
]
},
{
"id": "/base/bibliographicknowledgenetwork/author",
"name": "Author",
"properties": [
{
"expected_type": {
"name": "Webpage"
},
"id": "/base/bibliographicknowledgenetwork/author/
homepage",
"name": "Homepage"
},
{
"expected_type": {
"name": "Webpage"
},
"id": "/base/bibliographicknowledgenetwork/author/
profile",
"name": "Profile"
},
{
"expected_type": {
"name": "Affiliation"
},
"id": "/base/bibliographicknowledgenetwork/author/
affiliation",
"name": "Affiliation"
}
]
},
{
"id": "/base/bibliographicknowledgenetwork/affiliation",
"name": "Affiliation",
"properties": [
{
"expected_type": {
"name": "Author"
},
"id": "/base/bibliographicknowledgenetwork/affiliation/
member",
"name": "Author"
},
{
"expected_type": {
"name": "Department"
},
"id": "/base/bibliographicknowledgenetwork/affiliation/
department",
"name": "Department"
},
{
"expected_type": {
"name": "Organization"
},
"id": "/base/bibliographicknowledgenetwork/affiliation/
organization",
"name": "Organization"
}
]
},
{
"id": "/base/bibliographicknowledgenetwork/organization",
"name": "Organization",
"properties": [{
"expected_type": {
"name": "Affiliation"
},
"id": "/base/bibliographicknowledgenetwork/organization/
author",
"name": "Author"
}]
}
]
}],
"status": "200 OK",
"transaction_id": "cache;cache01.p01.sjc1:8101;2009-11-06T02:05:43Z;
0007"
}
To query for every bit of detail about the domain you can query with:
[{
"id": "/base/bibliographicknowledgenetwork",
"types": [{*}]
"type": "/type/domain"
}]
the result is includes instance data:
{
"code": "/api/status/ok",
"result": [{
"id": "/base/bibliographicknowledgenetwork",
"type": "/type/domain",
"types": [
{
"attribution": "/user/bkn",
"creator": "/user/bkn",
"default_property": null,
"domain": "/base/bibliographicknowledgenetwork",
"expected_by": [],
"extends": [],
"guid": "#9202a8c04000641f800000000fe07df3",
"id": "/base/bibliographicknowledgenetwork/topic",
"instance": [
"Jim Pitman",
null,
null,
"University of California, Berkeley",
"Statistics"
],
"key": [
"topic"
],
"name": "Topic",
"permission": "/guid/9202a8c04000641f800000000fe07dda",
"properties": [
"/base/bibliographicknowledgenetwork/topic/alias",
"/base/bibliographicknowledgenetwork/topic/article",
"/base/bibliographicknowledgenetwork/topic/image",
"/base/bibliographicknowledgenetwork/topic/webpage",
"/base/bibliographicknowledgenetwork/topic/subjects",
"/base/bibliographicknowledgenetwork/topic/subject_of"
],
"search": [],
"timestamp": "2009-11-05T17:40:58.0039Z",
"type": [
"/type/type"
]
},
{
"attribution": "/user/bkn",
"creator": "/user/bkn",
"default_property": null,
"domain": "/base/bibliographicknowledgenetwork",
"expected_by": [
"/base/bibliographicknowledgenetwork/affiliation/member"
],
"extends": [],
"guid": "#9202a8c04000641f800000000fe15c3c",
"id": "/base/bibliographicknowledgenetwork/author",
"instance": [
"Jim Pitman"
],
"key": [
"author"
],
"name": "Author",
"permission": "/guid/9202a8c04000641f800000000fe07dda",
"properties": [
"/base/bibliographicknowledgenetwork/author/homepage",
"/base/bibliographicknowledgenetwork/author/profile",
"/base/bibliographicknowledgenetwork/author/affiliation"
],
"search": [],
"timestamp": "2009-11-05T22:43:34.0000Z",
"type": [
"/type/type"
]
},
{
"attribution": "/user/bkn",
"creator": "/user/bkn",
"default_property": null,
"domain": "/base/bibliographicknowledgenetwork",
"expected_by": [
"/base/bibliographicknowledgenetwork/author/affiliation",
"/base/bibliographicknowledgenetwork/organization/author"
],
"extends": [],
"guid": "#9202a8c04000641f800000000fe15c72",
"id": "/base/bibliographicknowledgenetwork/
affiliation",
"instance": [
null,
null
],
"key": [
"affiliation"
],
"name": "Affiliation",
"permission": "/guid/9202a8c04000641f800000000fe07dda",
"properties": [
"/base/bibliographicknowledgenetwork/affiliation/member",
"/base/bibliographicknowledgenetwork/affiliation/
department",
"/base/bibliographicknowledgenetwork/affiliation/
organization"
],
"search": [],
"timestamp": "2009-11-05T22:47:27.0000Z",
"type": [
"/type/type"
]
},
{
"attribution": "/user/bkn",
"creator": "/user/bkn",
"default_property": null,
"domain": "/base/bibliographicknowledgenetwork",
"expected_by": [
"/base/bibliographicknowledgenetwork/affiliation/department"
],
"extends": [],
"guid": "#9202a8c04000641f800000000fe15c82",
"id": "/base/bibliographicknowledgenetwork/
department",
"instance": [
"Statistics"
],
"key": [
"department"
],
"name": "Department",
"permission": "/guid/9202a8c04000641f800000000fe07dda",
"properties": [],
"search": [],
"timestamp": "2009-11-05T22:47:28.0000Z",
"type": [
"/type/type"
]
},
{
"attribution": "/user/bkn",
"creator": "/user/bkn",
"default_property": null,
"domain": "/base/bibliographicknowledgenetwork",
"expected_by": [
"/base/bibliographicknowledgenetwork/affiliation/
organization"
],
"extends": [],
"guid": "#9202a8c04000641f800000000fe16414",
"id": "/base/bibliographicknowledgenetwork/
organization",
"instance": [
"University of California, Berkeley"
],
"key": [
"organization"
],
"name": "Organization",
"permission": "/guid/9202a8c04000641f800000000fe07dda",
"properties": [
"/base/bibliographicknowledgenetwork/organization/author"
],
"search": [],
"timestamp": "2009-11-06T00:00:40.0000Z",
"type": [
"/type/type"
]
}
]
}],
"status": "200 OK",
"transaction_id": "cache;cache01.p01.sjc1:8101;2009-11-06T01:32:18Z;
0012"
}