view2 rename
author:
contributor:
published:
updated:
source uri:
Summary
var id = acre.environ.path_info;
var settings = acre.environ.params;
var tabIndex = 0...
Content
var id = acre.environ.path_info;
var settings = acre.environ.params;
var tabIndex = 0;
var tabBodyIndex = 0;
var commonProperties = {};
var uniqueProperties = [];
var disambiguatorProperties = [];
var separateProperties = [];
var separateTypes = [];
var combinedTypes = [];
var processTypeEntry = function(typeEntry) {
if (typeEntry.id == "/common/topic") {
processCommonTopicType(typeEntry);
} else {
processOtherType(typeEntry);
}
};
var processCommonTopicType = function(typeEntry) {
for (p in typeEntry.properties) {
var propertyEntry = typeEntry.properties[p];
var dataEntries = propertyEntry.data;
if (dataEntries.length == 0) {
continue;
}
commonProperties[propertyEntry.id] = dataEntries;
}
};
var processOtherType = function(typeEntry) {
var typeRecord = {
typeEntry: typeEntry,
propertyEntries: []
};
for (p in typeEntry.properties) {
var propertyEntry = typeEntry.properties[p];
var dataEntries = propertyEntry.data;
if (dataEntries == null || dataEntries.length == 0) {
continue;
}
if (propertyEntry.unique) {
uniqueProperties.push(propertyEntry);
} else if (propertyEntry.disambiguator && propertyEntry.expected_type["/freebase/type_hints/mediator"] != true) {
disambiguatorProperties.push(propertyEntry);
} else if (dataEntries.length > 3) {
separateProperties.push(propertyEntry);
} else {
typeRecord.propertyEntries.push(propertyEntry);
}
}
if (typeRecord.propertyEntries.length > 0){
if (typeRecord.propertyEntries.length > 3) {
separateTypes.push(typeRecord);
} else {
combinedTypes.push(typeRecord);
}
}
};
if (id != '/') {
var util = acre.require("worker");
var o = util.getHotshot(id, settings);
for (d in o.domains){
var domain = o.domains[d];
for (t in domain.types) {
var typeEntry = domain.types[t];
processTypeEntry(typeEntry);
}
}
separateTypes.sort(function(a, b) {
return b.propertyEntries.length - a.propertyEntries.length;
});
}
Freebase Parallax: $o.nameAlso known as: , $entry.value
var text = dataEntries[0].value;
if (text.length > 500) {
text = text.substr(0, 500);
var space = text.lastIndexOf(" ");
if (space > 0) {
text = text.substr(0, space);
}
text += "...";
}
$text Web Linksvar url = link['/common/webpage/uri'][0].value;
${util.getFirstValue(link['/common/webpage/description'], url)}
${valueEntry.name||valueEntry.id}
$valueEntry.value
${renderPropertyValue(valueEntry)}
» browse all
var subValueEntries = valueEntry[subProperty.id];
var path2 = path.concat(subProperty.id);
counts[subProperty.id] += subValueEntries.length;
${renderValuePropertyValues(subProperty, subValueEntries, subProperty.expected_type, path2)}
» browse all
${renderCVTPropertyValues(propertyEntry, valueEntries, expectedType, path)}
${renderValuePropertyValues(propertyEntry, valueEntries, expectedType, path)}
$propertyEntry.name
${renderPropertyValues(propertyEntry, propertyEntry.data, propertyEntry.expected_type, [propertyEntry.id])}
var paren = label.indexOf(" (");
if (paren > 0) {
label = label.substr(0, paren);
}
$label
tabIndex++
${renderProperty(propertyEntry)}
${renderPropertyValues(properties, properties.data, properties.expected_type, [properties.id])}
tabBodyIndex++$o.name view on Freebase
${aliases(commonProperties['/common/topic/alias'])}
${createNewTab("As " + typeRecord.typeEntry.name)}
${createNewTab(property.name)}
${createNewTab("More...")}
${createNewTabBody(typeRecord)}
${createNewTabBody...
Recent Discussions about view2
There is no discussion about this document.
Start the Discussion »