API

Please use the http://purl.org/net/djburke/demo/astromoat/ URI to access this service.

http://purl.org/net/djburke/demo/astromoat/tag/<tag>

Returns the information for the tag tag, using a case-insensitive match. Tag names should be in ASCII format in this version of the server. The return format is determined by content negotiation. To get a specific format append one of the following to the URI: .html, .rdf, .n3, .ttl, or .json.

Changed (February 24 2009): Note that the use of <tag>/<format> to access a specific format for the data is no longer supported. Use <tag>.<format> instead. This is a departure from the standard MOAT behavior.

Changed (February 24 2009): Support for the "JSON light" format has been removed.

http://purl.org/net/djburke/demo/astromoat/taglist

Returns a list of all defined tags in this server. The return format is determined by content negotiation. To get a specific format append one of the following to the URI: .html, .rdf, .n3. or .ttl.

Note that the two JSON formats are not supported with this URI.

Changed (February 24 2009): Note that the use of taglist/<format> to access a specific format for the data is no longer supported. Use taglist.<format> instead.

Changed (February 24 2009): The HTML format of this page no longer shows all the information.

An example using curl

Changed (February 24 2009): The output below is not correct in detail, since the information has been moved to a different host, and there may be more hops back to the PURL server to resolve URIs. The essence is the same. The output has also not been updated to reflect the change from "<tag>/<format>" to "<tag>.<format>".

If a tag exists, then it is defined at the URI /tag/<tag>. The contents of this resource can be accessed a web browser or command-line tool like curl. In the example below we use curl to find out what meanings have been associated with the tag "moon".

First we access the URI directly, and use the -I flag of curl to show the response (only the relevant lines are shown in the curl output):

% curl -I http://purl.org/net/djburke/demo/astromoat/tag/moon
HTTP/1.1 302 Found
Location: http://hea-www.harvard.edu/~dburke/vo/astromoat/tag/moon
Content-Type: text/html; charset=iso-8859-1

Since I am using the PURL service to provide a stable URI for this server, we get a "302 redirect" to the current location of the page. We can use the -L flag to get curl to automatically follow the redirect:

% curl -L -I http://purl.org/net/djburke/demo/astromoat/tag/moon
HTTP/1.1 302 Found
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/html

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: text/html

Unfortunately this ends up in an apparently endless set of 302 and 303 redirects to get you to the correct resource (see also the "best practices" discussion on how this should be handled).

So, to get the Turtle version of this information we could say either

% curl -L http://purl.org/net/djburke/demo/astromoat/tag/moon/ttl

or

% curl -L -H 'Accept: application/x-turtle' http://purl.org/net/djburke/demo/astromoat/tag/moon

to get

# Turtle

