RDF support for orcid - FOAF profile

presents a simple FOAF profile for REST requests. Implemented by adding
org.orcid.api.common.writer.rdf.RDFMessageBodyWriter
and modified org.orcid.api.common.OrcidApiService<T>
to allow text/turtle and application/rdf-xml for viewBioDetailsRdf
by simply translating the XML JAXB bean into RDF. Thus existing
visibility checks etc. should work.

No write support from RDF is planned as it could get tricky if the RDF
contained additional statements that would have to be either thrown away
or stored somewhere per ORCID.

The implementations of OrcidApiService have been modified in both
orcid-pub-web and orcid-api-web -

TODO: Do we really need various methods like viewBioDetailsRdf and
viewBioDetailsJson, or just change them to have multiple @Produces ?

The remaining REST services have not yet been RDFized, doing this for
orcid-works requires some thoughts as to what existing vocabularies
and terms should be used - for instance BIBO ontology or simply
dcterms:bibliographicReferences etc.

Example of RDF document:

c:\Users\stain>curl -H "Accept: text/turtle" http://localhost:8080/orcid-pub-web/0000-0002-0222-5559
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov:    <http://www.w3.org/ns/prov#> .
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
@prefix pav:     <http://purl.org/pav/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://localhost:8080/orcid-web/0000-0002-0222-5559/orcid-profile>
      a       foaf:PersonalProfileDocument , foaf:OnlineAccount ;
      rdfs:label "0000-0002-0222-5559" ;
      pav:createdBy <http://localhost:8080/orcid-web/0000-0002-0222-5559> ;
      pav:createdOn "2013-05-24T16:14:43.885+01:00"^^xsd:dateTime ;
      pav:createdWith <http://orcid.org> ;
      pav:lastUpdateOn "2013-05-25T20:32:37.295+01:00"^^xsd:dateTime ;
      prov:generatedAtTime
              "2013-05-25T20:32:37.295+01:00"^^xsd:dateTime ;
      prov:wasAttributedTo
              <http://localhost:8080/orcid-web/0000-0002-0222-5559> ;
      foaf:accountName "0000-0002-0222-5559" ;
      foaf:accountServiceHomepage
              <http://orcid.org> ;
      foaf:maker <http://localhost:8080/orcid-web/0000-0002-0222-5559> ;
      foaf:primaryTopic <http://localhost:8080/orcid-web/0000-0002-0222-5559> .

<http://localhost:8080/orcid-web/0000-0002-0222-5559>
      a       foaf:Person , prov:Person ;
      rdfs:label "Johnnye Does" ;
      foaf:account <http://localhost:8080/orcid-web/0000-0002-0222-5559/orcid-profile> ;
      foaf:familyName "Doe" ;
      foaf:givenName "John" ;
      foaf:mbox <mailto:oldemail@example.com> , <mailto:otheremail@example.com> , <mailto:johndoe@example.com> ;
      foaf:name "Johnnye Does" ;
      foaf:page <http://homepage.example.com/> , <http://work.example.org/> ;
      foaf:plan """I am a very interesting person
with several lines
of biography""" ;
      foaf:publications <http://localhost:8080/orcid-pub-web/0000-0002-0222-5559/orcid-works> .

This corresponds to the XML:

c:\Users\stain>curl -H "Accept: application/xml" http://localhost:8080/orcid-pub-web/0000-0002-0222-5559
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orcid-message xmlns="http://www.orcid.org/ns/orcid">
    <message-version>1.0.14</message-version>
    <orcid-profile type="user">
        <orcid>0000-0002-0222-5559</orcid>
        <orcid-id>http://localhost:8080/orcid-web/0000-0002-0222-5559</orcid-id>
        <orcid-history>
            <creation-method>website</creation-method>
            <submission-date>2013-05-24T16:14:43.885+01:00</submission-date>
            <last-modified-date>2013-05-25T20:32:37.295+01:00</last-modified-date>
            <claimed>true</claimed>
        </orcid-history>
        <orcid-bio>
            <personal-details>
                <given-names>John</given-names>
                <family-name>Doe</family-name>
                <credit-name>Johnnye Does</credit-name>
                <other-names>
                    <other-name>Old Johnny</other-name>
                </other-names>
            </personal-details>
            <biography>I am a very interesting person&#xD;
