Database Reference
In-Depth Information
or Facebook APIs? In this case, you need to write your own conversion script or
“wrapper,” which needs to take into account the individual API's query and retrieval
interface and its particular way of returning results, which could be in ATOM,
JSON, or XML formats, to name the most common. The wrapper needs to assign a
URI to the data resource provided by the API, such as a tweet or a photo; then when
an HTTP request for the URI is received, the wrapper rewrites the request into the
format that the underlying API requires. The API returns the data in some format,
such as XML or JSON, and the wrapper then transforms this into RDF/XML.
A few wrappers are already in existence, for example, ShreddedTweet 19 (although
this does not yet serve Linked Data, it does convert to RDF via RDFa); Flickr2rdf 20 ;
and the RDF Book Mashup, 21 and the process will become easier as more reusable
open source modules (such as the RDF API for PHP 22 ) are written. When the HTTP
request for a topic URI is received, the RDF Book Mashup script pulls out the ISBN
number from the URI and uses this to query the GoogleBase and Amazon APIs.
The APIs return XML, and this is serialized into RDF/XML. Similarly, Flick2rdf
queries the Flickr API and puts the resulting information on photo metadata and
tags into RDF triples. Perhaps one day the API owners will themselves provide RDF
conversion wrappers as a matter of course.
7.5.5 p UblIShInG S tatIc rDf/xMl if IleS
Publishing static RDF/XML files is most suitable when you wish to publish only a
small amount of data, which is unlikely to change much, as this method involves
the least effort on the part of the publisher. If the dataset is larger, it is better to
split it into several files to avoid delay when a browser is forced to load and parse a
large RDF file. The RDF/XML file is created once, either manually, such as when
an RDFS vocabulary is created, or when a software tool exports RDF/XML from
a triple store. The file can be published on the Web using a standard Web server,
configured to return the correct MIME type ( application/rdf+xml ), so that
Linked Data applications will recognize the data as RDF. Clearly, this method is
less useful for datasets that frequently change as the RDF/XML would need to be
re-created and republished every time.
7.5.6 p UblIShInG aS rDf a e MbeDDeD In htMl
Another way to publish data is to embed it as RDFa within an HTML Web page
(see Section 5.5.4 for details of RDFa). The advantage of this is that only one docu-
ment needs to be updated if the information changes and is particularly suited for
content that is already part of an existing content management system, where the
templates for creating the HTML can be extended to include RDFa. Some content
management systems, such as Drupal, 23 are now providing support for publishing
RDFa. The W3C's RDFa Distiller and Parser tool 24 can be used to convert RDFa
embedded in HTML into RDF serialized in Turtle or RDF/XML, if the data needs
to be processed independently of the HTML page.
This form of publishing would be suitable if Merea Maps wanted to, say, include
its address as RDF data on its organization's Web site or embed data about its
Search WWH ::




Custom Search