ldkit 0.6.1 → 0.6.3

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.
@@ -0,0 +1,22 @@
1
+ import { createNamespace } from "./namespace.js";
2
+ export default createNamespace({
3
+ iri: "http://purl.org/dc/elements/1.1/",
4
+ prefix: "dc:",
5
+ terms: [
6
+ "contributor",
7
+ "coverage",
8
+ "creator",
9
+ "date",
10
+ "description",
11
+ "format",
12
+ "identifier",
13
+ "language",
14
+ "publisher",
15
+ "relation",
16
+ "rights",
17
+ "source",
18
+ "subject",
19
+ "title",
20
+ "type",
21
+ ],
22
+ });
@@ -0,0 +1,70 @@
1
+ import { createNamespace } from "./namespace.js";
2
+ export default createNamespace({
3
+ iri: "http://xmlns.com/foaf/0.1/",
4
+ prefix: "foaf:",
5
+ terms: [
6
+ "Agent",
7
+ "Document",
8
+ "Group",
9
+ "Image",
10
+ "OnlineAccount",
11
+ "OnlineChatAccount",
12
+ "OnlineEcommerceAccount",
13
+ "OnlineGamingAccount",
14
+ "Organization",
15
+ "Person",
16
+ "PersonalProfileDocument",
17
+ "Project",
18
+ "accountName",
19
+ "accountServiceHomepage",
20
+ "aimChatID",
21
+ "based_near",
22
+ "currentProject",
23
+ "depiction",
24
+ "depicts",
25
+ "dnaChecksum",
26
+ "family_name",
27
+ "firstName",
28
+ "fundedBy",
29
+ "geekcode",
30
+ "gender",
31
+ "givenname",
32
+ "holdsAccount",
33
+ "homepage",
34
+ "icqChatID",
35
+ "img",
36
+ "interest",
37
+ "jabberID",
38
+ "knows",
39
+ "logo",
40
+ "made",
41
+ "maker",
42
+ "mbox",
43
+ "mbox_sha1sum",
44
+ "member",
45
+ "membershipClass",
46
+ "msnChatID",
47
+ "myersBriggs",
48
+ "name",
49
+ "nick",
50
+ "page",
51
+ "pastProject",
52
+ "phone",
53
+ "plan",
54
+ "primaryTopic",
55
+ "publications",
56
+ "schoolHomepage",
57
+ "sha1",
58
+ "surname",
59
+ "theme",
60
+ "thumbnail",
61
+ "tipjar",
62
+ "title",
63
+ "topic",
64
+ "topic_interest",
65
+ "weblog",
66
+ "workInfoHomepage",
67
+ "workplaceHomepage",
68
+ "yahooChatID",
69
+ ],
70
+ });
@@ -0,0 +1,176 @@
1
+ import { createNamespace } from "./namespace.js";
2
+ export default createNamespace({
3
+ iri: "http://purl.org/goodrelations/v1#",
4
+ prefix: "gr:",
5
+ terms: [
6
+ "ActualProductOrServiceInstance",
7
+ "AmericanExpress",
8
+ "Brand",
9
+ "Business",
10
+ "BusinessEntity",
11
+ "BusinessEntityType",
12
+ "BusinessFunction",
13
+ "Buy",
14
+ "ByBankTransferInAdvance",
15
+ "ByInvoice",
16
+ "COD",
17
+ "Cash",
18
+ "CheckInAdvance",
19
+ "ConstructionInstallation",
20
+ "DHL",
21
+ "DayOfWeek",
22
+ "DeliveryChargeSpecification",
23
+ "DeliveryMethod",
24
+ "DeliveryModeDirectDownload",
25
+ "DeliveryModeFreight",
26
+ "DeliveryModeMail",
27
+ "DeliveryModeOwnFleet",
28
+ "DeliveryModeParcelService",
29
+ "DeliveryModePickUp",
30
+ "DinersClub",
31
+ "DirectDebit",
32
+ "Discover",
33
+ "Dispose",
34
+ "Enduser",
35
+ "FederalExpress",
36
+ "Friday",
37
+ "GoogleCheckout",
38
+ "Individual",
39
+ "JCB",
40
+ "LeaseOut",
41
+ "License",
42
+ "Location",
43
+ "LocationOfSalesOrServiceProvisioning",
44
+ "Maintain",
45
+ "MasterCard",
46
+ "Monday",
47
+ "Offering",
48
+ "OpeningHoursSpecification",
49
+ "PayPal",
50
+ "PaySwarm",
51
+ "PaymentChargeSpecification",
52
+ "PaymentMethod",
53
+ "PaymentMethodCreditCard",
54
+ "PriceSpecification",
55
+ "ProductOrService",
56
+ "ProductOrServiceModel",
57
+ "ProductOrServicesSomeInstancesPlaceholder",
58
+ "ProvideService",
59
+ "PublicHolidays",
60
+ "PublicInstitution",
61
+ "QualitativeValue",
62
+ "QuantitativeValue",
63
+ "QuantitativeValueFloat",
64
+ "QuantitativeValueInteger",
65
+ "Repair",
66
+ "Reseller",
67
+ "Saturday",
68
+ "Sell",
69
+ "SomeItems",
70
+ "Sunday",
71
+ "Thursday",
72
+ "Tuesday",
73
+ "TypeAndQuantityNode",
74
+ "UPS",
75
+ "UnitPriceSpecification",
76
+ "VISA",
77
+ "WarrantyPromise",
78
+ "WarrantyScope",
79
+ "Wednesday",
80
+ "acceptedPaymentMethods",
81
+ "addOn",
82
+ "advanceBookingRequirement",
83
+ "amountOfThisGood",
84
+ "appliesToDeliveryMethod",
85
+ "appliesToPaymentMethod",
86
+ "availabilityEnds",
87
+ "availabilityStarts",
88
+ "availableAtOrFrom",
89
+ "availableDeliveryMethods",
90
+ "billingIncrement",
91
+ "category",
92
+ "closes",
93
+ "color",
94
+ "condition",
95
+ "datatypeProductOrServiceProperty",
96
+ "deliveryLeadTime",
97
+ "depth",
98
+ "description",
99
+ "displayPosition",
100
+ "durationOfWarrantyInMonths",
101
+ "eligibleCustomerTypes",
102
+ "eligibleDuration",
103
+ "eligibleRegions",
104
+ "eligibleTransactionVolume",
105
+ "equal",
106
+ "greater",
107
+ "greaterOrEqual",
108
+ "hasBrand",
109
+ "hasBusinessFunction",
110
+ "hasCurrency",
111
+ "hasCurrencyValue",
112
+ "hasDUNS",
113
+ "hasEligibleQuantity",
114
+ "hasGlobalLocationNumber",
115
+ "hasISICv4",
116
+ "hasInventoryLevel",
117
+ "hasMPN",
118
+ "hasMakeAndModel",
119
+ "hasManufacturer",
120
+ "hasMaxCurrencyValue",
121
+ "hasMaxValue",
122
+ "hasMaxValueFloat",
123
+ "hasMaxValueInteger",
124
+ "hasMinCurrencyValue",
125
+ "hasMinValue",
126
+ "hasMinValueFloat",
127
+ "hasMinValueInteger",
128
+ "hasNAICS",
129
+ "hasNext",
130
+ "hasOpeningHoursDayOfWeek",
131
+ "hasOpeningHoursSpecification",
132
+ "hasPOS",
133
+ "hasPrevious",
134
+ "hasPriceSpecification",
135
+ "hasStockKeepingUnit",
136
+ "hasUnitOfMeasurement",
137
+ "hasValue",
138
+ "hasValueFloat",
139
+ "hasValueInteger",
140
+ "hasWarrantyPromise",
141
+ "hasWarrantyScope",
142
+ "height",
143
+ "includes",
144
+ "includesObject",
145
+ "isAccessoryOrSparePartFor",
146
+ "isConsumableFor",
147
+ "isListPrice",
148
+ "isSimilarTo",
149
+ "isVariantOf",
150
+ "legalName",
151
+ "lesser",
152
+ "lesserOrEqual",
153
+ "name",
154
+ "nonEqual",
155
+ "offers",
156
+ "opens",
157
+ "owns",
158
+ "predecessorOf",
159
+ "priceType",
160
+ "qualitativeProductOrServiceProperty",
161
+ "quantitativeProductOrServiceProperty",
162
+ "relatedWebService",
163
+ "seeks",
164
+ "serialNumber",
165
+ "successorOf",
166
+ "taxID",
167
+ "typeOfGood",
168
+ "validFrom",
169
+ "validThrough",
170
+ "valueAddedTaxIncluded",
171
+ "valueReference",
172
+ "vatID",
173
+ "weight",
174
+ "width",
175
+ ],
176
+ });
@@ -1,8 +1,13 @@
1
- export { default as rdf } from "./rdf.js";
2
- export { default as rdfs } from "./rdfs.js";
1
+ export { default as dbo } from "./dbo.js";
2
+ export { default as dc } from "./dc.js";
3
3
  export { default as dcterms } from "./dcterms.js";
