Category Call
Service Call:
http://api.semantichacker.com/TOKEN/category[/ConfigurationID]?
Overview
The category service call identifies the main topic categories for the input text or URI. The results of the call are ordered by weight. A category's weight indicates how relevant it is to the topics contained in the input. Examples include 'Sports/Football/American/NFL' and 'Sports/Football/American/Players' for the input URI 'http://www.nfl.com', and 'Computers/Software/Operating Systems/Linux' for the input URI 'http://www.kernel.org'.
The category service allows for an optional configuration ID to be provided at the end of the request path. View the Service Configurations page for more information.
Category Call Parameters
In addition to the common request parameters, the category call has the following optional parameters.
XML Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fwww.kernel.org&showLabels=true
<?xml version="1.0" encoding="UTF-8"?> <response xmlns="http://www.semantichacker.com/api"> <about> <requestId>87E7644CD41B002A5BE9F5E46730C93A</requestId> <docId>C0B1E02C7E06323EA312CC7288F865BE</docId> <systemType>category</systemType> <configId>odp_2007_l1_1.7k</configId> <contentType>text/html</contentType> <contentDigest>6ABDCDB166C100D8D27E0046134FD6CF</contentDigest> <requestDate>2008-10-13T14:06:18+0000</requestDate> <systemVersion>2.0</systemVersion> <sourceUri>http://www.kernel.org</sourceUri> </about> <categorizer> <categorizerResponse> <categories> <category id="11040" weight="1.21881" label="Top/Computers/Software/Operating Systems/Linux" /> </categories> </categorizerResponse> </categorizer> </response>
JSON Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fwww.kernel.org&showLabels=true&format=json
{
"about": {
"requestId": "87E7644CD41B002A5BE9F5E46730C93A",
"docId": "C0B1E02C7E06323EA312CC7288F865BE",
"systemType": "category",
"configId": "odp_2007_l1_1.7k",
"contentType": "text/html",
"contentDigest": "6ABDCDB166C100D8D27E0046134FD6CF",
"requestDate": "2008-10-13T14:06:18+0000",
"systemVersion": "2.0",
"sourceUri": "http://www.kernel.org</sourceUri"
},
"categorizer": {"categorizerResponse": {"categories": [
{
"id": "11040",
"weight": "1.21881",
"label": "Top/Computers/Software/Operating Systems/Linux"
},
]}}
}
TagCloud Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fen.wikipedia.org%2fwiki%2fElectric_guitar&format=tagcloud
<ul class="tw-cloud">
<li class="size6">
<a rel="tag" href="http://delicious.com/tag/Top/Arts/Music/Instruments/Stringed/Guitar/Electric" target="_blank" title="Top/Arts/Music/Instruments/Stringed/Guitar/Electric (1.000)"><span>Top/Arts/Music/Instruments/Stringed/Guitar/Electric <em>(1.000)</em></span></a>
</li>
<li class="size5">
<a rel="tag" href="http://delicious.com/tag/Top/Shopping/Music/Instruments/Stringed/Guitar" target="_blank" title="Top/Shopping/Music/Instruments/Stringed/Guitar (0.697)"><span>Top/Shopping/Music/Instruments/Stringed/Guitar <em>(0.697)</em></span></a>
</li>
</ul>
JSON TagCloud Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fen.wikipedia.org%2fwiki%2fElectric_guitar&format=jsontagcloud
{ "cloudHtml" :
" <ul class=\"tw-cloud\">\n <li class=\"size6\">\n <a rel=\"tag\" href=\"http://delicious.com/tag/Top/Arts/Music/Instruments/Stringed/Guitar/Electric\" target=\"_blank\" title=\"Top/Arts/Music/Instruments/Stringed/Guitar/Electric (1.000)\"><span>Top/Arts/Music/Instruments/Stringed/Guitar/Electric <em>(1.000)<\/em><\/span><\/a>\n <\/li> \n <li class=\"size5\">\n <a rel=\"tag\" href=\"http://delicious.com/tag/Top/Shopping/Music/Instruments/Stringed/Guitar\" target=\"_blank\" title=\"Top/Shopping/Music/Instruments/Stringed/Guitar (0.697)\"><span>Top/Shopping/Music/Instruments/Stringed/Guitar <em>(0.697)<\/em><\/span><\/a>\n <\/li> \n <\/ul>\n"
};
Javascript TagCloud Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fen.wikipedia.org%2fwiki%2fElectric_guitar&format=javascripttagcloud
var tag = { "cloudHtml" :
" <ul class=\"tw-cloud\">\n <li class=\"size6\">\n <a rel=\"tag\" href=\"http://delicious.com/tag/Top/Arts/Music/Instruments/Stringed/Guitar/Electric\" target=\"_blank\" title=\"Top/Arts/Music/Instruments/Stringed/Guitar/Electric (1.000)\"><span>Top/Arts/Music/Instruments/Stringed/Guitar/Electric <em>(1.000)<\/em><\/span><\/a>\n <\/li> \n <li class=\"size5\">\n <a rel=\"tag\" href=\"http://delicious.com/tag/Top/Shopping/Music/Instruments/Stringed/Guitar\" target=\"_blank\" title=\"Top/Shopping/Music/Instruments/Stringed/Guitar (0.697)\"><span>Top/Shopping/Music/Instruments/Stringed/Guitar <em>(0.697)<\/em><\/span><\/a>\n <\/li> \n <\/ul>\n"
};
document.write(tag.cloudHtml);
RDF Response Example
http://api.semantichacker.com/TOKEN/category?uri=http%3a%2f%2fen.wikipedia.org%2fwiki%2fElectric_guitar&externalId=r001&format=rdf
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:twtype="http://s.textwise.com/1.0/type#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:tw="http://s.textwise.com/1.0/pred#" >
<rdf:Description rdf:about="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#DocInfo"/>
<tw:externalId>r001</tw:externalId>
<tw:sourceUrl>http://en.wikipedia.org/wiki/Electric_guitar</tw:sourceUrl>
</rdf:Description>
<rdf:Description rdf:about="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb/meta">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#DocInfoMeta"/>
<tw:docId rdf:resource="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb"/>
<tw:configId>odp_2007_l1_1.7k</tw:configId>
<tw:tagSpaceLanguage>en_US</tw:tagSpaceLanguage>
<tw:tagSpace>http://d.textwise.com/1.0/element/odp_2007_l1_1.7k/en_US/category</tw:tagSpace>
<tw:systemVersion>2.0</tw:systemVersion>
<tw:contentType>text/html</tw:contentType>
<tw:requestDate>2008-10-14T11:48:36+0000</tw:requestDate>
<tw:contentDigest>572C03FEBF4A1A8E51A4E43F2C640F20</tw:contentDigest>
</rdf:Description>
<rdf:Description rdf:about="http://d.textwise.com/1.0/element/odp_2007_l1_1.7k/en_US/category/1012">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#CategoryTag"/>
<tw:label>Top/Arts/Music/Instruments/Stringed/Guitar/Electric</tw:label>
</rdf:Description>
<rdf:Description rdf:about="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb/Instance/1">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#Instance"/>
<tw:docId rdf:resource="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb"/>
<tw:subject rdf:resource="http://d.textwise.com/1.0/element/odp_2007_l1_1.7k/en_US/category/1012"/>
<tw:weight>1.2347553</tw:weight>
</rdf:Description>
<rdf:Description rdf:about="http://d.textwise.com/1.0/element/odp_2007_l1_1.7k/en_US/category/4199">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#CategoryTag"/>
<tw:label>Top/Shopping/Music/Instruments/Stringed/Guitar</tw:label>
</rdf:Description>
<rdf:Description rdf:about="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb/Instance/2">
<rdf:type rdf:resource="http://s.textwise.com/1.0/type#Instance"/>
<tw:docId rdf:resource="http://d.textwise.com/1.0/dochash/eabafc40-aee3-9739-b797-1ec0b53a3fbb"/>
<tw:subject rdf:resource="http://d.textwise.com/1.0/element/odp_2007_l1_1.7k/en_US/category/4199"/>
<tw:weight>0.8604636</tw:weight>
</rdf:Description>
</rdf:RDF>