You are here

Concept Service

Service Call

http://api.semantichacker.com/TOKEN/concept[/ConfigurationID]?

Overview

The concept service call extracts the key concepts from the input text or URI. The results of the call are ordered by weight. A concept's weight indicates the importance of that concept in the topics contained in the input. Examples of concepts include 'nfl' and 'super_bowl' for the input URI http://www.nfl.com, and 'ubuntu' and 'linux' for the input URI http://www.distrowatch.org. Note that multiple word concepts contain an underscore between words.

The Concept Service API uses the Semantic Gist® gist_con_odp2010 default configuration and is the only supported configuration for Semantic Gist®. There is no need to specify a configuration ID to use the default configuration.

The Concept Service allows for an optional configuration ID to be provided at the end of the request path. While it is possible to specify an older configuration, this is ignored in the current release of the API. The Semantic Gist® technology, which is backwards compatible to the odp_2010_categorization schema, does not support alternate configurations. This backwards compatibility includes category lables and category IDs. View the Service Configurations page for more information.

Concept Service Call Parameters

In addition to the common request parameters, the concept call has the following optional parameters.

Name Value Required
(Yes/No)
Usage Notes
format 'xml','json', 'tagcloud', 'jsontagcloud', 'javascripttagcloud', or 'rdf' No In addition to JSON and XML, the concept service supports Tag Cloud Formats ('tagcloud', 'jsontagcloud', 'javascripttagcloud'), and RDF ('rdf') output formats. NOTE: the 'externalId' parameter is required when using the RDF output format.
linkBase http://www.somedomain.com/ No An optional parameter that is recognized if the format is 'tagcloud', 'jsontagcloud', or 'javascripttagcloud'. When specified, the href attribute for each returned <a> contained in the tag cloud will be set to <linkBase>/<conceptTag>.
linkTarget <windowName> No An optional parameter that is recognized if the format is 'tagcloud', 'jsontagcloud', or 'javascripttagcloud'. When specified, the target attribute for each returned <a> contained in the tag cloud will be set to the provided value.

XML Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.semantichacker.com/api">
        <about>
                <requestId>FD87FA61AD871A57D936D93F593E8B39</requestId>

                <docId>BA0D26C21A91581510DE71253E523B8C</docId>
                <systemType>concept</systemType>
                <configId>odp_2007_l1_1.7k</configId>
                <contentType>text/html</contentType>

                <contentDigest>EB1B392D69B6F86D93D0977119256999</contentDigest>
                <requestDate>2011-08-30T19:41:21+00:00</requestDate>
                <systemVersion>2.1</systemVersion>
                <sourceUri>http://www.distrowatch.org</sourceUri>

        </about>
        <conceptExtractor>
                <conceptExtractorResponse>
                        <concepts>
                                <concept weight="0.06403626" label="linux kernel"/>
                                <concept weight="0.029306998" label="kde"/>

                                <concept weight="0.01912819" label="desktop environment"/>
                                ...
                                ...
                                ...
                                <concept weight="0.0045177625" label="bootloader"/>
                        </concepts>
                </conceptExtractorResponse>
        </conceptExtractor>
</response>

JSON Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org&format=json

{
    "about":     {
        "requestId": "106EDF2A971A81DF5A40A2A50BFD8914",
        "docId": "BA0D26C21A91581510DE71253E523B8C",
        "systemType": "concept",
        "configId": "odp_2007_l1_1.7k",
        "contentType": "text/html",
        "contentDigest": "EB1B392D69B6F86D93D0977119256999",
        "requestDate": "2011-08-30T19:42:54+00:00",
        "systemVersion": "2.1",
        "sourceUri": "http://www.distrowatch.org"
    },
    "conceptExtractor": {"conceptExtractorResponse": {"concepts":     [
                {
            "weight": "0.06403626",
            "label": "linux kernel"
        },
                {
            "weight": "0.029306998",
            "label": "kde"
        },
                {
            "weight": "0.01912819",
            "label": "desktop environment"
        },
        ...
        ...
        ...
                {
            "weight": "0.0045177625",
            "label": "bootloader"
        }
    ]}}
}

TagCloud Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org&format=tagcloud

<ul class="tw-cloud">

    <li class="size6">
      <a rel="tag" href="http://delicious.com/tag/ubuntu" target="_blank" title="ubuntu (1.000)"><span>ubuntu <em>(1.000)</em></span></a>
    </li>  
    <li class="size5">

      <a rel="tag" href="http://delicious.com/tag/distrowatch" target="_blank" title="distrowatch (0.829)"><span>distrowatch <em>(0.829)</em></span></a>
    </li>  
    <li class="size4">
      <a rel="tag" href="http://delicious.com/tag/linux" target="_blank" title="linux (0.478)"><span>linux <em>(0.478)</em></span></a>

    </li>  
  </ul>