4
+ export { default as foaf } from "./foaf.js";
5
+ export { default as gr } from "./gr.js";
4
6
  export { default as ldkit } from "./ldkit.js";
7
+ export { default as rdf } from "./rdf.js";
8
+ export { default as rdfs } from "./rdfs.js";
5
9
  export { default as schema } from "./schema.js";
10
+ export { default as sioc } from "./sioc.js";
6
11
  export { default as skos } from "./skos.js";
7
12
  export { default as xsd } from "./xsd.js";
8
13
  export { createNamespace } from "./namespace.js";
@@ -0,0 +1,106 @@
1
+ import { createNamespace } from "./namespace.js";
2
+ export default createNamespace({
3
+ iri: "http://rdfs.org/sioc/ns#",
4
+ prefix: "sioc:",
5
+ terms: [
6
+ "Community",
7
+ "Container",
8
+ "Forum",
9
+ "Item",
10
+ "Post",
11
+ "Role",
12
+ "Site",
13
+ "Space",
14
+ "Thread",
15
+ "User",
16
+ "UserAccount",
17
+ "Usergroup",
18
+ "about",
19
+ "account_of",
20
+ "addressed_to",
21
+ "administrator_of",
22
+ "attachment",
23
+ "avatar",
24
+ "container_of",
25
+ "content",
26
+ "content_encoded",
27
+ "created_at",
28
+ "creator_of",
29
+ "delivered_at",
30
+ "description",
31
+ "discussion_of",
32
+ "earlier_version",
33
+ "email",
34
+ "email_sha1",
35
+ "embeds_knowledge",
36
+ "feed",
37
+ "first_name",
38
+ "follows",
39
+ "function_of",
40
+ "generator",
41
+ "group_of",
42
+ "has_administrator",
43
+ "has_container",
44
+ "has_creator",
45
+ "has_discussion",
46
+ "has_function",
47
+ "has_group",
48
+ "has_host",
49
+ "has_member",
50
+ "has_moderator",
51
+ "has_modifier",
52
+ "has_owner",
53
+ "has_parent",
54
+ "has_part",
55
+ "has_reply",
56
+ "has_scope",
57
+ "has_space",
58
+ "has_subscriber",
59
+ "has_usergroup",
60
+ "host_of",
61
+ "id",
62
+ "ip_address",
63
+ "last_activity_date",
64
+ "last_item_date",
65
+ "last_name",
66
+ "last_reply_date",
67
+ "later_version",
68
+ "latest_version",
69
+ "likes",
70
+ "link",
71
+ "links_to",
72
+ "member_of",
73
+ "mentions",
74
+ "moderator_of",
75
+ "modified_at",
76
+ "modifier_of",
77
+ "name",
78
+ "next_by_date",
79
+ "next_version",
80
+ "note",
81
+ "num_authors",
82
+ "num_items",
83
+ "num_replies",
84
+ "num_threads",
85
+ "num_views",
86
+ "owner_of",
87
+ "parent_of",
88
+ "part_of",
89
+ "previous_by_date",
90
+ "previous_version",
91
+ "read_at",
92
+ "reference",
93
+ "related_to",
94
+ "reply_of",
95
+ "respond_to",
96
+ "scope_of",
97
+ "shared_by",
98
+ "sibling",
99
+ "space_of",
100
+ "subject",
101
+ "subscriber_of",
102
+ "title",
103
+ "topic",
104
+ "usergroup_of",
105
+ ],
106
+ });
@@ -40,7 +40,7 @@ export class Resource {
40
40
  }
