Revision: Read

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

The overall Revision services within OSF manage various versions of an instance record. The Revision: Read Web service provides all of the triples that are part of the specified revision to be returned.

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 read a specific revision of a record. This endpoint will return all the triples, including reification triples, of a specific revision record. This web service endpoint can be used to get all the triples, which includes the triples that defines the revision itself. But it can also be used to re-create the original state of the record when it got revisioned. This "original" state simple remove the revision specific triples and change the URI to its original one (and not the revision URI).

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/read/?revuri=&dataset=&mode=&interface=&version=

URI dynamic parameters description:

Note: All parameters have to be URL-encoded

  • revuri. URI of the revision to read
  • dataset. Dataset URI where to index the RDF document. Note: this is the Dataset URI, and not the Dataset Revisions URI
  • mode. Specify if you want to get the full revision record description, or simply the record (without the triples related to the revision). One of:
    • revision — return the full revision record, with all the information specific to the revision (status, revision time, performed, etc). The URI of the record that will be returned will be the same as the one used for the revuri parameter
    • record (default) — return the record of that revision, without all the meta information about the revision. The URI of the record that will be returned will be different the one specified in revuri. The URI that will be used is the one of the actual record, so the one specified by the wsf:revisionUri property if the mode revision is used
  • 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/read/?mode=revision&dataset=http://localhost/datasets/hin/documents/local/&uri=http://crud_update_test_2"

"Accept:" HTTP header field value:

  • text/xml

Result:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE resultset PUBLIC "-//Structured Dynamics LLC//Revision Read DTD 0.1//EN" "revision/read/revisionRead.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="nhccn" uri="http://purl.org/ontology/nhccn#" />
  11.   <subject type="nhccn:Test" uri="http://localhost/datasets/hin/documents/local/revisions/1369322285.4644">
  12.     <predicate type="rdf:type">
  13.       <object uri="http://purl.org/ontology/wsf#Revision" />
  14.     </predicate>
  15.     <predicate type="wsf:fromDataset">
  16.       <object uri="http://localhost/datasets/hin/documents/local/"  />
  17.     </predicate>
  18.     <predicate type="iron:prefLabel">
  19.       <object type="rdfs:Literal">crud update test - 2</object>
  20.       <reify type="wsf:ojectLabel" value="reification test" />
  21.     </predicate>
  22.     <predicate type="wsf:revisionTime">
  23.       <object type="rdfs:Literal">1369322285.4644</object>
  24.     </predicate>
  25.     <predicate type="wsf:performer">
  26.       <object type="rdfs:Literal">127.0.0.1</object>
  27.     </predicate>
  28.     <predicate type="wsf:revisionStatus">
  29.       <object uri="http://purl.org/ontology/wsf#published"  />
  30.     </predicate>
  31.     <predicate type="wsf:revisionUri">
  32.       <object uri="http://crud_update_test_2"  />
  33.     </predicate>
  34.   </subject>
  35. </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-READ-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-READ-201 Warning No Target Revision URI No target revision URI defined for this request.
WS-REVISION-READ-300 Fatal Requested source interface not existing The source interface you requested is not existing for this web service endpoint.
WS-REVISION-READ-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-READ-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-READ-303 Fatal Can't get the revision of the resource An error occured when we tried to get the revision of the resource
WS-REVISION-READ-304 Fatal Can't get the reification statements for that revision An error occured when we tried to get the reification statements of that revision
WS-REVISION-READ-305 Fatal Requested mode non-existing The mode requested for this query is not existing. Known modes are: 'revision' and 'record'
WS-REVISION-READ-306 Fatal Unexisting Revision Record The revision record you specified for this query is not existing for this dataset

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