@prefix : <http://moat-project.org/ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://purl.org/net/djburke/demo/astromoat/tag/moon> a :Tag ;
  :name "moon" ;
  :hasMeaning
     [ a :Meaning ;
        :meaningURI <http://www.ivoa.net/Documents/PR/Semantics/Vocabularies-20080729/rdf/IVOAT#Moon> ;
        foaf:maker <http://purl.org/net/who/djburke> ] ,
     [ a :Meaning ;
        :meaningURI <http://www.ivoa.net/Documents/PR/Semantics/Vocabularies-20080729/rdf/AAkeys#Moon> ;
        foaf:maker <http://purl.org/net/who/djburke> ] ,
     [ a :Meaning ;
        :meaningURI <http://archive.astro.umd.edu/ont/astronomy.owl#Moon> ;
        foaf:maker <http://purl.org/net/who/djburke> ] .

Content Negotiation

Changed (February 24 2009): The output below is not correct in detail, since the information has been moved to a different host. The essence is the same but you may no longer see 303 re-directs, which needs to be fixed. The output has also not been updated to reflect the change from "<tag>/<format>" to "<tag>.<format>".

What does this mean? Well, it means that the server has used content negotiation to send us to the actual URI (following the recommendations given in the Best Practice Recipes for Publishing RDF Vocabularies document) of http://purl.org/net/djburke/demo/astromoat/tag/moon.html. Since we use PURLs then there is an added complication in the 302 redirects that the PURL service adds.

If we remove the -I flag we get to the actual contents:

% curl -L http://purl.org/net/djburke/demo/astromoat/tag/moon
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>Astronomical definitions of the tag 'moon'</title>
...

If we want a machine-readable version of the contents then we can supply the desired MIME media type via the Accept header. The supported media types are:

text/html

This is the default MIME type.

% curl -L -I -H 'Accept: text/html' http://purl.org/net/djburke/demo/astromoat/tag/moon 
HTTP/1.1 302 Found
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/html

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: text/html
application/rdf+xml

This returns RDF data in XML format.

% curl -L -I -H 'Accept: application/rdf+xml' http://purl.org/net/djburke/demo/astromoat/tag/moon
HTTP/1.1 302 Found
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/rdf

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: application/rdf+xml
text/rdf+n3
application/rdf+n3
application/n3

These return RDF data in Notation 3 (N3) format. The application/* forms are included for completeness but the text/rdf+n3 media type should be used. This is an extension to the MIME types supported by standard MOAT servers.

% curl -L -I -H 'Accept: text/rdf+n3' http://purl.org/net/djburke/demo/astromoat/tag/moon
HTTP/1.1 302 Found
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/n3

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: text/rdf+n3
application/x-turtle
application/turtle

These return RDF data in Turtle format. This is an extension to the MIME types supported by standard MOAT servers.

% curl -L -I -H 'Accept: application/x-turtle' http://purl.org/net/djburke/demo/astromoat/tag/moon
HTTP/1.1 302 Found
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/ttl

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: application/x-turtle
application/json

This returns the data in JSON format, taken from the MOAT server pages. Note that this gives the "full" JSON output, i.e. it includes the foaf:maker predicates. There is no way to get to the JSON "light" version using content negotiation.

% curl -L -I -H 'Accept: application/json' http://purl.org/net/djburke/demo/astromoat/tag/moon
Location: http://wanna.dyn-o-saur.com:8082/tag/moon
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 303 See Other
Connection: Keep-Alive
Content-Type: text/html
Location: http://wanna.dyn-o-saur.com:8082/tag/moon/json

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: application/json

Direct Access

As the re-directs above imply, data for a specific MIME media type can be accessed by appending ".<type>" to the tag URI. The supported values are:

Supported Media Types using direct access to a tag
Type Media Type Description Example URI
html text/html HTML format http://purl.org/net/djburke/demo/astromoat/tag/moon.html
rdf application/rdf+xml RDF/XML format http://purl.org/net/djburke/demo/astromoat/tag/moon.rdf
n3 text/rdf+n3 RDF/N3 format (an extension to the standard MOAT server) http://purl.org/net/djburke/demo/astromoat/tag/moon.n3
ttl application/x-turtle Turtle format (an extension to the standard MOAT server) http://purl.org/net/djburke/demo/astromoat/tag/moon.ttl
json application/json JSON format http://purl.org/net/djburke/demo/astromoat/tag/moon.json

All tags

As an extension to the MOAT server, I have provided access to all tags using via the /taglist.<type> URI. The supported MIME types are similar to those for individual tags:

Supported Media Types using direct access to the list of tags
Type Media Type Description Example URI
html text/html HTML format http://purl.org/net/djburke/demo/astromoat/taglist.html
rdf application/rdf+xml RDF/XML format http://purl.org/net/djburke/demo/astromoat/taglist.rdf
n3 text/rdf+n3 RDF/N3 format (an extension to the standard MOAT server) http://purl.org/net/djburke/demo/astromoat/taglist.n3
ttl application/x-turtle Turtle format (an extension to the standard MOAT server) http://purl.org/net/djburke/demo/astromoat/taglist.ttl

Valid HTML 4.01 Strict