eurlex_sparql
Execute raw SPARQL queries against the EU Publications Office endpoint to retrieve legal documents when standard tools cannot express your search. Requires knowledge of the CDM ontology.
Instructions
Expert escape hatch: run a raw, read-only SPARQL 1.1 query directly against the EU Publications Office (Cellar) endpoint when the higher-level tools (eurlex_search, eurlex_metadata, eurlex_citations, eurlex_case_law, eurlex_transposition, eurlex_summary, …) cannot express what you need. Requires knowledge of the CDM ontology — READ THE eurlex_guide PROMPT FIRST for the property cheat sheet (celex, title, language, dates, citations, case law, transposition, summaries). Only SELECT and ASK are allowed; SPARQL Update (INSERT/DELETE/…) and federated SERVICE clauses are rejected before the query is sent. A SELECT with no top-level LIMIT gets LIMIT 50 appended (set limit_added); a top-level LIMIT above 100 is rejected. The response mirrors SPARQL JSON — vars + bindings for SELECT, boolean for ASK — plus row_count and a truncated flag (whole rows are dropped past ~40k characters). CELEX/ELI literals are typed xsd:string, so match them with FILTER(STR(?x) = "..."). Example: PREFIX cdm: http://publications.europa.eu/ontology/cdm# SELECT ?celex WHERE { ?w cdm:resource_legal_id_celex ?celex . FILTER(STR(?celex) = "32016R0679") } LIMIT 1
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | A raw SPARQL 1.1 query against the EU Publications Office (Cellar) endpoint. Read-only: only SELECT and ASK are accepted (SPARQL Update and federated SERVICE clauses are rejected). If a SELECT has no top-level LIMIT one is appended automatically; a top-level LIMIT above 100 is rejected. Uses the CDM ontology — see the eurlex_guide prompt for the property cheat sheet. Example: PREFIX cdm: <http://publications.europa.eu/ontology/cdm#> SELECT ?celex WHERE { ?w cdm:resource_legal_id_celex ?celex . FILTER(STR(?celex) = "32016R0679") } LIMIT 1 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vars | No | Projected variable names (SELECT only) | |
| boolean | No | ASK result (present only for ASK queries) | |
| bindings | No | Raw SPARQL binding rows, possibly truncated (SELECT only) | |
| row_count | Yes | Total rows the query returned; null for ASK | |
| truncated | Yes | True when whole rows were dropped to fit the char budget | |
| limit_added | No | Present (true) only when the tool auto-appended the default LIMIT | |
| returned_rows | Yes | Rows included after char-budget truncation; null for ASK |