QStore4S Rest API
Please also refer to the examples and schemas here.
- /add
-
This method lets you add new graphs to QStore4s.
It expects XML describing the graph to be stored and will return the stored graph with IDs in either XML or JSON (depending on the
accept
attribute in the request header). In the XML describing a graph to be added you can either nest appellation and relation events or have them on the same level and then refer to them by id (using the attributeinternal_refId
). For example, the relation event [subj A - pred B - obj C] could be described as (pseudo code and only partial):
Or the information about any of the appellation events (or a relation event if referred to in a relation) can be moved up to the first level of the XML structure and then linked from within the relation part.<relation_event> <relation> <subject> <appellation_event> <!-- info about subject appellation event here --> </appellation_event> </subject> <predicate> <appellation_event> <!-- info about predicate appellation event here --> </appellation_event> </predicate> <object> <appellation_event> <!-- info about object appellation event here --> </appellation_event> </object> </relation> </relation_event>
Similarly, you can link to appellation and relation events that are already stored. Instead of the tag<relation_event> <relation> <subject> <appellation_event> <internal_refId>APP_INT_ID_1</internal_refId> </appellation_event> </subject> <!-- predicate and object can be described here or referenced in the same manner --> </relation> <!-- more elements --> <appellation_event> <refId>APP_INT_ID_1</refId> <!-- info about object appellation event here --> </appellation_event> </relation_event>
internal_refId
, however, you would useexternal_refId
.<relation_event> <relation> <subject> <appellation_event> <external_refId>APP_ID_123</external_refId> </appellation_event> </subject> <!-- predicate and object elements --> </relation> </relation_event>
- Returns: XML or JSON
- Expects: XML input describing the graph to be stored
- Example: input-example.xml
- /get
-
Using this method you can retrieve information about a relation or appellation event.
- Returns: XML or JSON
- Expects request parameters:
id
: ID of the relation or appellation event to be retrieved.shallow
: This property applies when requesting relation events. It should be set totrue
if only the requested relation event with its direct first-level children should be returned. If it is set to anything else then true (or omitted from the request), QStore4S will return all subsequent nodes as well (e.g. if a relation event points to another relation event, this referenced relation event with all its children will be returned as well).
- Example: http://exmple.com/qstore4s/get?id=ID-ABC-XA&shallow=true
- /get
-
Using this method you can retrieve information about multiple relation and appellation events.
The method expects XML listing the IDs of all the requested appellation and relation events.
- Returns: XML or JSON
- Expects: XML listing the IDs of the requested relation and appellation events.
- Example: input-get-example.xml
<?xml version="1.0" encoding="UTF-8"?> <element_events xmlns="http://digitalhps.org/creationEvents-model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://digitalhps.org/creationEvents-model QStore4S-GET-schema"> <id>APP_EVN7047499249615914638</id> <id>REL_EVN-2604468172392217040</id> <id>APP_EVN-2778900838723337460</id> </element_events>
- /searchByAppellationId
-
This method returns all relation events that reference the appellation event with the given ID. For example, if the request contains the appellation event ID 123, the method returns all relation events that reference the appellation event with ID 123.
The method expects the XML of an appellation or relation event with the ID property filled.
- Returns: XML or JSON
- Expects: XML of an appellation or relation event with the ID filled in.
- Example:
<?xml version="1.0" encoding="UTF-8"?> <element_events xmlns="http://digitalhps.org/creationEvents-model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://digitalhps.org/creationEvents-model qstore4s-schema.xsd"> <relation_event> <id>REL_EVN-2604468172392217040</id> </relation_event> </element_events>
- /search
-
This method searches for events that match the given XML. The given XML could for example specify to search for all relations that have a subject appellation that points to the concept of the animal "dog".
- Returns: XML or JSON
- Expects: XML of a paritally filled graph. The method will find all graphs that match the given XML.
- Example: search-example_appellation_event.xml, search-example-relation_event.xml, search-example-nested-relationEvent.xml.