Semantic Twannotations

joshsh edited this page Sep 13, 2010 · 85 revisions

This page describes a preliminary mapping of Twitter Annotations into Semantic Web vocabularies, as well as vocabulary conventions for interlinking Annotations with the Semantic Web. TwitLogic will use these mappings to translate Annotations into streaming RDF descriptions once they go live in Twitter’s Streaming API.


In the past year or so, there has been mounting interest in mashing up “real-time” social data with the Semantic Web. Encouragingly, mainstream social networking services such as Facebook and Twitter have begun to provide rich structured data which is well-suited for that purpose. Twitter, for example, has just released its Places feature, which allows a tweet to be associated with a unique location, complete with a url, a name, a country code, and other machine-friendly information. In the near future, Twitter Annotations will give application developers the means to attach general-purpose structured information to a tweet: information about music, movies, upcoming events, product offerings, and so on… many of the same types of things which are described in existing Linked Data datasets, using existing Semantic Web vocabularies. In order to bridge the gap between Annotations and the Semantic Web, it will be useful to:

  1. map Twitter Annotations types and attributes into corresponding Semantic Web vocabularies
  2. link resources described in Twitter Annotations to resources described in the Web of Linked Data

The first item is particularly straightforward. For the few Annotations “types” which Twitter has already described, some possible mappings have been sketched out below. These types are just a starting point, however:

“We aim to borrow heavily from, and use when possible, existing standards like RDFa, Microformats, Open Graph Protocol, AB Meta and Annotations will be a community-driven effort […]”

As Annotations are still in the formative stages, this is a good opportunity to introduce vocabulary elements which interlink Annotations resources with the Semantic Web. In analogy to RDFa, an “about” or “sameas” attribute — which identifies the subject of the Annotation with a Semantic Web resource named by a URI — has a lot of potential. For example:

'movie': {
    'text': 'Avatar'

In this Annotation, ‘url’ provides a navigational link for the end user of the information, while ‘sameas’ provides a point of entry for applications into the Semantic Web, enabling functionality such as smart filters: query for a stream of tweets about “films by Canadian directors”, “places in developing countries”, “books which at least one of my friends likes”, etc. The ability to execute a SPARQL query over an Annotation stream, together with high-quality Linked Data, permits an endless variety of filter patterns which would otherwise require case-by-case application logic and manual integration of data sources.

Apart from adding value to applications, rdfized Annotations also have the potential to fill out the long tail of the Semantic Web: while many Annotations will serve only to identify a topic, many others (such as Annotations about events and reviews) will contribute new information, about very diverse resources, from very diverse sources.

See also:

  1. SemTech 2010 presentation, Real-time Semantic Web with Twitter Annotations, ReadWriteWeb article How Twitter Annotations Could Bring the Real-Time and Semantic Web Together
  2. SMOB Semantic MicroBlogging framework
  3. C-SPARQL: SPARQL for Continuous Querying
  4. sparqlPuSH transport layer for RDF streams
  5. Twarql: Twitter Feeds through SPARQL



As foaf:Document:

title rdfs:label or dc:title
image foaf:img
url foaf:page note: the URL of a webpage is a different concept than the URL of a non-info resource like a place or a movie. Perhaps the “about”/“sameas” attribute is less ambiguous here.


As geonames:Feature:

title rdfs:label or dc:title
url foaf:page
id dc:identifier
provider dc:publisher (?)
place_type rdf:type may have any of the values “POI”, “neighborhood”, “city”. This limited set of place types can be mapped to corresponding DBpedia resources.
postal_code geonames:postalCode
country_code geonames:inCountry A simple lookup table can be used to map ISO 3166 country codes codes to GeoNames or DBpedia resources for countries. GeoNames also includes country resources which are named according to the corresponding country codes.
latitude geo:lat
longitude geo:long


As rev:Review:

content rev:text
rating rev:rating the ‘rating’ attribute has a range of 0.0 to 1.0. Use rev:rating in combination with rev:minRating and rev:maxRating
url foaf:page


As mo:Track:

title rdfs:label or dc:title
url foaf:page
author foaf:maker or dc:creator
year dc:date note: precision mismatch
genre mo:genre
album mo:track (inverse link)


As movie:film:

title rdfs:label or dc:title
url foaf:page
director movie:director
year dc:date note: precision mismatch


As po:Series:

title rdfs:label or dc:title
url foaf:page
network po:service


As books:Book (?):

isbn dc:identifier make the value into a URN, e.g. urn:ISBN:006251587X
author foaf:maker or dc:creator
year dc:date note: precision mismatch


As gr:ActualProductOrServiceInstance:

brand gr:hasManufacturer
model gr:hasMakeAndModel
price use gr:Offering?
category dc:type


As… ?

symbol nyse:symbol (?)
price use gr:Offering?


As gr:Offering:

end_date gr:validThrough
price gr:hasPriceSpecification etc.


As owl:Thing:

title rdfs:label or dc:title


As event:Event:

title rdfs:label or dc:title
url foaf:page
location event:place
start_date event:time use a single time:Interval for start and end date
end_date (see start_date)


  1. Existing Semantic Web ontologies can help to drive the introduction of new Twitter Annotations types and attributes
  2. What additional types would we like to see? E.g. people (—> FOAF), publications (—> SWRC), businesses, job listings (—> DOAC), projects (—> DOAP), questions and answers…
  3. Since Twitter will not support nested Annotations, it might be tempting to use URIs for “object” attribute values. For example, in the ‘movie’ type, the ‘director’ attribute is probably expected to supply the name of the director, e.g. “James Cameron”. However, if a URI were supplied instead, e.g., a great deal more information about the director could be discovered. Of course, if this link already exists and is discoverable through the “about”/“sameas” URI, then there’s no need.