-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContextBuilderInterface.php
56 lines (47 loc) · 1.79 KB
/
ContextBuilderInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace ApiPlatform\JsonLd;
use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException;
use ApiPlatform\Metadata\UrlGeneratorInterface;
/**
* JSON-LD context builder interface.
*
* @author Kévin Dunglas <[email protected]>
*/
interface ContextBuilderInterface
{
public const HYDRA_CONTEXT = 'http://www.w3.org/ns/hydra/context.jsonld';
public const HYDRA_NS = 'http://www.w3.org/ns/hydra/core#';
public const JSONLD_NS = 'http://www.w3.org/ns/json-ld#';
public const RDF_NS = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
public const RDFS_NS = 'http://www.w3.org/2000/01/rdf-schema#';
public const XML_NS = 'http://www.w3.org/2001/XMLSchema#';
public const OWL_NS = 'http://www.w3.org/2002/07/owl#';
public const SCHEMA_ORG_NS = 'https://schema.org/';
/**
* Gets the base context.
*/
public function getBaseContext(int $referenceType = UrlGeneratorInterface::ABS_PATH): array;
/**
* Builds the JSON-LD context for the entrypoint.
*/
public function getEntrypointContext(int $referenceType = UrlGeneratorInterface::ABS_PATH): array;
/**
* Builds the JSON-LD context for the given resource.
*
* @throws ResourceClassNotFoundException
*/
public function getResourceContext(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): array;
/**
* Gets the URI of the given resource context.
*/
public function getResourceContextUri(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
}