class documentation
class SemanticHandler(ABC):
Known subclasses: acme.plugins.services.SemanticManager.RdfLibHandler
Abstract base class for semantic graph store handlers.
| Method | add |
Add a semantic description to the graph store. |
| Method | add |
Add the parent ID to a resource's graph. |
| Method | query |
Run a SPARQL query against a graph. |
| Method | remove |
Remove a description from the graph store. |
| Method | reset |
Reset the handler, remove all graphs etc. |
| Method | update |
Update a description in the graph store. |
| Method | validate |
Validate a semantic description. |
@abstractmethod
def addDescription(self, description: str, format: SemanticFormat, id: str) -> Result:
¶
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerAdd a semantic description to the graph store.
| Parameters | |
description:str | A string with the semantic description. |
format:SemanticFormat | The format of the string in description. It must be a supported format. |
id:str | Identifier for the graph. It should be a resouce identifier. |
| Returns | |
Result | A Result object. The query result is returned in its data attribute. |
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerAdd the parent ID to a resource's graph.
| Parameters | |
id:str | Identifier for the graph. It should be a resouce identifier. |
pi:str | Parent ID to add. |
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerRun a SPARQL query against a graph.
| Parameters | |
query:str | SPARQL query. |
ids:Sequence[ | List of resource / graph identifiers used to build the graph for the query. |
format:str | Desired serialization format for the result. It must be supported. |
| Returns | |
Result | Result object. The serialized query result is stored in data. |
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerReset the handler, remove all graphs etc.
@abstractmethod
def updateDescription(self, description: str, format: SemanticFormat, id: str) -> Result:
¶
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerUpdate a description in the graph store.
| Parameters | |
description:str | A string with the semantic description. |
format:SemanticFormat | The format of the string in description. It must be a supported format. |
id:str | Identifier for the graph. It should be a resouce identifier. |
| Returns | |
Result | A Result object indicating success or error. |
@abstractmethod
def validateDescription(self, description: str, format: SemanticFormat) -> Result:
¶
overridden in
acme.plugins.services.SemanticManager.RdfLibHandlerValidate a semantic description.
| Parameters | |
description:str | A string with the semantic description. |
format:SemanticFormat | The format of the string in description. It must be supported. |
| Returns | |
Result | A Result object indicating a valid description, or with an error status. |