- Home
- OSF
- conStruct
- structWSF
- Download
- Installation Guide
- Overview
- Global structWSF Statistics
- Architecture
- Datasets & Access
- Endpoints Access
- structXML
- Web Services Tutorial
- Individual WS Documentation
- WS: Auth Registrar: Access
- WS: Auth Registrar: WS
- WS: Auth: Lister
- WS: Auth: Validator
- WS: Ontology: Create
- WS: Dataset: Create
- WS: Dataset: Read
- WS: Dataset: Update
- WS: Dataset: Delete
- WS: CRUD: Create
- WS: CRUD: Read
- WS: CRUD: Update
- WS: CRUD: Delete
- WS: Search
- WS: Browse
- WS: Converter: irJSON
- WS: SPARQL
- WS: Converter: BibTeX
- WS: Converter: TSV
- Resources
- sComponent
- irON
- Developers
CRUD: Read Web Service
CRUD: Read Web Service API Documentation
The CRUD: Read Web service is used to get the description of a target instance record indexed in a dataset belonging to a WSF (Web Services Framework).
Developers communicate with the CRUD: Read Web service using the HTTP GET method. You may request one of the following mime types: (1) text/xml, (2) application/rdf+xml or (3) application/rdf+n3. The content returned by the Web service will be serialized using the mime type requested and the data returned will depend on the parameters selected.
Usage
This Web service is intended to be used by any user that wants to get the description of an instance record.
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:
- URI of the dataset where the instance record is indexed
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
- application/json
- application/iron+json
- application/rdf+xml
- application/rdf+n3
URI:
- http://[...]/ws/crud/read/ ?uri=param1&dataset=param2&include_linksback=param3&include_reification=param4 ®istered_ip=param5
URI dynamic parameters description:
Note: All parameters have to be URL-encoded
- param1. URI of the instance record
- param2. URI of the dataset where the instance record is indexed
- param3. One of:
- True — Means that the reference to the other instance records referring to the target instance record will be added in the resultset
- False (default) — No links-back will be added
- param4. Include possible reification statements for a record. One of:
- True
- False (default)
- param5. Target IP address registered in the WSF
Example of Returned XML Document
This is an example of the XML document returned by this Web service endpoint for a given dataset URI.
This example returns the description of a dataset registered to a WSF.
Query:
- http://[...]/ws/crud/read/?dataset=http://[...]/wsf/datasets/46/ &uri=http://bknetwork.org/drupal/bkn/datasets/227/resource/Bob
"Accept:" HTTP header field value:
- text/xml
Result:
-
<?xml version="1.0" encoding="utf-8"?>
-
<!DOCTYPE resultset PUBLIC "-//Structured Dynamics LLC//Crud Read DTD 0.1//EN" "http://[...]/ws/dtd/crud/crudRead.dtd">
-
<resultset>
-
<prefix entity="rdf" uri="http://www.w3.org/1999/02/ 22-rdf-syntax-ns#"/>
-
<subject type="http://xmlns.com/foaf/0.1/Person" uri= "http://bknetwork.org/drupal/bkn/datasets/227/resource/Bob">
-
<predicate type="http://xmlns.com/foaf/0.1/name">
-
<object type="rdfs:Literal">Bob</object>
-
</predicate>
-
<predicate type="http://xmlns.com/foaf/0.1/family_name">
-
<object type="rdfs:Literal">Gratton</object>
-
</predicate>
-
</subject>
-
</resultset>
Descriptions of the Types of XML Elements
The elements used to describe an instance record depend on the vocabularies (ontologies) used to describe the instance record in RDF when it was first indexed in the system. Usually more information can be found on the Web for each property and class by creating the full identifier of a property or a class by using the prefix(es) of the XML document.
Example of Returned RDF/XML Document
Here is an example of a RDF/XML document returned by this Web service endpoint for a given URI.
Query<:
- http://[...]/ws/crud/read/?dataset=http://[...]/wsf/datasets/46/ &uri=http://bknetwork.org/drupal/bkn/datasets/227/resource/Bob
"Accept:" HTTP header field value:
- application/rdf+xml
Result:
-
<?xml version="1.0"?>
-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns0="http://xmlns.com/foaf/0.1/">
-
<ns0:Person rdf:about="http://bknetwork.org/drupal/bkn/ datasets/227/resource/Bob">
-
<ns0:name>Bob</ns0:name>
-
<ns0:family_name>Gratton</ns0:family_name>
-
</ns0:Person>
-
</rdf:RDF>
Example of Returned RDF/N3 Document
Here is an example of a RDF/N3 document returned by this Web service endpoint for a given URI.
Query:
- http://[...]/ws/crud/read/?dataset=http://[...]/wsf/datasets/46/ &uri=http://bknetwork.org/drupal/bkn/datasets/227/resource/Bob
"Accept:" HTTP header field value:
- application/rdf+n3
Result:
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
<http://bknetwork.org/drupal/bkn/datasets/227/resource/Bob> a <http://xmlns.com/foaf/0.1/Person> ;
-
<http://xmlns.com/foaf/0.1/name> """Bob""" ;
-
<http://xmlns.com/foaf/0.1/family_name> """Gratton""" .
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).
- Code: 200
- Message: OK
- Code: 400
- Message: Bad Request
- Message description: This resource is not existing
- Message description: No URI specified for any resource
- Message description: No Web service URI available
- Message description: Target Web service XYZ not registered to this Web Services Framework
- Message description: No access defined for this requester IP XYZ, dataset (XYZ) and Web service (XYZ)
- Message description: The target Web service (XYZ) needs create access and the requested user (XYZ) doesn't have this access for that dataset (XYZ)
- Message description: The target Web service (XYZ) needs read access and the requested user (XYZ) doesn't have this access for that dataset (XYZ)
- Message description: The target Web service (XYZ) needs update access and the requested user (XYZ) doesn't have this access for that dataset (XYZ)
- Message description: The target Web service (XYZ) needs delete access and the requested user (XYZ) doesn't have this access for that dataset (XYZ)
- Code: 406
- Message: Not Acceptable
- Message description: Unacceptable mime type requested
- Code: 500
- Message: Internal Error
