Revision: Diff

From OSF Wiki
Jump to: navigation, search
Revision: Diff endpoint version:
2.1
3

The overall Revision services within OSF manage various versions of an instance record. The Revision: Diff Web service enables two revisions of the same record to be visually compared.

Version

This documentation page is used for the version 3 of this endpoint. Check at the top of this page to see the documentation pages for the other versions of this endpoint.

Usage

This Web service endpoint is used to compare two revisions of the same record. A ChangeSet which contains all the added and removed triples between the two revisions is returned.

Web Service Endpoint Information

This section describes all you permissions you need in the WSF (Web Service Framework) to send a query to this Web service endpoint, and it describes how to access it.

To access this Web service endpoint you need the proper CRUD (Create, Read, Update and Delete) permissions on a specific graph (dataset) of the WSF. Without the proper permissions on this graph you won't be able to send any queries to the endpoint.

Needed registered CRUD permission:
  • Create: False
  • Read: True
  • Update: False
  • Delete: False

As shown on the graph URI:

  • http://[...]/wsf/

Here is the information needed to communicate with this Web service's endpoint. Descriptions of the parameters are included below.

Note: if a parameter has a default value, the requester can omit it and the default value will be used. Also, some baseline Web services may not offer other values than the default.

HTTP method:

  • GET

Possible "Accept:" HTTP header field value:

  • text/xml (structXML)
  • application/json (structJSON)
  • application/rdf+xml (RDF+XML)
  • application/rdf+n3 (N3/Turtle)
  • application/iron+json (irJSON)
  • application/iron+csv (commON)

URI:

  • http://[...]/ws/revision/diff/?lrevuri=&rrevuri=&dataset=&interface=&version=

URI dynamic parameters description:

Note: All parameters have to be URL-encoded

  • lrevuri. First URI to compare
  • rrevuri. Second URI to compare
  • dataset. Dataset URI where to index the RDF document. Note: this is the Dataset URI, and not the Dataset Revisions URI
  • interface. Source interface used for this Web service query. The interface is a different way to process a query (different algorithms, different data management system, etc. The default interface is 'default'
  • version. Version of the source interface that is compatible with this query. If this parameter is omitted, then the latest version of the source interface is used for this query.

Available Sources Interfaces

A source interface is a way to process a web service query. Different sources interfaces can be implemented for the same OSF Web Service endpoint. Each interface will process the query differently, but all the queries to the web service endpoint will be the same, at the exception of the interface parameter. Each interface shares the same API (the one defined by the web service endpoint), but their processing may differ (like using different algorithms, using different data management systems, etc.)

This is a list of the core interfaces for this endpoint. Organizations that hosts a OSF Web Service network could create their own interface and make it available to the users. However such private source interface won't be part of this list, but should be publicized by the organization.


Source Interface Name Description
default Default source interface for this OSF Web Service endpoint. This interface implements the default behavior of this OSF Web Service endpoint.


Example of Returned XML Document

This is an example of the XML document returned by this Web service endpoint for a given URI. This example returns a list of datasets accessible by a given user IP.

Query:
  • http://[...]/ws/revision/diff/?rrevuri=http://localhost/datasets/global/documents/pbb/revisions/1369762554.2923&lrevuri=http://localhost/datasets/global/documents/pbb/revisions/1369762554.2522&dataset=http://localhost/datasets/global/documents/pbb/

"Accept:" HTTP header field value:

  • text/xml

Result:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE resultset PUBLIC "-//Structured Dynamics LLC//Revision Diff DTD 0.1//EN" "revision/diff/revisionDiff.dtd">
  3.   <resultset>
  4.   <prefix entity="owl" uri="http://www.w3.org/2002/07/owl#" />
  5.   <prefix entity="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
  6.   <prefix entity="rdfs" uri="http://www.w3.org/2000/01/rdf-schema#" />
  7.   <prefix entity="iron" uri="http://purl.org/ontology/iron#" />
  8.   <prefix entity="xsd" uri="http://www.w3.org/2001/XMLSchema#" />
  9.   <prefix entity="wsf" uri="http://purl.org/ontology/wsf#" />
  10.   <prefix entity="ns0" uri="http://purl.org/vocab/changeset/schema#" />
  11.   <subject type="rdf:Statement" uri="removal-30abc336f9dffd7dba49148fd3c965fd">
  12.     <predicate type="rdf:subject">
  13.       <object uri="http://localhost/datasets/global/documents/pbb/69921test4"  />
  14.     </predicate>
  15.     <predicate type="rdf:predicate">
  16.       <object uri="http://purl.org/ontology/iron#prefLabel"  />
  17.     </predicate>
  18.     <predicate type="rdf:object">
  19.       <object type="rdfs:Literal">Rubella and immunisation</object>
  20.     </predicate>
  21.   </subject>
  22.   <subject type="rdf:Statement" uri="addition-adf3ff4279f4994e8b1fc8fb8dceab62">
  23.     <predicate type="rdf:subject">
  24.       <object uri="http://localhost/datasets/global/documents/pbb/69921test4"  />
  25.     </predicate>
  26.     <predicate type="rdf:predicate">
  27.       <object uri="http://purl.org/ontology/iron#prefLabel"  />
  28.     </predicate>
  29.     <predicate type="rdf:object">
  30.       <object type="rdfs:Literal">Rubella and immunisation - TEST</object>
  31.     </predicate>
  32.   </subject>
  33.   <subject type="ns0:ChangeSet" uri="http://localhost/datasets/global/documents/pbb/69921test4/1369772584.6596/changeset">
  34.     <predicate type="ns0:subjectOfChange">
  35.       <object uri="http://localhost/datasets/global/documents/pbb/69921test4"  />
  36.     </predicate>
  37.     <predicate type="ns0:createDate">
  38.       <object type="rdfs:Literal">2013-05-28T20:23:04Z</object>
  39.     </predicate>
  40.     <predicate type="ns0:removal">
  41.       <object uri="removal-30abc336f9dffd7dba49148fd3c965fd"  />
  42.     </predicate>
  43.     <predicate type="ns0:addition">
  44.       <object uri="addition-adf3ff4279f4994e8b1fc8fb8dceab62"  />
  45.     </predicate>
  46.   </subject>
  47. </resultset>


HTTP Status Codes

Here are the possible HTTP status (error) codes returned by this Web service endpoint.

On error code and the specific error, a different message description can be issued (meaning a different error has been returned).


HTTP 200

Message Description
OK


HTTP 400

ID Level Name Description
WS-REVISION-DIFF-200 Warning No Target Dataset URI No target dataset URI defined for this request. A target dataset URI is needed for the mode 'ws' and 'dataset'
WS-REVISION-DIFF-201 Warning No First Target Revision URI No first target revision URI defined for this request.
WS-REVISION-DIFF-202 Warning No Second Target Revision URI No second target revision URI defined for this request.
WS-REVISION-DIFF-300 Fatal Requested source interface not existing The source interface you requested is not existing for this web service endpoint.
WS-REVISION-DIFF-301 Fatal Requested incompatible Source Interface version The version of the source interface you requested is not compatible with the version of the source interface currently hosted on the system. Please make sure that your tool get upgraded for using this current version of the endpoint.
WS-REVISION-DIFF-302 Fatal Source Interface's version not compatible with the web service endpoint's The version of the source interface you requested is not compatible with the one of the web service endpoint. Please contact the system administrator such that he updates the source interface to make it compatible with the new endpoint version.
WS-REVISION-DIFF-303 Fatal Error getting the description of the first revision (lrevuri) An error occured when we tried to get the description of the first revision (lrevuri)
WS-REVISION-DIFF-304 Fatal Error getting the description of the second revision (rrevuri) An error occured when we tried to get the description of the second revision (rrevuri)
WS-REVISION-DIFF-305 Fatal Revisions from different records The revisions you specified are two revisions of different records. You have to use two revisions of a same record to use this web service endpoint.

HTTP 403

ID Level Name Description
WS-AUTH-VALIDATION-100 Fatal Unauthorized Request Your request cannot be authorized for this web service call
WS-AUTH-VALIDATION-101 Fatal Unauthorized Request Your request cannot be authorized for this web service call
WS-AUTH-VALIDATION-102 Fatal Couldn't authorize request An internal error occured when we tried to authorize this request
WS-AUTH-VALIDATION-103 Fatal Unauthorized Request Your request cannot be authorized for this user: "---", on this dataset: "---", using this web service endpoint: "---"


HTTP 406

Message Description
Not Acceptable Unacceptable mime type requested


HTTP 500

Message Description
Internal Error