Aller au contenu

omnilex/eurlex Référence de l’API

Étage
Fournisseur · Omnilex
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Vérifié en réel
Licence
MIT
composer require omnilex/eurlex:1.x-dev

Lue dans les fichiers PHP du paquet au commit 1d2fac8fe4e9 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnilex\Eurlex

  • EurlexSource class

    EU law, from the Publications Office's open access to Cellar, the repository behind EUR-Lex - no key:

    9 methods · 2 constants

  • EurlexSourceFactory class

    EUR-Lex, from the Publications Office's open endpoint - no key.

    5 options

Omnilex\Eurlex

EurlexSource class

final class EurlexSource extends HttpSource implements SearchInterface, TextReaderInterface, ArticleReaderInterface, DecisionReaderInterface, CitationsInterface, RecentInterface EurlexSource.php:49

EU law, from the Publications Office's open access to Cellar, the repository behind EUR-Lex - no key:

  • its SPARQL endpoint (publications.europa.eu/webapi/rdf/sparql), for the metadata: titles, dates, whether an act is in force, its consolidated versions, the links between acts and judgments;
  • its resources by CELEX number, with content negotiation (publications.europa.eu/resource/celex/32016R0679, Accept: application/xhtml+xml, Accept-Language: fra), for the texts.

An act is read in the consolidated version that was the state of the law on the day asked for; before its first consolidation, as published in the Official Journal. Consolidated versions are documentary: only the Official Journal is authentic.

const SPARQL_URI = 'https://publications.europa.eu/webapi/rdf/sparql'
const RESOURCE_URI = 'https://publications.europa.eu/resource/'

EurlexSource::__construct()

public function __construct(HttpClientInterface $http, string $language = 'fr', readonly bool $content = true, string $sparqlUri = self::SPARQL_URI, readonly string $resourceUri = self::RESOURCE_URI, array $headers = [], float $throttle = 0.5)
$language

ISO 639-1: the language of the titles, labels and texts ("fr")

$content

whether text() and decision() also fetch the text itself (one more call, up to a few megabytes)

EurlexSource::getName()

public function getName(): string

EurlexSource::capabilities()

public function capabilities(): Capabilities

EurlexSource::text()

public function text(Identifier|string $id, ?\DateTimeInterface $at = null): ?Text

EurlexSource::article()

public function article(Identifier|string $id, ?string $number = null, ?\DateTimeInterface $at = null): ?Article

EurlexSource::decision()

public function decision(Identifier|string $id): ?Decision

EurlexSource::citations()

public function citations(Identifier|string $id, int $limit = 100): array
public function search(Query $query): Results

EurlexSource::recent()

public function recent(\DateTimeInterface $since, ?Query $query = null): Results

EurlexSourceFactory class

final class EurlexSourceFactory extends SourceFactory EurlexSourceFactory.php:20

EUR-Lex, from the Publications Office's open endpoint - no key.

options: language: fr # ISO 639-1: titles, labels and texts content: true # text() and decision() also fetch the text (one more call) throttle: 0.5 # seconds between two calls base_uri: 'https://publications.europa.eu/webapi/rdf/sparql' resource_uri: 'https://publications.europa.eu/resource/'

Options

OptionDefault
language'fr'
contenttrue
throttle0.5
base_uriEurlexSource::SPARQL_URI
resource_uriEurlexSource::RESOURCE_URI