A dedicated component based on web service (WS) is available for accessing the functionalities of the SWKM, exposed also as web services. It is the KMS-RequestEngine (KMS-RE) All information about this WS is given below:
The Request Engine is in charge of interpreting the client requests concerning an access to a KR. This module transforms the client request (if necessary) into the proper RQL/RUL request(s) and invokes the appropriate service in the SWKM, and then interprets the reply of this service in order to send back to the client a properly formatted response. The client tool is not RDF agnostic, it manipulates RDF through Java objects. More details in the dedicated chapter.
The basic principle is that the data is designed and handled where it are used, i.e. on the side of tools. The KMS-RequestEngine (KMS-RE) makes the assumption that it is the responsibility of particular tool to design, create, and maintain a portion of RDF schema properly, according to the needs of the required functionality. Thus, KP-Lab tools are RDF dependent. They will deal with RDF representations directly in RDF syntax (i.e. TRIG or RDF/XML text serialization format). However Java-based KP-Lab tools can alternatively overcome the RDF dependency by utilization of the Persistence API (see chapter 126.96.36.199). For the search of an artefact that corresponds to a set of criteria, the KP-Lab tools will send this request directly in an RQL format and the Request Engine transfers it to the proper service of the SWKM. This returns a RDF in specified format, which the client of the KMS can transform into objects of the application or system domain models.
The base data entity managed by KMS is item, which is defined as a set of triplets with the same subject - item identification URI.
|String executeQuery(String rql, String format)||Executes the RQL query in the RDF repository and return RDF data encoded in the specified format.|
|String executeUpdate(String rul)||Executes the RUL update in the RDF repository and return ResultReport in XML format.|
|String createItem(String rdf, String format)||Based on the RDF input in specified format, the method creates a new entity in the RDF repository. |
It is expected that all input triplets have the same subject. If the subject is rdf:nil, KMS Request Engine will call the IdGenerator to generate URI for a new item. This URI will be included in the returned ResultReport in XML format.
|String getItem (String uri, String format)||Based on the input URI, the method loads the RDF data in the specified format from the RDF repository.This will return all triplets with the specified subject URI.|
|String updateItem (String rdf, String format)||Updates in RDF repository all the properties specified |
in the input RDF in specified format and return
ResultReport in XML format.This method will replace all
triplets with properties referenced in the
input RDF data with the new triplets specified in the
input (for multivalued properties all values
have to be specified in the input; to delete all values, rdf.nil can
be specified as an object). Properties, which are not
referenced in the input triplets, are not affected.
It is expected that all input triplets
have the same subject.
|String deleteItem (String uri)||Removes all RDF triplets that refer to the given URI (either as an object or subject) and return ResultReport in XML format.|
|String exportModelData (String URIs, String format, boolean withDependencies)||Returns array of RDF (data and schema) in specified format representation that belongs to a specific name or graph space|
|String exportModel (String URIs, String format, boolean withDependencies)||Returns array of RDF in specified format representation that belongs to a specific name or graph space|
|void importModel (String URIs, String documents, String format, boolean withDependencies)||Store RDF in specified format representation that belongs to a specific name or graph space.|
Example for the update operation:
State in the repository before the update:
s p1 o1s p1 o2
s p2 "v1"^^xsd:string
s p2 "v2"^^xsd:string
s p3 o3s p4 "123"^^xsd:int
Input data specified for update:
s p1 o1s p1 o4
s p1 o5
s p2 rdf:nil
s p4 "321"^^xsd:int
State in the repository after the update:
s p1 o1
s p1 o4
s p1 o5
s p3 o3
s p4 "321"^^xsd:int