with several lines&#xD;
of biography</biography>
            <researcher-urls>
                <researcher-url>
                    <url-name></url-name>
                    <url>http://homepage.example.com/</url>
                </researcher-url>
                <researcher-url>
                    <url-name>Other</url-name>
                    <url>http://work.example.org/</url>
                </researcher-url>
            </researcher-urls>
            <contact-details>
                <email primary="false" current="true" verified="false" source="0000-0002-0222-5559">otheremail@example.com</email>
                <email primary="false" current="true" verified="false" source="0000-0002-0222-5559">oldemail@example.com</email>
                <email primary="true" current="true" verified="false">johndoe@example.com</email>
            </contact-details>
            <keywords>
                <keyword>some keywords, entered, here</keyword>
            </keywords>
            <affiliations/>
        </orcid-bio>
    </orcid-profile>
</orcid-message>
orcid.org/0000-0001-9842-9718

RDF notes
=========

Vocabularies:

  * foaf:	http://xmlns.com/foaf/0.1/
  * pav:	http://purl.org/pav/
  * prov:	http://www.w3.org/ns/prov#

An ORCID (e.g. <http://orcid.org/0000-0001-9842-9718> ) is presented as a
[http://xmlns.com/foaf/spec/#term_Person](foaf:Person), with
foaf:givenName, foaf:familyName, foaf:mbox, etc.

The ORCID identifier represents the person (and not his record) and
can be used directly in Linked Data for attribution and provenance.

The ORCID record is identified as
<http://orcid.org/0000-0001-9842-9718/orcid-profile> - in the REST
interface both of these URIs return the same RDF (and XML), but the
distinction is that the second identifies the ORCID record at orcid.org.

Thus creation date of the record,
[purl.org/pav/html#http://purl.org/pav/createdOn](pav:createdOn), is when
the user registered on ORCID (the submission-date in XML), and if the
record was created on the website, then the person is also listed as the
pav:createdBy, foaf:maker and prov:wasAttributedTo.

If the ORCID has been claimed, then this will be a
foaf:PersonalProfileDocument - this is only the case if the user has
actually claimed (and presumably curated) the ORCID record, even if it
was imported through the API.

See https://github.com/stain/ORCID-Source/tree/rdf for individual
commits.

Squashed commit of the following:

commit 1c8c57634d7f4f9fb1c3fcec5c018a962c10cd41
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Tue May 28 13:48:04 2013 +0100

    RDF: dates for ORCID record modifications

commit 1a89cbb0946c12737f108f0d51638e918a6489e5
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Tue May 28 12:41:38 2013 +0100

    provenance of ORCID account

    (when was it last modified?)

commit ed2db405975df414abd9f2610ddd0b26ea7dd764
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Tue May 28 11:04:18 2013 +0100

    RDF: publication link to XML repr rather than HTML

commit 1a91ed53ad75c8a7b8d179b13153f91bee6619ac
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Tue May 28 11:02:06 2013 +0100

    RDF: Error representation (with relative URI). Publications.

commit 8744ea973f0351813f6545b1c6c336bf4bb7a107
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Sun May 26 11:37:34 2013 +0100

    load pav and prov ontologies for provenance

commit 06057ab9b0230d9fdff843ac83bc9090df251faf
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Sat May 25 20:35:13 2013 +0100

    Refactored methods per section of XML bean

commit 22c405d6b5603fdab7628413ffa6a973e7a0bebf
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 17:57:40 2013 +0100

    orcid as foaf account

commit 490760fa344d473cf90cf1eaa7036c267b6eb51d
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 17:02:58 2013 +0100

    Don't forget foaf:Person!

commit b6f91eb3629e7175a3643198c478a64a6f435e70
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 17:00:53 2013 +0100

    Load FOAF separately and add as import (avoids printing all of foaf!)

commit cbfd2fc305800f991255717b5d49682f4a8a1eb1
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:47:29 2013 +0100

    Tests for RDFMessageBodyWriter

commit db9db1a931bca2ddf0ab295f0de812ef55295fd1
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:47:11 2013 +0100

    FOAF ontology
    Downloaded from http://xmlns.com/foaf/0.1/ as application/rdf+xml

commit 4bab8c07b04629a8c16d3c06ae90f55792b19682
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:46:43 2013 +0100

    Media Type done correctly

commit 01bd12546ac52bbeedf7f83344deb0527c4db2ae
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:26:03 2013 +0100

    Removed orcid-api-rdf dependency

commit 226c9d6ab7d4ac5479d671f244fe49e715134185
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:24:49 2013 +0100

    Remove silly debug exception :)

commit d08fac9ab358707c9a843be6a1c0b94cae48be40
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 16:24:29 2013 +0100

    Moved RDFMessageBody to orcid-api-common

commit 6373e21f5b9cd5dd29b4a8e62b38a2cb6b46174c
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 14:02:34 2013 +0100

    RDF: Charset versions of text/turtle and text/n3 separate

commit 3c5223952cc88498c14ba4024fdffab1307dbe19
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 14:02:06 2013 +0100

    Load FOAF locally, and only once

commit f13be2f0b8f5c07ccbb17c1687111fb945ba6da5
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Fri May 24 10:37:40 2013 +0100

    Include basedir and relativePath

commit 228a7ac6a2cd91b46576c80a958c8ab3e74c80a8
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 22:15:57 2013 +0100

    Turtle support?

commit a6065516328e1d36990c0d81530500cbe9f12b3b
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 22:11:13 2013 +0100

    Moved RDF writer to orcid-api-rdf so it can be maintained more loosely

commit 558a1d7e5f28d2a3fa1a9c7fa4a0e43db672dbb6
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 21:49:35 2013 +0100

    get URL for orcID not orcIDID

commit 3fa8e0e8422ae2a5c3453011132d5232e0c1b7f3
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 21:46:47 2013 +0100

    nullchecks

commit 3691fa396aec024481d5a6390b36192954f0855d
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 21:30:42 2013 +0100

    Moved RDF transformation to RDFMessageBodyWriter

commit 720106262ff782193ccd6ca6ff5c05ae350dad85
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 20:21:51 2013 +0100

    Jena-based RDF wrapper

commit b5faeea48e8ca839f2eb368cad9d8de357365d9d
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 19:32:34 2013 +0100

    Clone of HTML Writer

commit 695b55d6f47367da6c6953c261866d6241b42106
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 19:32:20 2013 +0100

    Ignore RDF test for now, so build passest

commit 682ea05d96d912f5990455cc7205c148a7af7cc8
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Thu May 23 19:31:54 2013 +0100

    Temporarily Break HTML Writer - is it used? :)

commit aee172131dc89cf8cb2eb83492583539aa9f1827
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Wed May 22 11:26:51 2013 +0100

    RDF: Test for RDF/XML entity

commit cf1fc194e0f72ad2669b1a2c63432467b874ad6c
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Wed May 22 10:22:40 2013 +0100

    RDF: Remove unused methods in RDFTest

commit 115d4c39643efa82109634198ceb185131ed78b8
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Wed May 22 10:17:50 2013 +0100

    RDF: Skeleton viewBioDetailsRdf and viewBioDetailsTurtle

commit 63673c86704a57f273bbee3c306e9fffb54fcee3
Author: Stian Soiland-Reyes <stian@soiland-reyes.com>
Date:   Wed May 22 10:03:00 2013 +0100

    Clone T1OrcidApiServiceImplMetricsTest to test RDF