@pod-os/core 0.16.2-rc.2f9e99a.0 → 0.16.2-rc.3fe152d.0

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/dist/index.js CHANGED
@@ -13693,13 +13693,16 @@ var Thing = class {
13693
13693
  values: values2[predicate4]
13694
13694
  }));
13695
13695
  }
13696
- relations() {
13697
- const statements = this.store.statementsMatching(namedNode(this.uri));
13696
+ relations(predicate4) {
13697
+ const statements = this.store.statementsMatching(
13698
+ namedNode(this.uri),
13699
+ predicate4 ? namedNode(predicate4) : null
13700
+ );
13698
13701
  const values2 = statements.filter((it) => isNamedNode(it.object) && !isRdfType(it.predicate)).reduce(accumulateValues, {});
13699
- return Object.keys(values2).map((predicate4) => ({
13700
- predicate: predicate4,
13701
- label: labelFromUri(predicate4),
13702
- uris: values2[predicate4]
13702
+ return Object.keys(values2).map((predicate5) => ({
13703
+ predicate: predicate5,
13704
+ label: labelFromUri(predicate5),
13705
+ uris: values2[predicate5]
13703
13706
  }));
13704
13707
  }
13705
13708
  reverseRelations() {
package/lib/index.js CHANGED
@@ -46660,13 +46660,16 @@ _:patch
46660
46660
  values: values2[predicate4]
46661
46661
  }));
46662
46662
  }
46663
- relations() {
46664
- const statements = this.store.statementsMatching(namedNode(this.uri));
46663
+ relations(predicate4) {
46664
+ const statements = this.store.statementsMatching(
46665
+ namedNode(this.uri),
46666
+ predicate4 ? namedNode(predicate4) : null
46667
+ );
46665
46668
  const values2 = statements.filter((it) => isNamedNode(it.object) && !isRdfType(it.predicate)).reduce(accumulateValues, {});
46666
- return Object.keys(values2).map((predicate4) => ({
46667
- predicate: predicate4,
46668
- label: labelFromUri(predicate4),
46669
- uris: values2[predicate4]
46669
+ return Object.keys(values2).map((predicate5) => ({
46670
+ predicate: predicate5,
46671
+ label: labelFromUri(predicate5),
46672
+ uris: values2[predicate5]
46670
46673
  }));
46671
46674
  }
46672
46675
  reverseRelations() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pod-os/core",
3
- "version": "0.16.2-rc.2f9e99a.0",
3
+ "version": "0.16.2-rc.3fe152d.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./types/index.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@ export declare class Thing {
27
27
  editable?: boolean);
28
28
  label(): string;
29
29
  literals(): Literal[];
30
- relations(): Relation[];
30
+ relations(predicate?: string): Relation[];
31
31
  reverseRelations(): Relation[];
32
32
  anyValue(...predicateUris: string[]): undefined;
33
33
  description(): undefined;