-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathjson-ld-api.idl
163 lines (148 loc) · 4.68 KB
/
json-ld-api.idl
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: JSON-LD 1.1 Processing Algorithms and API (https://w3c.github.io/json-ld-api/)
/*
* The JsonLd interface is created to expose the JsonLdProcessor interface.
*/
[Global=JsonLd, Exposed=JsonLd]
interface JsonLd {};
[Exposed=JsonLd]
interface JsonLdProcessor {
constructor();
static Promise<JsonLdRecord> compact(
JsonLdInput input,
optional JsonLdContext context = null,
optional JsonLdOptions options = {});
static Promise<sequence<JsonLdRecord>> expand(
JsonLdInput input,
optional JsonLdOptions options = {});
static Promise<JsonLdRecord> flatten(
JsonLdInput input,
optional JsonLdContext context = null,
optional JsonLdOptions options = {});
static Promise<sequence<JsonLdRecord>> fromRdf(
RdfDataset input,
optional JsonLdOptions options = {});
static Promise<RdfDataset> toRdf(
JsonLdInput input,
optional JsonLdOptions options = {});
};
typedef record<USVString, any> JsonLdRecord;
typedef (JsonLdRecord or sequence<JsonLdRecord> or USVString or RemoteDocument) JsonLdInput;
typedef (JsonLdRecord or sequence<(JsonLdRecord or USVString)> or USVString) JsonLdContext;
[Exposed=JsonLd]
interface RdfDataset {
constructor();
readonly attribute RdfGraph defaultGraph;
undefined add(USVString graphName, RdfGraph graph);
iterable<USVString?, RdfGraph>;
};
[Exposed=JsonLd]
interface RdfGraph {
constructor();
undefined add(RdfTriple triple);
iterable<RdfTriple>;
};
[Exposed=JsonLd]
interface RdfTriple {
constructor();
readonly attribute USVString subject;
readonly attribute USVString predicate;
readonly attribute (USVString or RdfLiteral) _object;
};
[Exposed=JsonLd]
interface RdfLiteral {
constructor();
readonly attribute USVString value;
readonly attribute USVString datatype;
readonly attribute USVString? language;
};
dictionary JsonLdOptions {
USVString? base = null;
boolean compactArrays = true;
boolean compactToRelative = true;
LoadDocumentCallback? documentLoader = null;
(JsonLdRecord? or USVString) expandContext = null;
boolean extractAllScripts = false;
boolean frameExpansion = false;
boolean ordered = false;
USVString processingMode = "json-ld-1.1";
boolean produceGeneralizedRdf = true;
USVString? rdfDirection = null;
boolean useNativeTypes = false;
boolean useRdfType = false;
};
callback LoadDocumentCallback = Promise<RemoteDocument> (
USVString url,
optional LoadDocumentOptions? options
);
dictionary LoadDocumentOptions {
boolean extractAllScripts = false;
USVString profile = null;
(USVString or sequence<USVString>) requestProfile = null;
};
[Exposed=JsonLd]
interface RemoteDocument {
constructor();
readonly attribute USVString contentType;
readonly attribute USVString contextUrl;
attribute any document;
readonly attribute USVString documentUrl;
readonly attribute USVString profile;
};
dictionary JsonLdError {
JsonLdErrorCode code;
USVString? message = null;
};
enum JsonLdErrorCode {
"colliding keywords",
"conflicting indexes",
"context overflow",
"cyclic IRI mapping",
"invalid @id value",
"invalid @import value",
"invalid @included value",
"invalid @index value",
"invalid @nest value",
"invalid @prefix value",
"invalid @propagate value",
"invalid @protected value",
"invalid @reverse value",
"invalid @version value",
"invalid base direction",
"invalid base IRI",
"invalid container mapping",
"invalid context entry",
"invalid context nullification",
"invalid default language",
"invalid IRI mapping",
"invalid JSON literal",
"invalid keyword alias",
"invalid language map value",
"invalid language mapping",
"invalid language-tagged string",
"invalid language-tagged value",
"invalid local context",
"invalid remote context",
"invalid reverse property map",
"invalid reverse property value",
"invalid reverse property",
"invalid scoped context",
"invalid script element",
"invalid set or list object",
"invalid term definition",
"invalid type mapping",
"invalid type value",
"invalid typed value",
"invalid value object value",
"invalid value object",
"invalid vocab mapping",
"IRI confused with prefix",
"keyword redefinition",
"loading document failed",
"loading remote context failed",
"multiple context link headers",
"processing mode conflict",
"protected term redefinition"
};