Rule Store
Service Endpoints
The Rule Store provides a RESTful API that allows to persistently manage rules in Stanbol. Rules organized into containers called recipes, which identify set of rules that share the same business logic.
Recipe and rule management
How to create a recipe
- Service: /rules/recipe/
- Method: PUT
- Parameters:
- recipe (Path parameter): the ID of the recipe as a path parameter(MANDATORY)
- description: the textual description of the recipe (OPTIONAL)
Example:
curl -G -X PUT -d description="A test recipe." \ http://localhost:8080/rules/recipe/recipeTestA
How to add rules to a recipe
- Service: /rules/recipe/
- Method: POST
- Parameters:
- recipe (Path parameter): the ID of the recipe as a path parameter (MANDATORY)
- rules: the rules in Stanbol syntax (MANDATORY)
- description: the textual description of the rules (OPTIONAL)
Example:
curl -X POST -H "Content-type: multipart/form-data" \ -F rules=@myRules -F description="My rules in the recipe." \ http://localhost:8080/rules/recipe/recipeTestA
How to get a recipe or a recipe from the store
- Service: /rules/recipe/
- Method: GET
- Parameters:
- recipe (Path parameter): the ID of the recipe as a path parameter(MANDATORY)
- rule: the ID of the rule (OPTIONAL). If it is null than the whole recipe is returned. Otherwise it is returned the single rule identified by the parameter value
- Accepts:
- application/rdf+xml
- text/html
- text/plain
- application/owl+xml
- text/owl-functional
- text/owl-manchester
- application/rdf+json,
- text/turle
Example:
curl -G -X GET -H "Accept: text/turtle" \ -d rule=recipeTestA_rule1 \ http://localhost:8080/rules/recipe/recipeTestA
How to delete a recipe or a recipe from the store
- Service: /rules/recipe/
- Method: DELETE
- Parameters:
- recipe (Path parameter): the ID of the recipe as a path parameter(MANDATORY)
- rule: the ID of the rule (OPTIONAL). If it is null than the whole recipe is deleted. Otherwise it is deleted the single rule identified by the parameter value
Example:
curl -X DELETE \ -d rule=recipeTestA_rule1 \ http://localhost:8080/rules/recipe/recipeTestA
How to find a recipe in the store
- Service: /rules/find/recipes
- Method: GET
- Parameters:
- description: some word describing the recipe. This parameter is used as search field.
- Accepts:
- application/rdf+xml
- text/html
- text/plain
- application/owl+xml
- text/owl-functional
- text/owl-manchester
- application/rdf+json,
- text/turle
Example:
curl -G -X GET \ -d description="test recipe" \ http://localhost:8080/rules/find/recipes
How to find a rule in the store
- Service: /rules/find/rules
- Method: GET
- Parameters:
- description: some word describing the rule. This parameter is used as search field.
- Accepts:
- application/rdf+xml
- text/html
- text/plain
- application/owl+xml
- text/owl-functional
- text/owl-manchester
- application/rdf+json,
- text/turle
Example:
curl -G -X GET \ -d description="My rules" \ http://localhost:8080/rules/find/rules