ldkit 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +113 -3
- package/esm/library/decoder.js +2 -1
- package/esm/library/encoder.js +2 -1
- package/esm/library/namespaces/dbo.js +3650 -0
- package/esm/library/namespaces/dc.js +22 -0
- package/esm/library/namespaces/foaf.js +70 -0
- package/esm/library/namespaces/gr.js +176 -0
- package/esm/library/namespaces/mod.js +7 -2
- package/esm/library/namespaces/sioc.js +106 -0
- package/esm/library/rdf.js +87 -9
- package/esm/library/resource/query_builder.js +2 -1
- package/esm/library/schema/data_types.js +2 -1
- package/esm/library/schema/utils.js +1 -1
- package/package.json +1 -2
- package/script/library/decoder.js +11 -7
- package/script/library/encoder.js +8 -4
- package/script/library/namespaces/dbo.js +3652 -0
- package/script/library/namespaces/dc.js +24 -0
- package/script/library/namespaces/foaf.js +72 -0
- package/script/library/namespaces/gr.js +178 -0
- package/script/library/namespaces/mod.js +15 -5
- package/script/library/namespaces/sioc.js +108 -0
- package/script/library/rdf.js +89 -10
- package/script/library/resource/query_builder.js +8 -4
- package/script/library/schema/data_types.js +39 -35
- package/script/library/schema/utils.js +6 -3
- package/types/library/namespaces/dbo.d.ts +3649 -0
- package/types/library/namespaces/dc.d.ts +21 -0
- package/types/library/namespaces/dcterms.d.ts +17 -17
- package/types/library/namespaces/foaf.d.ts +69 -0
- package/types/library/namespaces/gr.d.ts +175 -0
- package/types/library/namespaces/mod.d.ts +7 -2
- package/types/library/namespaces/rdf.d.ts +1 -1
- package/types/library/namespaces/rdfs.d.ts +4 -4
- package/types/library/namespaces/schema.d.ts +261 -261
- package/types/library/namespaces/sioc.d.ts +105 -0
- package/types/library/namespaces/skos.d.ts +3 -3
- package/types/library/namespaces/xsd.d.ts +3 -3
- package/types/library/rdf.d.ts +30 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const namespace_js_1 = require("./namespace.js");
|
|
4
|
+
exports.default = (0, namespace_js_1.createNamespace)({
|
|
5
|
+
iri: "http://purl.org/dc/elements/1.1/",
|
|
6
|
+
prefix: "dc:",
|
|
7
|
+
terms: [
|
|
8
|
+
"contributor",
|
|
9
|
+
"coverage",
|
|
10
|
+
"creator",
|
|
11
|
+
"date",
|
|
12
|
+
"description",
|
|
13
|
+
"format",
|
|
14
|
+
"identifier",
|
|
15
|
+
"language",
|
|
16
|
+
"publisher",
|
|
17
|
+
"relation",
|
|
18
|
+
"rights",
|
|
19
|
+
"source",
|
|
20
|
+
"subject",
|
|
21
|
+
"title",
|
|
22
|
+
"type",
|
|
23
|
+
],
|
|
24
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const namespace_js_1 = require("./namespace.js");
|
|
4
|
+
exports.default = (0, namespace_js_1.createNamespace)({
|
|
5
|
+
iri: "http://xmlns.com/foaf/0.1/",
|
|
6
|
+
prefix: "foaf:",
|
|
7
|
+
terms: [
|
|
8
|
+
"Agent",
|
|
9
|
+
"Document",
|
|
10
|
+
"Group",
|
|
11
|
+
"Image",
|
|
12
|
+
"OnlineAccount",
|
|
13
|
+
"OnlineChatAccount",
|
|
14
|
+
"OnlineEcommerceAccount",
|
|
15
|
+
"OnlineGamingAccount",
|
|
16
|
+
"Organization",
|
|
17
|
+
"Person",
|
|
18
|
+
"PersonalProfileDocument",
|
|
19
|
+
"Project",
|
|
20
|
+
"accountName",
|
|
21
|
+
"accountServiceHomepage",
|
|
22
|
+
"aimChatID",
|
|
23
|
+
"based_near",
|
|
24
|
+
"currentProject",
|
|
25
|
+
"depiction",
|
|
26
|
+
"depicts",
|
|
27
|
+
"dnaChecksum",
|
|
28
|
+
"family_name",
|
|
29
|
+
"firstName",
|
|
30
|
+
"fundedBy",
|
|
31
|
+
"geekcode",
|
|
32
|
+
"gender",
|
|
33
|
+
"givenname",
|
|
34
|
+
"holdsAccount",
|
|
35
|
+
"homepage",
|
|
36
|
+
"icqChatID",
|
|
37
|
+
"img",
|
|
38
|
+
"interest",
|
|
39
|
+
"jabberID",
|
|
40
|
+
"knows",
|
|
41
|
+
"logo",
|
|
42
|
+
"made",
|
|
43
|
+
"maker",
|
|
44
|
+
"mbox",
|
|
45
|
+
"mbox_sha1sum",
|
|
46
|
+
"member",
|
|
47
|
+
"membershipClass",
|
|
48
|
+
"msnChatID",
|
|
49
|
+
"myersBriggs",
|
|
50
|
+
"name",
|
|
51
|
+
"nick",
|
|
52
|
+
"page",
|
|
53
|
+
"pastProject",
|
|
54
|
+
"phone",
|
|
55
|
+
"plan",
|
|
56
|
+
"primaryTopic",
|
|
57
|
+
"publications",
|
|
58
|
+
"schoolHomepage",
|
|
59
|
+
"sha1",
|
|
60
|
+
"surname",
|
|
61
|
+
"theme",
|
|
62
|
+
"thumbnail",
|
|
63
|
+
"tipjar",
|
|
64
|
+
"title",
|
|
65
|
+
"topic",
|
|
66
|
+
"topic_interest",
|
|
67
|
+
"weblog",
|
|
68
|
+
"workInfoHomepage",
|
|
69
|
+
"workplaceHomepage",
|
|
70
|
+
"yahooChatID",
|
|
71
|
+
],
|
|
72
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const namespace_js_1 = require("./namespace.js");
|
|
4
|
+
exports.default = (0, namespace_js_1.createNamespace)({
|
|
5
|
+
iri: "http://purl.org/goodrelations/v1#",
|
|
6
|
+
prefix: "gr:",
|
|
7
|
+
terms: [
|
|
8
|
+
"ActualProductOrServiceInstance",
|
|
9
|
+
"AmericanExpress",
|
|
10
|
+
"Brand",
|
|
11
|
+
"Business",
|
|
12
|
+
"BusinessEntity",
|
|
13
|
+
"BusinessEntityType",
|
|
14
|
+
"BusinessFunction",
|
|
15
|
+
"Buy",
|
|
16
|
+
"ByBankTransferInAdvance",
|
|
17
|
+
"ByInvoice",
|
|
18
|
+
"COD",
|
|
19
|
+
"Cash",
|
|
20
|
+
"CheckInAdvance",
|
|
21
|
+
"ConstructionInstallation",
|
|
22
|
+
"DHL",
|
|
23
|
+
"DayOfWeek",
|
|
24
|
+
"DeliveryChargeSpecification",
|
|
25
|
+
"DeliveryMethod",
|
|
26
|
+
"DeliveryModeDirectDownload",
|
|
27
|
+
"DeliveryModeFreight",
|
|
28
|
+
"DeliveryModeMail",
|
|
29
|
+
"DeliveryModeOwnFleet",
|
|
30
|
+
"DeliveryModeParcelService",
|
|
31
|
+
"DeliveryModePickUp",
|
|
32
|
+
"DinersClub",
|
|
33
|
+
"DirectDebit",
|
|
34
|
+
"Discover",
|
|
35
|
+
"Dispose",
|
|
36
|
+
"Enduser",
|
|
37
|
+
"FederalExpress",
|
|
38
|
+
"Friday",
|
|
39
|
+
"GoogleCheckout",
|
|
40
|
+
"Individual",
|
|
41
|
+
"JCB",
|
|
42
|
+
"LeaseOut",
|
|
43
|
+
"License",
|
|
44
|
+
"Location",
|
|
45
|
+
"LocationOfSalesOrServiceProvisioning",
|
|
46
|
+
"Maintain",
|
|
47
|
+
"MasterCard",
|
|
48
|
+
"Monday",
|
|
49
|
+
"Offering",
|
|
50
|
+
"OpeningHoursSpecification",
|
|
51
|
+
"PayPal",
|
|
52
|
+
"PaySwarm",
|
|
53
|
+
"PaymentChargeSpecification",
|
|
54
|
+
"PaymentMethod",
|
|
55
|
+
"PaymentMethodCreditCard",
|
|
56
|
+
"PriceSpecification",
|
|
57
|
+
"ProductOrService",
|
|
58
|
+
"ProductOrServiceModel",
|
|
59
|
+
"ProductOrServicesSomeInstancesPlaceholder",
|
|
60
|
+
"ProvideService",
|
|
61
|
+
"PublicHolidays",
|
|
62
|
+
"PublicInstitution",
|
|
63
|
+
"QualitativeValue",
|
|
64
|
+
"QuantitativeValue",
|
|
65
|
+
"QuantitativeValueFloat",
|
|
66
|
+
"QuantitativeValueInteger",
|
|
67
|
+
"Repair",
|
|
68
|
+
"Reseller",
|
|
69
|
+
"Saturday",
|
|
70
|
+
"Sell",
|
|
71
|
+
"SomeItems",
|
|
72
|
+
"Sunday",
|
|
73
|
+
"Thursday",
|
|
74
|
+
"Tuesday",
|
|
75
|
+
"TypeAndQuantityNode",
|
|
76
|
+
"UPS",
|
|
77
|
+
"UnitPriceSpecification",
|
|
78
|
+
"VISA",
|
|
79
|
+
"WarrantyPromise",
|
|
80
|
+
"WarrantyScope",
|
|
81
|
+
"Wednesday",
|
|
82
|
+
"acceptedPaymentMethods",
|
|
83
|
+
"addOn",
|
|
84
|
+
"advanceBookingRequirement",
|
|
85
|
+
"amountOfThisGood",
|
|
86
|
+
"appliesToDeliveryMethod",
|
|
87
|
+
"appliesToPaymentMethod",
|
|
88
|
+
"availabilityEnds",
|
|
89
|
+
"availabilityStarts",
|
|
90
|
+
"availableAtOrFrom",
|
|
91
|
+
"availableDeliveryMethods",
|
|
92
|
+
"billingIncrement",
|
|
93
|
+
"category",
|
|
94
|
+
"closes",
|
|
95
|
+
"color",
|
|
96
|
+
"condition",
|
|
97
|
+
"datatypeProductOrServiceProperty",
|
|
98
|
+
"deliveryLeadTime",
|
|
99
|
+
"depth",
|
|
100
|
+
"description",
|
|
101
|
+
"displayPosition",
|
|
102
|
+
"durationOfWarrantyInMonths",
|
|
103
|
+
"eligibleCustomerTypes",
|
|
104
|
+
"eligibleDuration",
|
|
105
|
+
"eligibleRegions",
|
|
106
|
+
"eligibleTransactionVolume",
|
|
107
|
+
"equal",
|
|
108
|
+
"greater",
|
|
109
|
+
"greaterOrEqual",
|
|
110
|
+
"hasBrand",
|
|
111
|
+
"hasBusinessFunction",
|
|
112
|
+
"hasCurrency",
|
|
113
|
+
"hasCurrencyValue",
|
|
114
|
+
"hasDUNS",
|
|
115
|
+
"hasEligibleQuantity",
|
|
116
|
+
"hasGlobalLocationNumber",
|
|
117
|
+
"hasISICv4",
|
|
118
|
+
"hasInventoryLevel",
|
|
119
|
+
"hasMPN",
|
|
120
|
+
"hasMakeAndModel",
|
|
121
|
+
"hasManufacturer",
|
|
122
|
+
"hasMaxCurrencyValue",
|
|
123
|
+
"hasMaxValue",
|
|
124
|
+
"hasMaxValueFloat",
|
|
125
|
+
"hasMaxValueInteger",
|
|
126
|
+
"hasMinCurrencyValue",
|
|
127
|
+
"hasMinValue",
|
|
128
|
+
"hasMinValueFloat",
|
|
129
|
+
"hasMinValueInteger",
|
|
130
|
+
"hasNAICS",
|
|
131
|
+
"hasNext",
|
|
132
|
+
"hasOpeningHoursDayOfWeek",
|
|
133
|
+
"hasOpeningHoursSpecification",
|
|
134
|
+
"hasPOS",
|
|
135
|
+
"hasPrevious",
|
|
136
|
+
"hasPriceSpecification",
|
|
137
|
+
"hasStockKeepingUnit",
|
|
138
|
+
"hasUnitOfMeasurement",
|
|
139
|
+
"hasValue",
|
|
140
|
+
"hasValueFloat",
|
|
141
|
+
"hasValueInteger",
|
|
142
|
+
"hasWarrantyPromise",
|
|
143
|
+
"hasWarrantyScope",
|
|
144
|
+
"height",
|
|
145
|
+
"includes",
|
|
146
|
+
"includesObject",
|
|
147
|
+
"isAccessoryOrSparePartFor",
|
|
148
|
+
"isConsumableFor",
|
|
149
|
+
"isListPrice",
|
|
150
|
+
"isSimilarTo",
|
|
151
|
+
"isVariantOf",
|
|
152
|
+
"legalName",
|
|
153
|
+
"lesser",
|
|
154
|
+
"lesserOrEqual",
|
|
155
|
+
"name",
|
|
156
|
+
"nonEqual",
|
|
157
|
+
"offers",
|
|
158
|
+
"opens",
|
|
159
|
+
"owns",
|
|
160
|
+
"predecessorOf",
|
|
161
|
+
"priceType",
|
|
162
|
+
"qualitativeProductOrServiceProperty",
|
|
163
|
+
"quantitativeProductOrServiceProperty",
|
|
164
|
+
"relatedWebService",
|
|
165
|
+
"seeks",
|
|
166
|
+
"serialNumber",
|
|
167
|
+
"successorOf",
|
|
168
|
+
"taxID",
|
|
169
|
+
"typeOfGood",
|
|
170
|
+
"validFrom",
|
|
171
|
+
"validThrough",
|
|
172
|
+
"valueAddedTaxIncluded",
|
|
173
|
+
"valueReference",
|
|
174
|
+
"vatID",
|
|
175
|
+
"weight",
|
|
176
|
+
"width",
|
|
177
|
+
],
|
|
178
|
+
});
|
|
@@ -3,17 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createNamespace = exports.xsd = exports.skos = exports.schema = exports.ldkit = exports.dcterms = exports.
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "
|
|
6
|
+
exports.createNamespace = exports.xsd = exports.skos = exports.sioc = exports.schema = exports.rdfs = exports.rdf = exports.ldkit = exports.gr = exports.foaf = exports.dcterms = exports.dc = exports.dbo = void 0;
|
|
7
|
+
var dbo_js_1 = require("./dbo.js");
|
|
8
|
+
Object.defineProperty(exports, "dbo", { enumerable: true, get: function () { return __importDefault(dbo_js_1).default; } });
|
|
9
|
+
var dc_js_1 = require("./dc.js");
|
|
10
|
+
Object.defineProperty(exports, "dc", { enumerable: true, get: function () { return __importDefault(dc_js_1).default; } });
|
|
11
11
|
var dcterms_js_1 = require("./dcterms.js");
|
|
12
12
|
Object.defineProperty(exports, "dcterms", { enumerable: true, get: function () { return __importDefault(dcterms_js_1).default; } });
|
|
13
|
+
var foaf_js_1 = require("./foaf.js");
|
|
14
|
+
Object.defineProperty(exports, "foaf", { enumerable: true, get: function () { return __importDefault(foaf_js_1).default; } });
|
|
15
|
+
var gr_js_1 = require("./gr.js");
|
|
16
|
+
Object.defineProperty(exports, "gr", { enumerable: true, get: function () { return __importDefault(gr_js_1).default; } });
|
|
13
17
|
var ldkit_js_1 = require("./ldkit.js");
|
|
14
18
|
Object.defineProperty(exports, "ldkit", { enumerable: true, get: function () { return __importDefault(ldkit_js_1).default; } });
|
|
19
|
+
var rdf_js_1 = require("./rdf.js");
|
|
20
|
+
Object.defineProperty(exports, "rdf", { enumerable: true, get: function () { return __importDefault(rdf_js_1).default; } });
|
|
21
|
+
var rdfs_js_1 = require("./rdfs.js");
|
|
22
|
+
Object.defineProperty(exports, "rdfs", { enumerable: true, get: function () { return __importDefault(rdfs_js_1).default; } });
|
|
15
23
|
var schema_js_1 = require("./schema.js");
|
|
16
24
|
Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return __importDefault(schema_js_1).default; } });
|
|
25
|
+
var sioc_js_1 = require("./sioc.js");
|
|
26
|
+
Object.defineProperty(exports, "sioc", { enumerable: true, get: function () { return __importDefault(sioc_js_1).default; } });
|
|
17
27
|
var skos_js_1 = require("./skos.js");
|
|
18
28
|
Object.defineProperty(exports, "skos", { enumerable: true, get: function () { return __importDefault(skos_js_1).default; } });
|
|
19
29
|
var xsd_js_1 = require("./xsd.js");
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const namespace_js_1 = require("./namespace.js");
|
|
4
|
+
exports.default = (0, namespace_js_1.createNamespace)({
|
|
5
|
+
iri: "http://rdfs.org/sioc/ns#",
|
|
6
|
+
prefix: "sioc:",
|
|
7
|
+
terms: [
|
|
8
|
+
"Community",
|
|
9
|
+
"Container",
|
|
10
|
+
"Forum",
|
|
11
|
+
"Item",
|
|
12
|
+
"Post",
|
|
13
|
+
"Role",
|
|
14
|
+
"Site",
|
|
15
|
+
"Space",
|
|
16
|
+
"Thread",
|
|
17
|
+
"User",
|
|
18
|
+
"UserAccount",
|
|
19
|
+
"Usergroup",
|
|
20
|
+
"about",
|
|
21
|
+
"account_of",
|
|
22
|
+
"addressed_to",
|
|
23
|
+
"administrator_of",
|
|
24
|
+
"attachment",
|
|
25
|
+
"avatar",
|
|
26
|
+
"container_of",
|
|
27
|
+
"content",
|
|
28
|
+
"content_encoded",
|
|
29
|
+
"created_at",
|
|
30
|
+
"creator_of",
|
|
31
|
+
"delivered_at",
|
|
32
|
+
"description",
|
|
33
|
+
"discussion_of",
|
|
34
|
+
"earlier_version",
|
|
35
|
+
"email",
|
|
36
|
+
"email_sha1",
|
|
37
|
+
"embeds_knowledge",
|
|
38
|
+
"feed",
|
|
39
|
+
"first_name",
|
|
40
|
+
"follows",
|
|
41
|
+
"function_of",
|
|
42
|
+
"generator",
|
|
43
|
+
"group_of",
|
|
44
|
+
"has_administrator",
|
|
45
|
+
"has_container",
|
|
46
|
+
"has_creator",
|
|
47
|
+
"has_discussion",
|
|
48
|
+
"has_function",
|
|
49
|
+
"has_group",
|
|
50
|
+
"has_host",
|
|
51
|
+
"has_member",
|
|
52
|
+
"has_moderator",
|
|
53
|
+
"has_modifier",
|
|
54
|
+
"has_owner",
|
|
55
|
+
"has_parent",
|
|
56
|
+
"has_part",
|
|
57
|
+
"has_reply",
|
|
58
|
+
"has_scope",
|
|
59
|
+
"has_space",
|
|
60
|
+
"has_subscriber",
|
|
61
|
+
"has_usergroup",
|
|
62
|
+
"host_of",
|
|
63
|
+
"id",
|
|
64
|
+
"ip_address",
|
|
65
|
+
"last_activity_date",
|
|
66
|
+
"last_item_date",
|
|
67
|
+
"last_name",
|
|
68
|
+
"last_reply_date",
|
|
69
|
+
"later_version",
|
|
70
|
+
"latest_version",
|
|
71
|
+
"likes",
|
|
72
|
+
"link",
|
|
73
|
+
"links_to",
|
|
74
|
+
"member_of",
|
|
75
|
+
"mentions",
|
|
76
|
+
"moderator_of",
|
|
77
|
+
"modified_at",
|
|
78
|
+
"modifier_of",
|
|
79
|
+
"name",
|
|
80
|
+
"next_by_date",
|
|
81
|
+
"next_version",
|
|
82
|
+
"note",
|
|
83
|
+
"num_authors",
|
|
84
|
+
"num_items",
|
|
85
|
+
"num_replies",
|
|
86
|
+
"num_threads",
|
|
87
|
+
"num_views",
|
|
88
|
+
"owner_of",
|
|
89
|
+
"parent_of",
|
|
90
|
+
"part_of",
|
|
91
|
+
"previous_by_date",
|
|
92
|
+
"previous_version",
|
|
93
|
+
"read_at",
|
|
94
|
+
"reference",
|
|
95
|
+
"related_to",
|
|
96
|
+
"reply_of",
|
|
97
|
+
"respond_to",
|
|
98
|
+
"scope_of",
|
|
99
|
+
"shared_by",
|
|
100
|
+
"sibling",
|
|
101
|
+
"space_of",
|
|
102
|
+
"subject",
|
|
103
|
+
"subscriber_of",
|
|
104
|
+
"title",
|
|
105
|
+
"topic",
|
|
106
|
+
"usergroup_of",
|
|
107
|
+
],
|
|
108
|
+
});
|
package/script/library/rdf.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuadFactory = exports.BindingsFactory = exports.TermFactory = exports.quadsToGraph = exports.DataFactory = exports.toRdf = exports.fromRdf = void 0;
|
|
3
|
+
exports.QuadFactory = exports.BindingsFactory = exports.ReadOnlyBindings = exports.TermFactory = exports.quadsToGraph = exports.DataFactory = exports.toRdf = exports.fromRdf = void 0;
|
|
4
4
|
var rdf_literal_1 = require("rdf-literal");
|
|
5
5
|
Object.defineProperty(exports, "fromRdf", { enumerable: true, get: function () { return rdf_literal_1.fromRdf; } });
|
|
6
6
|
Object.defineProperty(exports, "toRdf", { enumerable: true, get: function () { return rdf_literal_1.toRdf; } });
|
|
7
7
|
const rdf_data_factory_1 = require("rdf-data-factory");
|
|
8
8
|
Object.defineProperty(exports, "DataFactory", { enumerable: true, get: function () { return rdf_data_factory_1.DataFactory; } });
|
|
9
|
-
const bindings_factory_1 = require("@comunica/bindings-factory");
|
|
10
9
|
const quadsToGraph = (quads) => {
|
|
11
10
|
const graph = new Map();
|
|
12
11
|
for (const quad of quads) {
|
|
@@ -46,10 +45,90 @@ class TermFactory {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
exports.TermFactory = TermFactory;
|
|
49
|
-
class
|
|
50
|
-
constructor(dataFactory = new rdf_data_factory_1.DataFactory()
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
class ReadOnlyBindings {
|
|
49
|
+
constructor(bindings, dataFactory = new rdf_data_factory_1.DataFactory()) {
|
|
50
|
+
Object.defineProperty(this, "type", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: "bindings"
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(this, "dataFactory", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
value: void 0
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(this, "entries", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
value: void 0
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(this, "variables", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: true,
|
|
71
|
+
writable: true,
|
|
72
|
+
value: void 0
|
|
73
|
+
});
|
|
74
|
+
this.entries = bindings;
|
|
75
|
+
this.dataFactory = dataFactory;
|
|
76
|
+
this.variables = new Map();
|
|
77
|
+
for (const variable of bindings.keys()) {
|
|
78
|
+
this.variables.set(variable.value, variable);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
has(key) {
|
|
82
|
+
const stringKey = typeof key === "string" ? key : key.value;
|
|
83
|
+
const variableKey = this.variables.get(stringKey);
|
|
84
|
+
return this.entries.has(variableKey);
|
|
85
|
+
}
|
|
86
|
+
get(key) {
|
|
87
|
+
const stringKey = typeof key === "string" ? key : key.value;
|
|
88
|
+
const variableKey = this.variables.get(stringKey);
|
|
89
|
+
return this.entries.get(variableKey);
|
|
90
|
+
}
|
|
91
|
+
set(_key, _value) {
|
|
92
|
+
throw new Error("Method not implemented.");
|
|
93
|
+
}
|
|
94
|
+
delete(_key) {
|
|
95
|
+
throw new Error("Method not implemented.");
|
|
96
|
+
}
|
|
97
|
+
keys() {
|
|
98
|
+
return this.entries.keys();
|
|
99
|
+
}
|
|
100
|
+
values() {
|
|
101
|
+
return this.entries.values();
|
|
102
|
+
}
|
|
103
|
+
forEach(fn) {
|
|
104
|
+
return this.entries.forEach(fn);
|
|
105
|
+
}
|
|
106
|
+
get size() {
|
|
107
|
+
return this.entries.size;
|
|
108
|
+
}
|
|
109
|
+
[Symbol.iterator]() {
|
|
110
|
+
return this.entries.entries();
|
|
111
|
+
}
|
|
112
|
+
equals(_other) {
|
|
113
|
+
throw new Error("Method not implemented.");
|
|
114
|
+
}
|
|
115
|
+
filter(_fn) {
|
|
116
|
+
throw new Error("Method not implemented.");
|
|
117
|
+
}
|
|
118
|
+
map(_fn) {
|
|
119
|
+
throw new Error("Method not implemented.");
|
|
120
|
+
}
|
|
121
|
+
merge(_other) {
|
|
122
|
+
throw new Error("Method not implemented.");
|
|
123
|
+
}
|
|
124
|
+
mergeWith(_merger, _other) {
|
|
125
|
+
throw new Error("Method not implemented.");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.ReadOnlyBindings = ReadOnlyBindings;
|
|
129
|
+
class BindingsFactory {
|
|
130
|
+
constructor(dataFactory = new rdf_data_factory_1.DataFactory(), termFactory = new TermFactory(dataFactory)) {
|
|
131
|
+
Object.defineProperty(this, "dataFactory", {
|
|
53
132
|
enumerable: true,
|
|
54
133
|
configurable: true,
|
|
55
134
|
writable: true,
|
|
@@ -61,22 +140,22 @@ class BindingsFactory extends bindings_factory_1.BindingsFactory {
|
|
|
61
140
|
writable: true,
|
|
62
141
|
value: void 0
|
|
63
142
|
});
|
|
64
|
-
this.
|
|
143
|
+
this.dataFactory = dataFactory;
|
|
65
144
|
this.termFactory = termFactory;
|
|
66
145
|
}
|
|
67
146
|
fromJson(jsonBindings) {
|
|
68
147
|
const bindingsEntries = Object.entries(jsonBindings).map(([varName, jsonTerm]) => {
|
|
69
148
|
return [
|
|
70
|
-
this.
|
|
149
|
+
this.dataFactory.variable(varName),
|
|
71
150
|
this.termFactory.fromJson(jsonTerm),
|
|
72
151
|
];
|
|
73
152
|
});
|
|
74
|
-
return
|
|
153
|
+
return new ReadOnlyBindings(new Map(bindingsEntries), this.dataFactory);
|
|
75
154
|
}
|
|
76
155
|
}
|
|
77
156
|
exports.BindingsFactory = BindingsFactory;
|
|
78
157
|
class QuadFactory {
|
|
79
|
-
constructor(dataFactory = new rdf_data_factory_1.DataFactory(), termFactory = new TermFactory()) {
|
|
158
|
+
constructor(dataFactory = new rdf_data_factory_1.DataFactory(), termFactory = new TermFactory(dataFactory)) {
|
|
80
159
|
Object.defineProperty(this, "dataFactory", {
|
|
81
160
|
enumerable: true,
|
|
82
161
|
configurable: true,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.QueryBuilder = void 0;
|
|
4
7
|
const mod_js_1 = require("../schema/mod.js");
|
|
5
8
|
const sparql_js_1 = require("../sparql.js");
|
|
6
9
|
const rdf_js_1 = require("../rdf.js");
|
|
7
|
-
const
|
|
10
|
+
const ldkit_js_1 = __importDefault(require("../namespaces/ldkit.js"));
|
|
11
|
+
const rdf_js_2 = __importDefault(require("../namespaces/rdf.js"));
|
|
8
12
|
const encoder_js_1 = require("../encoder.js");
|
|
9
13
|
const query_helper_js_1 = require("./query_helper.js");
|
|
10
14
|
class QueryBuilder {
|
|
@@ -52,10 +56,10 @@ class QueryBuilder {
|
|
|
52
56
|
this.df = new rdf_js_1.DataFactory();
|
|
53
57
|
}
|
|
54
58
|
getResourceSignature() {
|
|
55
|
-
return this.df.quad(this.df.variable("iri"), this.df.namedNode(
|
|
59
|
+
return this.df.quad(this.df.variable("iri"), this.df.namedNode(rdf_js_2.default.type), this.df.namedNode(ldkit_js_1.default.Resource));
|
|
56
60
|
}
|
|
57
61
|
getTypesSignature() {
|
|
58
|
-
return this.df.quad(this.df.variable("iri"), this.df.namedNode(
|
|
62
|
+
return this.df.quad(this.df.variable("iri"), this.df.namedNode(rdf_js_2.default.type), this.df.variable("iri_type"));
|
|
59
63
|
}
|
|
60
64
|
entitiesToQuads(entities) {
|
|
61
65
|
const quadArrays = entities.map((entity) => (0, encoder_js_1.encode)(entity, this.schema, this.context));
|
|
@@ -69,7 +73,7 @@ class QueryBuilder {
|
|
|
69
73
|
const properties = (0, mod_js_1.getSchemaProperties)(s);
|
|
70
74
|
if (varPrefix !== "iri" || !omitRootTypes) {
|
|
71
75
|
rdfType.forEach((type) => {
|
|
72
|
-
conditions.push(this.df.quad(this.df.variable(varPrefix), this.df.namedNode(
|
|
76
|
+
conditions.push(this.df.quad(this.df.variable(varPrefix), this.df.namedNode(rdf_js_2.default.type), this.df.namedNode(type)));
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
79
|
Object.keys(properties).forEach((prop, index) => {
|
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
6
|
+
const xsd_js_1 = __importDefault(require("../namespaces/xsd.js"));
|
|
7
|
+
const rdf_js_1 = __importDefault(require("../namespaces/rdf.js"));
|
|
4
8
|
const SupportedDataTypesPrototype = {
|
|
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
|
-
[
|
|
9
|
+
[xsd_js_1.default.dateTime]: new Date(),
|
|
10
|
+
[xsd_js_1.default.date]: new Date(),
|
|
11
|
+
[xsd_js_1.default.gDay]: new Date(),
|
|
12
|
+
[xsd_js_1.default.gMonthDay]: new Date(),
|
|
13
|
+
[xsd_js_1.default.gYear]: new Date(),
|
|
14
|
+
[xsd_js_1.default.gYearMonth]: new Date(),
|
|
15
|
+
[xsd_js_1.default.boolean]: true,
|
|
16
|
+
[xsd_js_1.default.double]: 0.0,
|
|
17
|
+
[xsd_js_1.default.decimal]: 0.0,
|
|
18
|
+
[xsd_js_1.default.float]: 0.0,
|
|
19
|
+
[xsd_js_1.default.integer]: 0,
|
|
20
|
+
[xsd_js_1.default.long]: 0,
|
|
21
|
+
[xsd_js_1.default.int]: 0,
|
|
22
|
+
[xsd_js_1.default.byte]: 0,
|
|
23
|
+
[xsd_js_1.default.short]: 0,
|
|
24
|
+
[xsd_js_1.default.negativeInteger]: 0,
|
|
25
|
+
[xsd_js_1.default.nonNegativeInteger]: 0,
|
|
26
|
+
[xsd_js_1.default.nonPositiveInteger]: 0,
|
|
27
|
+
[xsd_js_1.default.positiveInteger]: 0,
|
|
28
|
+
[xsd_js_1.default.unsignedByte]: 0,
|
|
29
|
+
[xsd_js_1.default.unsignedInt]: 0,
|
|
30
|
+
[xsd_js_1.default.unsignedLong]: 0,
|
|
31
|
+
[xsd_js_1.default.unsignedShort]: 0,
|
|
32
|
+
[xsd_js_1.default.string]: "",
|
|
33
|
+
[xsd_js_1.default.normalizedString]: "",
|
|
34
|
+
[xsd_js_1.default.anyURI]: "",
|
|
35
|
+
[xsd_js_1.default.base64Binary]: "",
|
|
36
|
+
[xsd_js_1.default.language]: "",
|
|
37
|
+
[xsd_js_1.default.Name]: "",
|
|
38
|
+
[xsd_js_1.default.NCName]: "",
|
|
39
|
+
[xsd_js_1.default.NMTOKEN]: "",
|
|
40
|
+
[xsd_js_1.default.token]: "",
|
|
41
|
+
[xsd_js_1.default.hexBinary]: "",
|
|
42
|
+
[rdf_js_1.default.langString]: "",
|
|
39
43
|
};
|