- Previous: Zemanta JavaScript SDK
- Up: Zemanta Documentation
- Next:
Zemanta RDF response
Structure of Zemanta's RDF/XML response was inspired by Linking Open Data initiative, other APIs offering semantic responses and most importantly ideas campioned by W3C.
Structure
RDF format allows for many ways of expressing the same relationships. We chose relatively flat approach that is very easy to comprehend even for people that are not experts in semantic web. An example response can be found here.
Namespace:
Responses use only three vocabularies and consequentially namespaces: golden standard rdf namespace (http://www.w3.org/1999/02/22-rdf-syntax-ns# as rdf:), owl namespace (http://www.w3.org/2002/07/owl#) and Zemanta's own namespace (http://s.zemanta.com/ns# as z:). We leave it to the Semantic web stack to offer reconciliation of the terms between different vocabularies.
Base URI:
Each request in Zemanta's system gets unique identifier called RID. Using RID as part of the URI an unique URI is assigned to every response. This URIs is not dereferencable (for example http://d.zemanta.com/rid/54695302-1264-4103-9a2a-dfee88fdcab2). All top-level objects are then related to this document via "z:doc" relation. This means that you can load many responses from Zemanta API into a single semantic graph and there will be no clashes.
There are a few types of top-level objects:
- Document
- Related
- Image
- Keyword
- Object
- Category
Also very important object is Target which determines outside references and their basic properties (such as title, publishing date, etc)
Document:
There's only one Document-typed object in each response, it includes information about the request, input text and title, and rid and HTML signature. Properties are the following:
rdf:type is resource http://s.zemanta.com/ns#DocumentInfo
z:doc - connection to the entity representing the request
z:text - input text (copy from the input parameters)
z:title - input title (currently always empty)
z:rid - GUID, 36 characters
z:signature - signature that should be automatically included
Related:
Related object represents an relationship to certain document that Zemanta found to be related to the input text. It also offers basic description of that document, such as title, time of publishing, and the question if Zemanta was used when producing the related document.
rdf:type is resource http://s.zemanta.com/ns#Related
z:doc - connection to the entity representing the request
z:confidence - confidence of the relationship
z:target - a target object
Image:
Image object represents an relationship to certain image that Zemanta found to be related to the input text. It also offers basic description of that image, such as title, time of publishing.
rdf:type is resource http://s.zemanta.com/ns#Image
z:doc - connection to the entity representing the request
z:confidence - confidence of the relationship
z:url_s - url of the small image
z:url_m - url of the medium image
z:url_l - url of the large image
Category:
Category object represents an relationship to certain category that Zemanta found to be related to the input text. It also offers basic description of that category, such as title.
rdf:type is resource http://s.zemanta.com/ns#Category
z:doc - connection to the entity representing the request
z:confidence - confidence of the relationship
z:target - a target object
Keyword:
Keyowrd object represents an relationship to certain keyword that Zemanta found to be related to the input text. It also offers basic description of that keyword, such as name.
rdf:type is resource http://s.zemanta.com/ns#Category
z:doc - connection to the entity representing the request
z:confidence - confidence of the relationship
z:name - keyword name
z:scheme - keyword scheme - where it comes from
Recognition:
Recogntion object represents an relationship to certain entity that Zemanta found inside text.
rdf:type is resource http://s.zemanta.com/ns#Recognition
z:doc - connection to the entity representing the request
z:confidence - confidence of the relationship
z:object - an identified object
z:anchor - anchor in text (part of text) this recognition applies to
Object:
An external object
rdf:type is resource http://s.zemanta.com/ns#Object
owl:sameAs - link to objects in Linking Open Data cloud that are the same as this one
z:target - external resources (web pages) that have this object represented
Target:
Target is an external object that Zemanta links to. It can be an article, a web page or a category. It can have only few of the attributes below.
z:title - title of the object
z:published_datetime - date and time when the object was published
z:zemified - was the object created with the help of Zemanta's tools
z:targeType - type of target object (has it's own list of possible objects)
- Previous: Zemanta JavaScript SDK
- Up: Zemanta Documentation
- Next:

Comments
Please sign in to post a comment.