Hydra Ontology (Hydra)¶
Hydra is a lightweight vocabulary and ontology for creating hypermedia-driven REST APIs that are self-describing and machine-actionable through semantic web technologies. It enables developers to create generic API clients that can automatically discover and interact with APIs by interpreting hypermedia controls and semantic metadata embedded in API responses. Hydra defines core concepts commonly used in Web APIs such as operations, properties, classes, and relationships, providing a standardized way to describe API structure and functionality. The vocabulary enables APIs to be self-documenting and interoperable, allowing clients to dynamically adapt to API changes without hardcoded endpoint knowledge. Hydra supports linked data and semantic web principles, enabling APIs to contribute to the broader linked open data ecosystem.
Example Usage: Define a REST API endpoint for a resource collection using Hydra vocabularies to describe available operations (GET, POST, DELETE), supported classes, properties with their types, and hypermedia links to related resources, enabling automated client discovery and interaction.
Metrics & Statistics¶
Total Nodes |
154 |
Total Edges |
452 |
Root Nodes |
0 |
Leaf Nodes |
86 |
Classes |
2 |
Individuals |
14 |
Properties |
0 |
Maximum Depth |
0 |
Minimum Depth |
0 |
Average Depth |
0.00 |
Depth Variance |
0.00 |
Maximum Breadth |
0 |
Minimum Breadth |
0 |
Average Breadth |
0.00 |
Breadth Variance |
0.00 |
Term Types |
14 |
Taxonomic Relations |
15 |
Non-taxonomic Relations |
0 |
Average Terms per Type |
14.00 |
Usage Example¶
Use the following code to import this ontology programmatically:
from ontolearner.ontology import Hydra
ontology = Hydra()
ontology.load("path/to/Hydra-ontology.jsonld")
# Extract datasets
data = ontology.extract()
# Access specific relations
term_types = data.term_typings
taxonomic_relations = data.type_taxonomies
non_taxonomic_relations = data.type_non_taxonomic_relations