Base URL
All semantic web endpoints are available at:What is the Semantic API?
The Semantic Web API provides advanced querying capabilities using RDF graphs and OWL ontologies. It allows you to:- Query shipment data using natural language
- Execute SPARQL queries directly on the knowledge graph
- Synchronize shipment data into the semantic graph
Available Endpoints
Natural Language Search
- GET /api/v1/grafo/buscar - Search using natural language queries
SPARQL Queries
- POST /api/v1/grafo/sparql - Execute custom SPARQL queries
Data Synchronization
- POST /api/v1/grafo/sincronizar-envio - Synchronize shipment data to the semantic graph
Architecture
The semantic service uses:- Apache Jena - RDF triple store and SPARQL engine
- OWL Ontology - Semantic model for shipments, clients, and branches
- Natural Language Processing - Converts user queries to SPARQL
Example Use Cases
Natural Language Search
Find shipments using conversational queries:- “envíos entregados hoy”
- “paquetes en tránsito a Arequipa”
- “envíos de María García”
- “paquetes mayores a 5 kg”
SPARQL Queries
Execute precise semantic queries:Data Synchronization
Sync shipments to the semantic graph for enhanced querying:Benefits of Semantic Search
Traditional SQL Queries
Natural Language Alternative
- Understands synonyms (“en tránsito”, “en camino”, “transportando”)
- Handles variations in phrasing
- Infers relationships between entities
- Provides context-aware results
Response Format
All semantic endpoints return results as arrays of key-value maps:The semantic API complements traditional REST endpoints. Use it when you need flexible querying, natural language search, or complex relationship-based queries.