41
41
  async count() {
42
42
  const q = this.queryBuilder.countQuery();
43
- console.log(q);
43
+ // TODO: console.log(q);
44
44
  const bindings = await this.engine.queryBindings(q);
45
45
  return parseInt(bindings[0].get("count").value);
46
46
  }
@@ -51,7 +51,7 @@ export class Resource {
51
51
  }
52
52
  async find(where, limit) {
53
53
  const q = this.queryBuilder.getQuery(where, limit);
54
- console.log(q);
54
+ // TODO: console.log(q);
55
55
  const graph = await this.engine.queryGraph(q);
56
56
  return this.decode(graph);
57
57
  }
@@ -61,12 +61,12 @@ export class Resource {
61
61
  }
62
62
  async findByIris(iris) {
63
63
  const q = this.queryBuilder.getByIrisQuery(iris);
64
- console.log(q);
64
+ // TODO: console.log(q);
65
65
  const graph = await this.engine.queryGraph(q);
66
66
  return this.decode(graph);
67
67
  }
68
68
  updateQuery(query) {
69
- console.log(query);
69
+ // TODO: console.log(query);
70
70
  return this.engine.queryVoid(query);
71
71
  }
72
72
  insert(...entities) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "types": "./types/mod.d.ts",
5
5
  "name": "ldkit",
6
- "version": "0.6.1",
6
+ "version": "0.6.3",
7
7
  "description": "LDkit, a Linked Data query toolkit for TypeScript developers",
8
8
  "homepage": "https://ldkit.io",
9
9
  "author": "Karel Klima <karelklima@gmail.com> (https://karelklima.com)",
@@ -51,14 +51,9 @@ class Decoder {
51
51
  decode() {
52
52
  const output = [];
53
53
  for (const [iri, properties] of this.graph) {
54
- console.warn("IRI", iri);
55
54
  if (properties.has(mod_js_1.rdf.type)) {
56
55
  const types = properties.get(mod_js_1.rdf.type);
57
56
  for (const type of types) {
58
- console.warn("TYPE", type.value);
59
- if (type.value === mod_js_1.ldkit.Resource) {
60
- console.warn("FOUND", type);
61
- }
62
57
  if (type.termType === "NamedNode" && type.value === mod_js_1.ldkit.Resource) {
63
58
  output.push(this.decodeNode(iri, this.schema));
64
59
  }