JSON TagCloud Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org&format=jsontagcloud

{ "cloudHtml" :
 "  <ul class=\"tw-cloud\">\n    <li class=\"size6\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/ubuntu\" target=\"_blank\" title=\"ubuntu (1.000)\"><span>ubuntu <em>(1.000)<\/em><\/span><\/a>\n    <\/li>  \n    <li class=\"size5\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/distrowatch\" target=\"_blank\" title=\"distrowatch (0.829)\"><span>distrowatch <em>(0.829)<\/em><\/span><\/a>\n    <\/li>  \n    <li class=\"size4\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/linux\" target=\"_blank\" title=\"linux (0.478)\"><span>linux <em>(0.478)<\/em><\/span><\/a>\n    <\/li>  \n  <\/ul>\n"
};

Javascript TagCloud Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org&format=javascripttagcloud

var tag = { "cloudHtml" :
 "  <ul class=\"tw-cloud\">\n    <li class=\"size6\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/ubuntu\" target=\"_blank\" title=\"ubuntu (1.000)\"><span>ubuntu <em>(1.000)<\/em><\/span><\/a>\n    <\/li>  \n    <li class=\"size5\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/distrowatch\" target=\"_blank\" title=\"distrowatch (0.829)\"><span>distrowatch <em>(0.829)<\/em><\/span><\/a>\n    <\/li>  \n    <li class=\"size4\">\n      <a rel=\"tag\" href=\"http://delicious.com/tag/linux\" target=\"_blank\" title=\"linux (0.478)\"><span>linux <em>(0.478)<\/em><\/span><\/a>\n    <\/li>  \n  <\/ul>\n"
};
document.write(tag.cloudHtml);

RDF TagCloud Response Example

http://api.semantichacker.com/TOKEN/concept?uri=http%3a%2f%2fwww.distrowatch.org&format=rdf&externalld=RQ001

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:twtype="http://s.sh-stage.semsig.com/1.0/type#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:tw="http://s.sh-stage.semsig.com/1.0/pred#" > 
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a">
    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#DocInfo"/>
    <tw:externalId>RQ001</tw:externalId>

    <tw:sourceUrl>http://www.distrowatch.org</tw:sourceUrl>
  </rdf:Description>
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a/meta">
    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#DocInfoMeta"/>
    <tw:docId rdf:resource="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a"/>

    <tw:configId>odp_2007_l1_1.7k</tw:configId>
    <tw:tagSpaceLanguage>en_US</tw:tagSpaceLanguage>
    <tw:tagSpace>http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept</tw:tagSpace>
    <tw:systemVersion>2.1</tw:systemVersion>

    <tw:contentType>text/html</tw:contentType>
    <tw:requestDate>2011-08-31T17:56:10+00:00</tw:requestDate>
    <tw:contentDigest>EB1B392D69B6F86D93D0977119256999</tw:contentDigest>
  </rdf:Description>

  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/36b670c3-e256-c795-f454-1109f8016d9b">
    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#ConceptTag"/>
    <tw:label>linux kernel</tw:label>
  </rdf:Description>
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a/Instance/1">

    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#Instance"/>
    <tw:docId rdf:resource="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a"/>
    <tw:subject rdf:resource="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/36b670c3-e256-c795-f454-1109f8016d9b"/>
    <tw:weight>0.06403626</tw:weight>
  </rdf:Description>

  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/186cf28b-76f2-264e-9fea-8fcf91cb4f5d">
    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#ConceptTag"/>
    <tw:label>kde</tw:label>
  </rdf:Description>
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a/Instance/2">

    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#Instance"/>
    <tw:docId rdf:resource="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a"/>
    <tw:subject rdf:resource="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/186cf28b-76f2-264e-9fea-8fcf91cb4f5d"/>
    <tw:weight>0.029306998</tw:weight>
  </rdf:Description>

  ...
  ...
  ...
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/5617427d-ce0c-2300-3ed7-558a8e6bbb62">
    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#ConceptTag"/>
    <tw:label>bootloader</tw:label>
  </rdf:Description>
  <rdf:Description rdf:about="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a/Instance/5">

    <rdf:type rdf:resource="http://s.sh-stage.semsig.com/1.0/type#Instance"/>
    <tw:docId rdf:resource="http://d.sh-stage.semsig.com/1.0/dochash/b2831940-286a-c45e-eb32-8da60f491a0a"/>
    <tw:subject rdf:resource="http://d.sh-stage.semsig.com/1.0/element/odp_2007_l1_1.7k/en_US/concept/5617427d-ce0c-2300-3ed7-558a8e6bbb62"/>
    <tw:weight>0.0045177625</tw:weight>
  </rdf:Description>

</rdf:RDF>